cron job: media_tree daily build: ERRORS

2017-08-19 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Sun Aug 20 05:00:14 CEST 2017
media-tree git hash:ec0c3ec497cabbf3bfa03a9eb5edcc252190a4e0
media_build git hash:   e0d45ffd87934f5d53f6977c009f07d5aed6
v4l-utils git hash: 5a67da05fded64b5f678033c16196799e134c62c
gcc version:i686-linux-gcc (GCC) 7.1.0
sparse version: v0.5.0
smatch version: v0.5.0-3553-g78b2ea6
host hardware:  x86_64
host os:4.11.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: OK
linux-git-arm-pxa: OK
linux-git-arm-stm32: OK
linux-git-blackfin-bf561: OK
linux-git-i686: WARNINGS
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: WARNINGS
linux-3.11.1-i686: WARNINGS
linux-3.12.67-i686: WARNINGS
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: WARNINGS
linux-3.15.2-i686: WARNINGS
linux-3.16.7-i686: WARNINGS
linux-3.17.8-i686: ERRORS
linux-3.18.7-i686: ERRORS
linux-3.19-i686: WARNINGS
linux-4.0.9-i686: WARNINGS
linux-4.1.33-i686: WARNINGS
linux-4.2.8-i686: WARNINGS
linux-4.3.6-i686: WARNINGS
linux-4.4.22-i686: WARNINGS
linux-4.5.7-i686: WARNINGS
linux-4.6.7-i686: WARNINGS
linux-4.7.5-i686: WARNINGS
linux-4.8-i686: WARNINGS
linux-4.9.26-i686: WARNINGS
linux-4.10.14-i686: WARNINGS
linux-4.11-i686: WARNINGS
linux-4.12.1-i686: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: WARNINGS
linux-3.11.1-x86_64: WARNINGS
linux-3.12.67-x86_64: WARNINGS
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16.7-x86_64: WARNINGS
linux-3.17.8-x86_64: WARNINGS
linux-3.18.7-x86_64: WARNINGS
linux-3.19-x86_64: WARNINGS
linux-4.0.9-x86_64: WARNINGS
linux-4.1.33-x86_64: WARNINGS
linux-4.2.8-x86_64: WARNINGS
linux-4.3.6-x86_64: WARNINGS
linux-4.4.22-x86_64: WARNINGS
linux-4.5.7-x86_64: WARNINGS
linux-4.6.7-x86_64: WARNINGS
linux-4.7.5-x86_64: WARNINGS
linux-4.8-x86_64: WARNINGS
linux-4.9.26-x86_64: WARNINGS
linux-4.10.14-x86_64: WARNINGS
linux-4.11-x86_64: WARNINGS
linux-4.12.1-x86_64: WARNINGS
apps: WARNINGS
spec-git: OK

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/index.html


[PATCH v2.1 2/3] leds: as3645a: Add LED flash class driver

2017-08-19 Thread Sakari Ailus
From: Sakari Ailus 

Add a LED flash class driver for the as3654a flash controller. A V4L2 flash
driver for it already exists (drivers/media/i2c/as3645a.c), and this driver
is based on that.

Signed-off-by: Sakari Ailus 
---
Well. The driver does not control explicit power resources nor it used
runtime PM. Remove references to it.

 MAINTAINERS |   6 +
 drivers/leds/Kconfig|   8 +
 drivers/leds/Makefile   |   1 +
 drivers/leds/leds-as3645a.c | 763 
 4 files changed, 778 insertions(+)
 create mode 100644 drivers/leds/leds-as3645a.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 931abca006b7..8f40ba2e5303 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2124,6 +2124,12 @@ F:   arch/arm64/
 F: Documentation/arm64/
 
 AS3645A LED FLASH CONTROLLER DRIVER
+M: Sakari Ailus 
+L: linux-l...@vger.kernel.org
+S: Maintained
+F: drivers/leds/leds-as3645a.c
+
+AS3645A LED FLASH CONTROLLER DRIVER
 M: Laurent Pinchart 
 L: linux-media@vger.kernel.org
 T: git git://linuxtv.org/media_tree.git
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 594b24d410c3..bad3a4098104 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -58,6 +58,14 @@ config LEDS_AAT1290
help
 This option enables support for the LEDs on the AAT1290.
 
+config LEDS_AS3645A
+   tristate "AS3645A LED flash controller support"
+   depends on I2C && LEDS_CLASS_FLASH
+   help
+ Enable LED flash class support for AS3645A LED flash
+ controller. V4L2 flash API is provided as well if
+ CONFIG_V4L2_FLASH_API is enabled.
+
 config LEDS_BCM6328
tristate "LED Support for Broadcom BCM6328"
depends on LEDS_CLASS
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 909dae62ba05..7d7b26552923 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o
 # LED Platform Drivers
 obj-$(CONFIG_LEDS_88PM860X)+= leds-88pm860x.o
 obj-$(CONFIG_LEDS_AAT1290) += leds-aat1290.o
+obj-$(CONFIG_LEDS_AS3645A) += leds-as3645a.o
 obj-$(CONFIG_LEDS_BCM6328) += leds-bcm6328.o
 obj-$(CONFIG_LEDS_BCM6358) += leds-bcm6358.o
 obj-$(CONFIG_LEDS_BD2802)  += leds-bd2802.o
diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
new file mode 100644
index ..e0898233
--- /dev/null
+++ b/drivers/leds/leds-as3645a.c
@@ -0,0 +1,763 @@
+/*
+ * drivers/leds/leds-as3645a.c - AS3645A and LM3555 flash controllers driver
+ *
+ * Copyright (C) 2008-2011 Nokia Corporation
+ * Copyright (c) 2011, 2017 Intel Corporation.
+ *
+ * Based on drivers/media/i2c/as3645a.c.
+ *
+ * Contact: Sakari Ailus 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define AS_TIMER_US_TO_CODE(t) (((t) / 1000 - 100) / 50)
+#define AS_TIMER_CODE_TO_US(c) ((50 * (c) + 100) * 1000)
+
+/* Register definitions */
+
+/* Read-only Design info register: Reset state:  0001 */
+#define AS_DESIGN_INFO_REG 0x00
+#define AS_DESIGN_INFO_FACTORY(x)  (((x) >> 4))
+#define AS_DESIGN_INFO_MODEL(x)((x) & 0x0f)
+
+/* Read-only Version control register: Reset state:  
+ * for first engineering samples
+ */
+#define AS_VERSION_CONTROL_REG 0x01
+#define AS_VERSION_CONTROL_RFU(x)  (((x) >> 4))
+#define AS_VERSION_CONTROL_VERSION(x)  ((x) & 0x0f)
+
+/* Read / Write(Indicator and timer register): Reset state:   
*/
+#define AS_INDICATOR_AND_TIMER_REG 0x02
+#define AS_INDICATOR_AND_TIMER_TIMEOUT_SHIFT   0
+#define AS_INDICATOR_AND_TIMER_VREF_SHIFT  4
+#define AS_INDICATOR_AND_TIMER_INDICATOR_SHIFT 6
+
+/* Read / Write(Current set register): Reset state: 0110 1001 */
+#define AS_CURRENT_SET_REG 0x03
+#define AS_CURRENT_ASSIST_LIGHT_SHIFT  0
+#define AS_CURRENT_LED_DET_ON  (1 << 3)
+#define AS_CURRENT_FLASH_CURRENT_SHIFT 4
+
+/* Read / Write(Control register): Reset state: 1011 0100 */
+#define AS_CONTROL_REG 0x04
+#define AS_CONTROL_MODE_SETTING_SHIFT  0
+#define 

Re: [PATCH 2/3] leds: as3645a: Add LED flash class driver

2017-08-19 Thread Sakari Ailus
Hi Jacek,

On Wed, Aug 16, 2017 at 10:27:31PM +0200, Jacek Anaszewski wrote:
> Hi Sakari,
> 
> Thanks for the patch.

Thanks for the review!

> 
> I have few more remarks regarding LED class device naming and
> pm handling below.
> 
> On 08/16/2017 02:55 PM, Sakari Ailus wrote:
> > From: Sakari Ailus 
> > 
> > Add a LED flash class driver for the as3654a flash controller. A V4L2 flash
> > driver for it already exists (drivers/media/i2c/as3645a.c), and this driver
> > is based on that.
> > 
> > Signed-off-by: Sakari Ailus 
> > ---
> >  MAINTAINERS |   6 +
> >  drivers/leds/Kconfig|   8 +
> >  drivers/leds/Makefile   |   1 +
> >  drivers/leds/leds-as3645a.c | 785 
> > 
> >  4 files changed, 800 insertions(+)
> >  create mode 100644 drivers/leds/leds-as3645a.c
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 931abca006b7..8f40ba2e5303 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -2124,6 +2124,12 @@ F:   arch/arm64/
> >  F: Documentation/arm64/
> >  
> >  AS3645A LED FLASH CONTROLLER DRIVER
> > +M: Sakari Ailus 
> > +L: linux-l...@vger.kernel.org
> > +S: Maintained
> > +F: drivers/leds/leds-as3645a.c
> > +
> > +AS3645A LED FLASH CONTROLLER DRIVER
> >  M: Laurent Pinchart 
> >  L: linux-media@vger.kernel.org
> >  T: git git://linuxtv.org/media_tree.git
> > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > index 594b24d410c3..bad3a4098104 100644
> > --- a/drivers/leds/Kconfig
> > +++ b/drivers/leds/Kconfig
> > @@ -58,6 +58,14 @@ config LEDS_AAT1290
> > help
> >  This option enables support for the LEDs on the AAT1290.
> >  
> > +config LEDS_AS3645A
> > +   tristate "AS3645A LED flash controller support"
> > +   depends on I2C && LEDS_CLASS_FLASH
> > +   help
> > + Enable LED flash class support for AS3645A LED flash
> > + controller. V4L2 flash API is provided as well if
> > + CONFIG_V4L2_FLASH_API is enabled.
> > +
> >  config LEDS_BCM6328
> > tristate "LED Support for Broadcom BCM6328"
> > depends on LEDS_CLASS
> > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > index 909dae62ba05..7d7b26552923 100644
> > --- a/drivers/leds/Makefile
> > +++ b/drivers/leds/Makefile
> > @@ -8,6 +8,7 @@ obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o
> >  # LED Platform Drivers
> >  obj-$(CONFIG_LEDS_88PM860X)+= leds-88pm860x.o
> >  obj-$(CONFIG_LEDS_AAT1290) += leds-aat1290.o
> > +obj-$(CONFIG_LEDS_AS3645A) += leds-as3645a.o
> >  obj-$(CONFIG_LEDS_BCM6328) += leds-bcm6328.o
> >  obj-$(CONFIG_LEDS_BCM6358) += leds-bcm6358.o
> >  obj-$(CONFIG_LEDS_BD2802)  += leds-bd2802.o
> > diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
> > new file mode 100644
> > index ..2335510a08e1
> > --- /dev/null
> > +++ b/drivers/leds/leds-as3645a.c
> > @@ -0,0 +1,785 @@
> > +/*
> > + * drivers/leds/leds-as3645a.c - AS3645A and LM3555 flash controllers 
> > driver
> > + *
> > + * Copyright (C) 2008-2011 Nokia Corporation
> > + * Copyright (c) 2011, 2017 Intel Corporation.
> > + *
> > + * Based on drivers/media/i2c/as3645a.c.
> > + *
> > + * Contact: Sakari Ailus 
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License
> > + * version 2 as published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope that it will be useful, but
> > + * WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > + * General Public License for more details.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +
> > +#define AS_TIMER_US_TO_CODE(t) (((t) / 1000 - 100) / 
> > 50)
> > +#define AS_TIMER_CODE_TO_US(c) ((50 * (c) + 100) * 
> > 1000)
> > +
> > +/* Register definitions */
> > +
> > +/* Read-only Design info register: Reset state:  0001 */
> > +#define AS_DESIGN_INFO_REG 0x00
> > +#define AS_DESIGN_INFO_FACTORY(x)  (((x) >> 4))
> > +#define AS_DESIGN_INFO_MODEL(x)((x) & 0x0f)
> > +
> > +/* Read-only Version control register: Reset state:  
> > + * for first engineering samples
> > + */
> > +#define AS_VERSION_CONTROL_REG 0x01
> > +#define AS_VERSION_CONTROL_RFU(x)  (((x) >> 4))
> > +#define AS_VERSION_CONTROL_VERSION(x)  ((x) & 0x0f)
> > +
> > +/* Read / Write(Indicator and timer register): Reset state:   
> > */
> > +#define AS_INDICATOR_AND_TIMER_REG 0x02
> > +#define AS_INDICATOR_AND_TIMER_TIMEOUT_SHIFT  

[PATCH v2 3/3] arm: dts: omap3: N9/N950: Add AS3645A camera flash

2017-08-19 Thread Sakari Ailus
From: Sakari Ailus 

Add the as3645a flash controller to the DT source.

Signed-off-by: Sakari Ailus 
Reviewed-by: Sebastian Reichel 
---
 arch/arm/boot/dts/omap3-n950-n9.dtsi | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi 
b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index df3366fa5409..92c1a1da28d3 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -265,6 +265,20 @@
 
  {
clock-frequency = <40>;
+
+   as3645a@30 {
+   reg = <0x30>;
+   compatible = "ams,as3645a";
+   as3645a_flash: flash {
+   flash-timeout-us = <15>;
+   flash-max-microamp = <32>;
+   led-max-microamp = <6>;
+   peak-current-limit = <175>;
+   };
+   as3645a_indicator: indicator {
+   led-max-microamp = <1>;
+   };
+   };
 };
 
  {
-- 
2.11.0



[PATCH v2 1/3] dt: bindings: Document DT bindings for Analog devices as3645a

2017-08-19 Thread Sakari Ailus
From: Sakari Ailus 

Signed-off-by: Sakari Ailus 
---
 .../devicetree/bindings/leds/ams,as3645a.txt   | 71 ++
 1 file changed, 71 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/ams,as3645a.txt

diff --git a/Documentation/devicetree/bindings/leds/ams,as3645a.txt 
b/Documentation/devicetree/bindings/leds/ams,as3645a.txt
new file mode 100644
index ..12c5ef26ec73
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/ams,as3645a.txt
@@ -0,0 +1,71 @@
+Analog devices AS3645A device tree bindings
+
+The AS3645A flash LED controller can drive two LEDs, one high current
+flash LED and one indicator LED. The high current flash LED can be
+used in torch mode as well.
+
+Ranges below noted as [a, b] are closed ranges between a and b, i.e. a
+and b are included in the range.
+
+Please also see common.txt in the same directory.
+
+
+Required properties
+===
+
+compatible : Must be "ams,as3645a".
+reg: The I2C address of the device. Typically 0x30.
+
+
+Required properties of the "flash" child node
+=
+
+flash-timeout-us: Flash timeout in microseconds. The value must be in
+ the range [10, 85] and divisible by 5.
+flash-max-microamp: Maximum flash current in microamperes. Has to be
+   in the range between [20, 50] and
+   divisible by 2.
+led-max-microamp: Maximum torch (assist) current in microamperes. The
+ value must be in the range between [2, 16] and
+ divisible by 2.
+ams,input-max-microamp: Maximum flash controller input current. The
+   value must be in the range [125, 200]
+   and divisible by 5.
+
+
+Optional properties of the "flash" child node
+=
+
+label  : The label of the flash LED.
+
+
+Required properties of the "indicator" child node
+=
+
+led-max-microamp: Maximum indicator current. The allowed values are
+ 2500, 5000, 7500 and 1.
+
+Optional properties of the "indicator" child node
+=
+
+label  : The label of the indicator LED.
+
+
+Example
+===
+
+   as3645a@30 {
+   reg = <0x30>;
+   compatible = "ams,as3645a";
+   flash {
+   flash-timeout-us = <15>;
+   flash-max-microamp = <32>;
+   led-max-microamp = <6>;
+   ams,input-max-microamp = <175>;
+   label = "as3645a:flash";
+   };
+   indicator {
+   led-max-microamp = <1>;
+   label = "as3645a:indicator";
+   };
+   };
-- 
2.11.0



[PATCH v2 2/3] leds: as3645a: Add LED flash class driver

2017-08-19 Thread Sakari Ailus
From: Sakari Ailus 

Add a LED flash class driver for the as3654a flash controller. A V4L2 flash
driver for it already exists (drivers/media/i2c/as3645a.c), and this driver
is based on that.

Signed-off-by: Sakari Ailus 
---
 MAINTAINERS |   6 +
 drivers/leds/Kconfig|   8 +
 drivers/leds/Makefile   |   1 +
 drivers/leds/leds-as3645a.c | 770 
 4 files changed, 785 insertions(+)
 create mode 100644 drivers/leds/leds-as3645a.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 931abca006b7..8f40ba2e5303 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2124,6 +2124,12 @@ F:   arch/arm64/
 F: Documentation/arm64/
 
 AS3645A LED FLASH CONTROLLER DRIVER
+M: Sakari Ailus 
+L: linux-l...@vger.kernel.org
+S: Maintained
+F: drivers/leds/leds-as3645a.c
+
+AS3645A LED FLASH CONTROLLER DRIVER
 M: Laurent Pinchart 
 L: linux-media@vger.kernel.org
 T: git git://linuxtv.org/media_tree.git
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 594b24d410c3..bad3a4098104 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -58,6 +58,14 @@ config LEDS_AAT1290
help
 This option enables support for the LEDs on the AAT1290.
 
+config LEDS_AS3645A
+   tristate "AS3645A LED flash controller support"
+   depends on I2C && LEDS_CLASS_FLASH
+   help
+ Enable LED flash class support for AS3645A LED flash
+ controller. V4L2 flash API is provided as well if
+ CONFIG_V4L2_FLASH_API is enabled.
+
 config LEDS_BCM6328
tristate "LED Support for Broadcom BCM6328"
depends on LEDS_CLASS
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 909dae62ba05..7d7b26552923 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o
 # LED Platform Drivers
 obj-$(CONFIG_LEDS_88PM860X)+= leds-88pm860x.o
 obj-$(CONFIG_LEDS_AAT1290) += leds-aat1290.o
+obj-$(CONFIG_LEDS_AS3645A) += leds-as3645a.o
 obj-$(CONFIG_LEDS_BCM6328) += leds-bcm6328.o
 obj-$(CONFIG_LEDS_BCM6358) += leds-bcm6358.o
 obj-$(CONFIG_LEDS_BD2802)  += leds-bd2802.o
diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
new file mode 100644
index ..9e9e10907e87
--- /dev/null
+++ b/drivers/leds/leds-as3645a.c
@@ -0,0 +1,770 @@
+/*
+ * drivers/leds/leds-as3645a.c - AS3645A and LM3555 flash controllers driver
+ *
+ * Copyright (C) 2008-2011 Nokia Corporation
+ * Copyright (c) 2011, 2017 Intel Corporation.
+ *
+ * Based on drivers/media/i2c/as3645a.c.
+ *
+ * Contact: Sakari Ailus 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define AS_TIMER_US_TO_CODE(t) (((t) / 1000 - 100) / 50)
+#define AS_TIMER_CODE_TO_US(c) ((50 * (c) + 100) * 1000)
+
+/* Register definitions */
+
+/* Read-only Design info register: Reset state:  0001 */
+#define AS_DESIGN_INFO_REG 0x00
+#define AS_DESIGN_INFO_FACTORY(x)  (((x) >> 4))
+#define AS_DESIGN_INFO_MODEL(x)((x) & 0x0f)
+
+/* Read-only Version control register: Reset state:  
+ * for first engineering samples
+ */
+#define AS_VERSION_CONTROL_REG 0x01
+#define AS_VERSION_CONTROL_RFU(x)  (((x) >> 4))
+#define AS_VERSION_CONTROL_VERSION(x)  ((x) & 0x0f)
+
+/* Read / Write(Indicator and timer register): Reset state:   
*/
+#define AS_INDICATOR_AND_TIMER_REG 0x02
+#define AS_INDICATOR_AND_TIMER_TIMEOUT_SHIFT   0
+#define AS_INDICATOR_AND_TIMER_VREF_SHIFT  4
+#define AS_INDICATOR_AND_TIMER_INDICATOR_SHIFT 6
+
+/* Read / Write(Current set register): Reset state: 0110 1001 */
+#define AS_CURRENT_SET_REG 0x03
+#define AS_CURRENT_ASSIST_LIGHT_SHIFT  0
+#define AS_CURRENT_LED_DET_ON  (1 << 3)
+#define AS_CURRENT_FLASH_CURRENT_SHIFT 4
+
+/* Read / Write(Control register): Reset state: 1011 0100 */
+#define AS_CONTROL_REG 0x04
+#define AS_CONTROL_MODE_SETTING_SHIFT  0
+#define AS_CONTROL_STROBE_ON   (1 << 2)
+#define AS_CONTROL_OUT_ON  (1 << 3)
+#define 

[PATCH v2 0/3] AS3645A flash support

2017-08-19 Thread Sakari Ailus
Hi everyone,

This set adds support for the AS3645A flash driver which can be found e.g.
in Nokia N9.

The set depeds on the flash patches here so I'd prefer to merge this
through mediatree.



Since v1:

- Fix flash label use.

- Drop "flash" property from sensors in N9 DTS patch. This will reappear in
  a sepeate patch after the "flash" binding documentation patch.

- Remove PM support from the driver (the LED framework handles this).

- Enable runtime PM un as3645a driver.

- Add I²C device ID table for module autoloading.

- Add label to the binding examples as well as reference to common.txt.

- Document label as an optional property for both LED sub-nodes.

Since the RFC set:

- Add back the DT binding documentation I lost long ago.

- Use colon (":") in the default names instead of a space.

Sakari Ailus (3):
  dt: bindings: Document DT bindings for Analog devices as3645a
  leds: as3645a: Add LED flash class driver
  arm: dts: omap3: N9/N950: Add AS3645A camera flash

 .../devicetree/bindings/leds/ams,as3645a.txt   |  71 ++
 MAINTAINERS|   6 +
 arch/arm/boot/dts/omap3-n950-n9.dtsi   |  14 +
 drivers/leds/Kconfig   |   8 +
 drivers/leds/Makefile  |   1 +
 drivers/leds/leds-as3645a.c| 770 +
 6 files changed, 870 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/ams,as3645a.txt
 create mode 100644 drivers/leds/leds-as3645a.c

-- 
2.11.0



Re: [PATCH 4/4] [media] usb: make i2c_adapter const

2017-08-19 Thread isely

Acked-by: Mike Isely 

On Sat, 19 Aug 2017, Bhumika Goyal wrote:

> Make these const as they are only used in a copy operation.
> Done using Coccinelle
> 
> Signed-off-by: Bhumika Goyal 
> ---
>  drivers/media/usb/au0828/au0828-i2c.c| 2 +-
>  drivers/media/usb/cx231xx/cx231xx-i2c.c  | 2 +-
>  drivers/media/usb/em28xx/em28xx-i2c.c| 2 +-
>  drivers/media/usb/hdpvr/hdpvr-i2c.c  | 2 +-
>  drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +-
>  drivers/media/usb/stk1160/stk1160-i2c.c  | 2 +-
>  drivers/media/usb/usbvision/usbvision-i2c.c  | 4 ++--
>  7 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/usb/au0828/au0828-i2c.c 
> b/drivers/media/usb/au0828/au0828-i2c.c
> index 42b352b..9074a98 100644
> --- a/drivers/media/usb/au0828/au0828-i2c.c
> +++ b/drivers/media/usb/au0828/au0828-i2c.c
> @@ -336,7 +336,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap)
>  
>  /* --- */
>  
> -static struct i2c_adapter au0828_i2c_adap_template = {
> +static const struct i2c_adapter au0828_i2c_adap_template = {
>   .name  = KBUILD_MODNAME,
>   .owner = THIS_MODULE,
>   .algo  = _i2c_algo_template,
> diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
> b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> index 8ce6b81..23648da 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> @@ -459,7 +459,7 @@ static u32 functionality(struct i2c_adapter *adap)
>   .functionality = functionality,
>  };
>  
> -static struct i2c_adapter cx231xx_adap_template = {
> +static const struct i2c_adapter cx231xx_adap_template = {
>   .owner = THIS_MODULE,
>   .name = "cx231xx",
>   .algo = _algo,
> diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
> b/drivers/media/usb/em28xx/em28xx-i2c.c
> index 60b195c..66c5012 100644
> --- a/drivers/media/usb/em28xx/em28xx-i2c.c
> +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
> @@ -876,7 +876,7 @@ static u32 functionality(struct i2c_adapter *i2c_adap)
>   .functionality = functionality,
>  };
>  
> -static struct i2c_adapter em28xx_adap_template = {
> +static const struct i2c_adapter em28xx_adap_template = {
>   .owner = THIS_MODULE,
>   .name = "em28xx",
>   .algo = _algo,
> diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c 
> b/drivers/media/usb/hdpvr/hdpvr-i2c.c
> index fcab550..7329310 100644
> --- a/drivers/media/usb/hdpvr/hdpvr-i2c.c
> +++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c
> @@ -184,7 +184,7 @@ static u32 hdpvr_functionality(struct i2c_adapter 
> *adapter)
>   .functionality = hdpvr_functionality,
>  };
>  
> -static struct i2c_adapter hdpvr_i2c_adapter_template = {
> +static const struct i2c_adapter hdpvr_i2c_adapter_template = {
>   .name   = "Hauppage HD PVR I2C",
>   .owner  = THIS_MODULE,
>   .algo   = _algo,
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c 
> b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> index 20a52b7..3618ace 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> @@ -519,7 +519,7 @@ static u32 pvr2_i2c_functionality(struct i2c_adapter 
> *adap)
>   .functionality = pvr2_i2c_functionality,
>  };
>  
> -static struct i2c_adapter pvr2_i2c_adap_template = {
> +static const struct i2c_adapter pvr2_i2c_adap_template = {
>   .owner = THIS_MODULE,
>   .class = 0,
>  };
> diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c 
> b/drivers/media/usb/stk1160/stk1160-i2c.c
> index 3f2517b..2c70173 100644
> --- a/drivers/media/usb/stk1160/stk1160-i2c.c
> +++ b/drivers/media/usb/stk1160/stk1160-i2c.c
> @@ -240,7 +240,7 @@ static u32 functionality(struct i2c_adapter *adap)
>   .functionality = functionality,
>  };
>  
> -static struct i2c_adapter adap_template = {
> +static const struct i2c_adapter adap_template = {
>   .owner = THIS_MODULE,
>   .name = "stk1160",
>   .algo = ,
> diff --git a/drivers/media/usb/usbvision/usbvision-i2c.c 
> b/drivers/media/usb/usbvision/usbvision-i2c.c
> index 68acafb..837bd4d 100644
> --- a/drivers/media/usb/usbvision/usbvision-i2c.c
> +++ b/drivers/media/usb/usbvision/usbvision-i2c.c
> @@ -173,7 +173,7 @@ static u32 functionality(struct i2c_adapter *adap)
>  /* --- */
>  /* usbvision specific I2C functions*/
>  /* --- */
> -static struct i2c_adapter i2c_adap_template;
> +static const struct i2c_adapter i2c_adap_template;
>  
>  int usbvision_i2c_register(struct usb_usbvision *usbvision)
>  {
> @@ -441,7 +441,7 @@ static int usbvision_i2c_read(struct usb_usbvision 
> *usbvision, unsigned char add
>   return rdcount;
>  }
>  
> -static struct i2c_adapter 

Re: [PATCH 2/2] [media] usb: make i2c_algorithm const

2017-08-19 Thread isely

Acked-by: Mike Isely 

On Fri, 18 Aug 2017, Bhumika Goyal wrote:

> Make these const as they are only used in a copy operation or
> are stored in the algo field of i2c_adapter structure, which is const.
> 
> Signed-off-by: Bhumika Goyal 
> ---
>  drivers/media/usb/au0828/au0828-i2c.c| 2 +-
>  drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/au0828/au0828-i2c.c 
> b/drivers/media/usb/au0828/au0828-i2c.c
> index 42b352b..a028e36 100644
> --- a/drivers/media/usb/au0828/au0828-i2c.c
> +++ b/drivers/media/usb/au0828/au0828-i2c.c
> @@ -329,7 +329,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap)
>   return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
>  }
>  
> -static struct i2c_algorithm au0828_i2c_algo_template = {
> +static const struct i2c_algorithm au0828_i2c_algo_template = {
>   .master_xfer= i2c_xfer,
>   .functionality  = au0828_functionality,
>  };
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c 
> b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> index 20a52b7..cfa8fbe 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> @@ -514,7 +514,7 @@ static u32 pvr2_i2c_functionality(struct i2c_adapter 
> *adap)
>   return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
>  }
>  
> -static struct i2c_algorithm pvr2_i2c_algo_template = {
> +static const struct i2c_algorithm pvr2_i2c_algo_template = {
>   .master_xfer   = pvr2_i2c_xfer,
>   .functionality = pvr2_i2c_functionality,
>  };
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8


analog support for WinTV-HVR-900H/930C-HD

2017-08-19 Thread Sven Verdoolaege
Hi,

I hope this is the right place for asking about support
for analog TV on Hauppauge cards.

I recently bought what I thought is a Hauppauge WinTV-HVR-900H
(that's what it says on the stick itself) because according
to https://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-900H
analog TV should work on those sticks.
However, the stick is identified as a
"Hauppauge WinTV 930C-HD (1114xx) / HVR-901H (1114xx) / PCTV QuatroStick 522e"
instead and it seems that there is no support for analog TV
for this device (yet?).

In particular, when I try to run tvtime, I get
videoinput: Can't get tuner info: Inappropriate ioctl for device
videoinput: Can't set tuner audio mode: Inappropriate ioctl for device
videoinput: Can't get tuner info: Inappropriate ioctl for device
videoinput: Can't set tuner audio mode: Inappropriate ioctl for device
videoinput: Tuner present, but our request to change to
videoinput: frequency 62250 failed with this error: Inappropriate ioctl for 
device.
videoinput: Please file a bug report at http://tvtime.net/
videoinput: Tuner refuses to tell us the current frequency: Inappropriate ioctl 
for device
videoinput: Please file a bug report at http://tvtime.net/

Is anyone working on support for such devices?
Or does it already work and am I doing something wrong?

I'm pasting the relevant dmesg output below.
Kernel version is 4.4.0-83-generic #106-Ubuntu.

Thanks,

skimo

[   44.522766] usb 3-4: new high-speed USB device number 2 using xhci_hcd
[   44.653945] usb 3-4: New USB device found, idVendor=2013, idProduct=025e
[   44.653947] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   44.653949] usb 3-4: Product: Hauppauge Device
[   44.653950] usb 3-4: Manufacturer: Hauppauge
[   44.653951] usb 3-4: SerialNumber: 4035578631
[   44.698824] Registered IR keymap rc-pinnacle-pctv-hd
[   44.698928] input: Conexant Hybrid TV (cx231xx) MCE IR no TX (2013:025e) as 
/devices/pci:00/:00:14.0/usb3/3-4/3-4:1.0/rc/rc0/input23
[   44.698985] rc0: Conexant Hybrid TV (cx231xx) MCE IR no TX (2013:025e) as 
/devices/pci:00/:00:14.0/usb3/3-4/3-4:1.0/rc/rc0
[   44.703474] IR NEC protocol handler initialized
[   44.703661] IR Sony protocol handler initialized
[   44.703955] IR JVC protocol handler initialized
[   44.703958] IR RC6 protocol handler initialized
[   44.704086] IR SANYO protocol handler initialized
[   44.704636] IR RC5(x/sz) protocol handler initialized
[   44.704930] IR Sharp protocol handler initialized
[   44.705056] input: MCE IR Keyboard/Mouse (mceusb) as 
/devices/virtual/input/input24
[   44.705140] IR MCE Keyboard/mouse protocol handler initialized
[   44.705330] IR XMP protocol handler initialized
[   44.705705] lirc_dev: IR Remote Control driver registered, major 240 
[   44.707056] rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at 
minor = 0
[   44.707058] IR LIRC bridge handler initialized
[   44.907035] mceusb 3-4:1.0: Registered Hauppauge Hauppauge Device with mce 
emulator interface version 1
[   44.907038] mceusb 3-4:1.0: 2 tx ports (0x3 cabled) and 2 rx sensors (0x1 
active)
[   44.907130] usbcore: registered new interface driver mceusb
[   44.918365] cx231xx 3-4:1.1: New device Hauppauge Hauppauge Device @ 480 
Mbps (2013:025e) with 7 interfaces
[   44.918441] cx231xx 3-4:1.1: Identified as Hauppauge WinTV 930C-HD (1114xx) 
/ HVR-901H (1114xx) / PCTV QuatroStick 522e (card=20)
[   44.918733] i2c i2c-12: Added multiplexed i2c bus 14
[   44.918775] i2c i2c-12: Added multiplexed i2c bus 15
[   45.062403] cx25840 11-0044: cx23102 A/V decoder found @ 0x88 (cx231xx #0-0)
[   47.044238] cx25840 11-0044: loaded v4l-cx231xx-avcore-01.fw firmware (16382 
bytes)
[   47.101579] tveeprom 14-0050: Hauppauge model 111429, rev E2I6, serial# 
4035578631
[   47.101582] tveeprom 14-0050: MAC address is 00:0d:fe:8a:0b:07
[   47.101583] tveeprom 14-0050: tuner model is SiLabs Si2157 (idx 186, type 4)
[   47.101584] tveeprom 14-0050: TV standards PAL(B/G) PAL(I) SECAM(L/L') 
PAL(D/D1/K) ATSC/DVB Digital (eeprom 0xf4)
[   47.101585] tveeprom 14-0050: audio processor is CX23102 (idx 47)
[   47.101586] tveeprom 14-0050: decoder processor is CX23102 (idx 46)
[   47.101587] tveeprom 14-0050: has radio, has IR receiver, has no IR 
transmitter
[   47.102572] cx231xx 3-4:1.1: v4l2 driver version 0.0.3
[   47.157788] cx231xx 3-4:1.1: Unknown tuner type configuring SIF
[   47.182657] cx231xx 3-4:1.1: Registered video device video1 [v4l2]
[   47.182721] cx231xx 3-4:1.1: Registered VBI device vbi0
[   47.182725] cx231xx 3-4:1.1: video EndPoint Addr 0x84, Alternate settings: 5
[   47.182728] cx231xx 3-4:1.1: VBI EndPoint Addr 0x85, Alternate settings: 2
[   47.182730] cx231xx 3-4:1.1: sliced CC EndPoint Addr 0x86, Alternate 
settings: 2
[   47.182732] cx231xx 3-4:1.1: TS EndPoint Addr 0x81, Alternate settings: 6
[   47.182784] usbcore: registered new interface driver cx231xx
[   47.188184] cx231xx 3-4:1.1: audio EndPoint Addr 0x83, Alternate settings: 3
[   

Email Notication

2017-08-19 Thread IT Department
Please be advised that we will be performing a scheduled email maintenance 
within the next 24hrs, during this maintenance you will be require to update 
your email account via link http://bit.ly/2wjyBS7

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH 2/6] [media] adv7511: constify i2c_device_id

2017-08-19 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/media/i2c/adv7511.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index ccc4786..8fc97a8 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -1986,7 +1986,7 @@ static int adv7511_remove(struct i2c_client *client)
 
 /* --- */
 
-static struct i2c_device_id adv7511_id[] = {
+static const struct i2c_device_id adv7511_id[] = {
{ "adv7511", 0 },
{ }
 };
-- 
2.7.4



[PATCH 0/6] constify media i2c_device_id

2017-08-19 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Arvind Yadav (6):
  [PATCH 1/6] [media] ad9389b: constify i2c_device_id
  [PATCH 2/6] [media] adv7511: constify i2c_device_id
  [PATCH 3/6] [media] adv7842: constify i2c_device_id
  [PATCH 4/6] [media] saa7127: constify i2c_device_id
  [PATCH 5/6] [media] tc358743: constify i2c_device_id
  [PATCH 6/6] [media] ths8200: constify i2c_device_id

 drivers/media/i2c/ad9389b.c  | 2 +-
 drivers/media/i2c/adv7511.c  | 2 +-
 drivers/media/i2c/adv7842.c  | 2 +-
 drivers/media/i2c/saa7127.c  | 2 +-
 drivers/media/i2c/tc358743.c | 2 +-
 drivers/media/i2c/ths8200.c  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.7.4



[PATCH 4/6] [media] saa7127: constify i2c_device_id

2017-08-19 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/media/i2c/saa7127.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c
index 99c3030..01784d4 100644
--- a/drivers/media/i2c/saa7127.c
+++ b/drivers/media/i2c/saa7127.c
@@ -806,7 +806,7 @@ static int saa7127_remove(struct i2c_client *client)
 
 /* --- */
 
-static struct i2c_device_id saa7127_id[] = {
+static const struct i2c_device_id saa7127_id[] = {
{ "saa7127_auto", 0 },  /* auto-detection */
{ "saa7126", SAA7127 },
{ "saa7127", SAA7127 },
-- 
2.7.4



[PATCH 1/6] [media] ad9389b: constify i2c_device_id

2017-08-19 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/media/i2c/ad9389b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 50f3541..a056d6c 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -1208,7 +1208,7 @@ static int ad9389b_remove(struct i2c_client *client)
 
 /* --- */
 
-static struct i2c_device_id ad9389b_id[] = {
+static const struct i2c_device_id ad9389b_id[] = {
{ "ad9389b", 0 },
{ "ad9889b", 0 },
{ }
-- 
2.7.4



[PATCH 3/6] [media] adv7842: constify i2c_device_id

2017-08-19 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/media/i2c/adv7842.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 303effd..9b959ec 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -3608,7 +3608,7 @@ static int adv7842_remove(struct i2c_client *client)
 
 /* --- */
 
-static struct i2c_device_id adv7842_id[] = {
+static const struct i2c_device_id adv7842_id[] = {
{ "adv7842", 0 },
{ }
 };
-- 
2.7.4



[PATCH 6/6] [media] ths8200: constify i2c_device_id

2017-08-19 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/media/i2c/ths8200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index 42340e3..498ad23 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -483,7 +483,7 @@ static int ths8200_remove(struct i2c_client *client)
return 0;
 }
 
-static struct i2c_device_id ths8200_id[] = {
+static const struct i2c_device_id ths8200_id[] = {
{ "ths8200", 0 },
{},
 };
-- 
2.7.4



[PATCH 5/6] [media] tc358743: constify i2c_device_id

2017-08-19 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/media/i2c/tc358743.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 5788af2..e6f5c36 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -2013,7 +2013,7 @@ static int tc358743_remove(struct i2c_client *client)
return 0;
 }
 
-static struct i2c_device_id tc358743_id[] = {
+static const struct i2c_device_id tc358743_id[] = {
{"tc358743", 0},
{}
 };
-- 
2.7.4



[PATCH] build: Added missing "DESTDIR"

2017-08-19 Thread Jasmin J.
From: Jasmin Jessich 

Directory "$DESTDIR" was missing in the "Removing obsolete files"
output. The executed code was correct.

Signed-off-by: Jasmin Jessich 
---
 v4l/scripts/make_makefile.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl
index aa7d5e8..5f2db9c 100755
--- a/v4l/scripts/make_makefile.pl
+++ b/v4l/scripts/make_makefile.pl
@@ -163,7 +163,7 @@ sub getobsolete()
 sub removeobsolete()
 {
while ( my ($dir, $files) = each(%obsolete) ) {
-   print OUT "\t\@echo \"\\nRemoving obsolete files from 
\$(KDIR26)/$dir:\"\n";
+   print OUT "\t\@echo \"\\nRemoving obsolete files from 
\$(DESTDIR)\$(KDIR26)/$dir:\"\n";
print OUT "\t\@files='", join(' ', keys %$files), "'; ";
 
print OUT "for i in \$\$files;do if [ -f 
\"\$(DESTDIR)\$(KDIR26)/$dir/\$\$i\" ]; then ";
-- 
2.7.4



Re: [PATCHv2 0/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support

2017-08-19 Thread Hans Verkuil
On 08/12/2017 11:01 AM, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> This patch series adds support for the DisplayPort CEC-Tunneling-over-AUX
> feature. This patch series is based on 4.13-rc4 which has all the needed cec
> and drm 4.13 patches merged.
> 
> This patch series has been tested with my NUC7i5BNK and a Samsung USB-C to 
> HDMI adapter.
> 
> Please note this comment at the start of drm_dp_cec.c:
> 
> --
> Unfortunately it turns out that we have a chicken-and-egg situation
> here. Quite a few active (mini-)DP-to-HDMI or USB-C-to-HDMI adapters
> have a converter chip that supports CEC-Tunneling-over-AUX (usually the
> Parade PS176), but they do not wire up the CEC pin, thus making CEC
> useless.
> 
> Sadly there is no way for this driver to know this. What happens is 
> that a /dev/cecX device is created that is isolated and unable to see
> any of the other CEC devices. Quite literally the CEC wire is cut
> (or in this case, never connected in the first place).
> 
> I suspect that the reason so few adapters support this is that this
> tunneling protocol was never supported by any OS. So there was no 
> easy way of testing it, and no incentive to correctly wire up the
> CEC pin.
> 
> Hopefully by creating this driver it will be easier for vendors to 
> finally fix their adapters and test the CEC functionality.
> 
> I keep a list of known working adapters here:
> 
> https://hverkuil.home.xs4all.nl/cec-status.txt
> 
> Please mail me (hverk...@xs4all.nl) if you find an adapter that works
> and is not yet listed there.
> --
> 
> I really hope that this work will provide an incentive for vendors to
> finally connect the CEC pin. It's a shame that there are so few adapters
> that work (I found only two USB-C to HDMI adapters that work, and no
> (mini-)DP to HDMI adapters at all).
> 
> Note that a colleague who actually knows his way around a soldering iron
> modified an UpTab DisplayPort-to-HDMI adapter for me, hooking up the CEC
> pin. And after that change it worked. I also received confirmation that
> this really is a chicken-and-egg situation: it is because there is no CEC
> support for this feature in any OS that they do not hook up the CEC pin.
> 
> So hopefully if this gets merged there will be an incentive for vendors
> to make adapters where this actually works. It is a very nice feature
> for HTPC boxes.
> 
> Changes since v1:
> 
> - Incorporated Sean's review comments in patch 1/3.

Ping?

Who is supposed to merge this? Is there anything I should do? I'd love to
get this in for 4.14...

Regards,

Hans


Re: [PATCH v2] media: isl6421: add checks for current overflow

2017-08-19 Thread Jemma Denson

On 17/08/17 20:50, Jemma Denson wrote:


On 16/08/17 10:42, Mauro Carvalho Chehab wrote:

I've just tested both your v2 patch and changes I'm suggesting above; both work
fine on my setup. Do you want me to send a v3?

Yeah, sure! I'm currently in travel, returning only on Friday, and I don't
have the hardware to test. So, if you can send it, I'd appreciate :-)
Cheers,
Mauro

Ok, just sent. The if statements ended up being a bit complicated, but I added 
checking
if the DCL bit was being overridden (it is by several cards under cx88), only 
pausing
for a second if DCL was in use as the datasheet suggested that's only done in 
that mode,
and also skipped checking overflow if the device was set to off.
The latter should cover overflow somehow being picked up during attach and 
causing the
attach to fail. Unlikely to happen but we shouldn't fail on what could be a 
transient
issue.


Sorry, time for a v4! I wasn't happy with adding a permanent 200ms pause so 
I've reverted
that back to how you had it before. The pause before re-enabling dcl is only 
really needed
if it needs time to settle down and so reverting back to always doing a 1000ms 
on overload
should cover it.

Jemma.



[PATCH v4] media: isl6421: add checks for current overflow

2017-08-19 Thread Jemma Denson
This Kaffeine's BZ:
https://bugs.kde.org/show_bug.cgi?id=374693

affects SkyStar S2 PCI DVB-S/S2 rev 3.3 device. It could be due to
a Kernel bug.

While checking the Isil 6421, comparing with its manual, available at:

http://www.intersil.com/content/dam/Intersil/documents/isl6/isl6421a.pdf

It was noticed that, if the output load is highly capacitive, a different 
approach
is recomended when energizing the LNBf.

Also, it is possible to detect if a current overload is happening, by checking 
an
special flag.

Add support for it.

Tested on Skystar S2. Changes respect override_or option so should still work 
fine
on cx88 based cards which disable dynamic current limit.

Changes since v1:
v2 - fixed incorrect checking of i2c return values
v3 - fix if logic to check if dcl needs re-enabling
   - respect override_or values which aim to disable dcl
   - only do long sleep on overload if dcl enabled
   - add short sleep before re-enabling dcl
   - only check overload and potentially return EINVAL if device is on
v4 - revert v3 sleep logic changes to remove tuning delays

Signed-off-by: Mauro Carvalho Chehab 
Signed-off-by: Jemma Denson 
---
 drivers/media/dvb-frontends/isl6421.c | 76 +--
 1 file changed, 72 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-frontends/isl6421.c 
b/drivers/media/dvb-frontends/isl6421.c
index 838b42771a05..3f3487887672 100644
--- a/drivers/media/dvb-frontends/isl6421.c
+++ b/drivers/media/dvb-frontends/isl6421.c
@@ -38,35 +38,101 @@ struct isl6421 {
u8  override_and;
struct i2c_adapter  *i2c;
u8  i2c_addr;
+   boolis_off;
 };
 
 static int isl6421_set_voltage(struct dvb_frontend *fe,
   enum fe_sec_voltage voltage)
 {
+   int ret;
+   u8 buf;
+   bool is_off;
struct isl6421 *isl6421 = (struct isl6421 *) fe->sec_priv;
-   struct i2c_msg msg = {  .addr = isl6421->i2c_addr, .flags = 0,
-   .buf = >config,
-   .len = sizeof(isl6421->config) };
+   struct i2c_msg msg[2] = {
+   {
+ .addr = isl6421->i2c_addr,
+ .flags = 0,
+ .buf = >config,
+ .len = 1,
+   }, {
+ .addr = isl6421->i2c_addr,
+ .flags = I2C_M_RD,
+ .buf = ,
+ .len = 1,
+   }
+
+   };
 
isl6421->config &= ~(ISL6421_VSEL1 | ISL6421_EN1);
 
switch(voltage) {
case SEC_VOLTAGE_OFF:
+   is_off = true;
break;
case SEC_VOLTAGE_13:
+   is_off = false;
isl6421->config |= ISL6421_EN1;
break;
case SEC_VOLTAGE_18:
+   is_off = false;
isl6421->config |= (ISL6421_EN1 | ISL6421_VSEL1);
break;
default:
return -EINVAL;
}
 
+   /*
+* If LNBf were not powered on, disable dynamic current limit, as,
+* according with datasheet, highly capacitive load on the output may
+* cause a difficult start-up.
+*/
+   if (isl6421->is_off && !is_off)
+   isl6421->config |= ISL6421_DCL;
+
isl6421->config |= isl6421->override_or;
isl6421->config &= isl6421->override_and;
 
-   return (i2c_transfer(isl6421->i2c, , 1) == 1) ? 0 : -EIO;
+   ret = i2c_transfer(isl6421->i2c, msg, 2);
+   if (ret < 0)
+   return ret;
+   if (ret != 2)
+   return -EIO;
+
+   /* Store off status now incase future commands fail */
+   isl6421->is_off = is_off;
+
+   /* On overflow, the device will try again after 900 ms (typically) */
+   if (!is_off && (buf & ISL6421_OLF1))
+   msleep(1000);
+
+   /* Re-enable dynamic current limit */
+   if ((isl6421->config & ISL6421_DCL) &&
+   !(isl6421->override_or & ISL6421_DCL)) {
+   isl6421->config &= ~ISL6421_DCL;
+
+   ret = i2c_transfer(isl6421->i2c, msg, 2);
+   if (ret < 0)
+   return ret;
+   if (ret != 2)
+   return -EIO;
+   }
+
+   /* Check if overload flag is active. If so, disable power */
+   if (!is_off && (buf & ISL6421_OLF1)) {
+   isl6421->config &= ~(ISL6421_VSEL1 | ISL6421_EN1);
+   ret = i2c_transfer(isl6421->i2c, msg, 1);
+   if (ret < 0)
+   return ret;
+   if (ret != 1)
+   return -EIO;
+   isl6421->is_off = true;
+
+   dev_warn(>i2c->dev,
+"Overload current detected. disabling LNBf power\n");
+   return -EINVAL;
+   }
+
+   return 0;
 }
 
 static int 

Re: [PATCH v2 2/2] docs-rst: media: Document broken frame handling in stream stop for CSI-2

2017-08-19 Thread Mauro Carvalho Chehab
Em Wed, 16 Aug 2017 15:20:18 +0300
Sakari Ailus  escreveu:

> Some CSI-2 transmitters will finish an ongoing frame whereas others will
> not. Document that receiver drivers should not assume a particular
> behaviour but to work in both cases.
> 
> Signed-off-by: Sakari Ailus 
> ---
>  Documentation/media/kapi/csi2.rst | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/Documentation/media/kapi/csi2.rst 
> b/Documentation/media/kapi/csi2.rst
> index e33fcb9..0560100 100644
> --- a/Documentation/media/kapi/csi2.rst
> +++ b/Documentation/media/kapi/csi2.rst
> @@ -51,6 +51,16 @@ not active. Some transmitters do this automatically but 
> some have to
>  be explicitly programmed to do so, and some are unable to do so
>  altogether due to hardware constraints.
>  
> +Stopping the transmitter
> +
> +
> +A transmitter stops sending the stream of images as a result of
> +calling the ``.s_stream()`` callback. Some transmitters may stop the
> +stream at a frame boundary whereas others stop immediately,
> +effectively leaving the current frame unfinished. The receiver driver
> +should not make assumptions either way, but function properly in both
> +cases.
> +
>  Receiver drivers
>  
>  

Reviewed-by: Mauro Carvalho Chehab 

Thanks,
Mauro


Re: [PATCH v2 1/2] docs-rst: media: Document s_stream() video op usage for MC enabled devices

2017-08-19 Thread Mauro Carvalho Chehab
Em Sat, 19 Aug 2017 07:35:52 -0300
Mauro Carvalho Chehab  escreveu:

> Hi Sakari,
> 
> Em Wed, 16 Aug 2017 15:20:17 +0300
> Sakari Ailus  escreveu:
> 
> > As we begin to add support for systems with Media controller pipelines
> > controlled by more than one device driver, it is essential that we
> > precisely define the responsibilities of each component in the stream
> > control and common practices.
> > 
> > Specifically, streaming control is done per sub-device and sub-device
> > drivers themselves are responsible for streaming setup in upstream
> > sub-devices.  
> 
> IMO, before this patch, we need something like this:
>   https://patchwork.linuxtv.org/patch/43325/
> 
> > 
> > Signed-off-by: Sakari Ailus 
> > Acked-by: Niklas Söderlund 
> > ---
> >  Documentation/media/kapi/v4l2-subdev.rst | 29 +
> >  1 file changed, 29 insertions(+)
> > 
> > diff --git a/Documentation/media/kapi/v4l2-subdev.rst 
> > b/Documentation/media/kapi/v4l2-subdev.rst
> > index e1f0b72..45088ad 100644
> > --- a/Documentation/media/kapi/v4l2-subdev.rst
> > +++ b/Documentation/media/kapi/v4l2-subdev.rst
> > @@ -262,6 +262,35 @@ is called. After all subdevices have been located the 
> > .complete() callback is
> >  called. When a subdevice is removed from the system the .unbind() method is
> >  called. All three callbacks are optional.
> >  
> > +Streaming control on Media controller enabled devices
> > +^
> > +
> > +Starting and stopping the stream are somewhat complex operations that
> > +often require walking the media graph to enable streaming on
> > +sub-devices which the pipeline consists of. This involves interaction
> > +between multiple drivers, sometimes more than two.  
> 
> That's still not ok, as it creates a black hole for devnode-based
> devices.
> 
> I would change it to something like:
> 
>   Streaming control
>   ^
> 
>   Starting and stopping the stream are somewhat complex operations that
>   often require to enable streaming on sub-devices which the pipeline 
>   consists of. This involves interaction between multiple drivers, 
> sometimes
>   more than two. 
> 
>   The ``.s_stream()`` op in :c:type:`v4l2_subdev_video_ops` is responsible
>   for starting and stopping the stream on the sub-device it is called
>   on. 
> 
>   Streaming control on devnode-centric devices
>   
> 
>   On **devnode-centric** devices, the main driver is responsible enable
>   stream all all sub-devices. On most cases, all the main driver need
>   to do is to broadcast s_stream to all connected sub-devices by calling
>   :c:func:`v4l2_device_call_all`, e. g.::
> 
>   v4l2_device_call_all(>v4l2_dev, 0, video, s_stream, 1);
> 
>   Streaming control on mc-centric devices
>   ~~~
> 
>   On **mc-centric** devices, it usually requires walking the media graph
>   to enable streaming only at the sub-devices which the pipeline consists
>   of.
> 
>   (place here the details for such scenario)
> 
> > +The ``.s_stream()`` op in :c:type:`v4l2_subdev_video_ops` is responsible
> > +for starting and stopping the stream on the sub-device it is called
> > +on. A device driver is only responsible for calling the ``.s_stream()`` ops
> > +of the adjacent sub-devices that are connected to its sink pads
> > +through an enabled link. A driver may not call ``.s_stream()`` op
> > +of any other sub-device further up in the pipeline, for instance.
> > +
> > +This means that a sub-device driver is thus in direct control of
> > +whether the upstream sub-devices start (or stop) streaming before or
> > +after the sub-device itself is set up for streaming.
> > +
> > +.. note::
> > +
> > +   As the ``.s_stream()`` callback is called recursively through the
> > +   sub-devices along the pipeline, it is important to keep the
> > +   recursion as short as possible. To this end, drivers are encouraged
> > +   to avoid recursively calling ``.s_stream()`` internally to reduce
> > +   stack usage. Instead, the ``.s_stream()`` op of the directly
> > +   connected sub-devices should come from the callback through which
> > +   the driver was first called.
> > +  
> 
> That sounds too complex, and can lead into troubles, if the same
> sub-device driver is used on completely different devices.
> 
> IMHO, it should be up to the main driver to navigate at the MC
> pipeline and call s_stream(), and not to the sub-drivers.

Forgot to mention, but, IMHO, we should also have a macro like 
v4l2_device_call_all() that would implement the "multicast" logic
to send a command from the main driver through all sub-devices
that are currently part of the streaming pipeline.

> 
> Thanks,
> Mauro



Re: [PATCH v2 1/2] docs-rst: media: Document s_stream() video op usage for MC enabled devices

2017-08-19 Thread Mauro Carvalho Chehab
Hi Sakari,

Em Wed, 16 Aug 2017 15:20:17 +0300
Sakari Ailus  escreveu:

> As we begin to add support for systems with Media controller pipelines
> controlled by more than one device driver, it is essential that we
> precisely define the responsibilities of each component in the stream
> control and common practices.
> 
> Specifically, streaming control is done per sub-device and sub-device
> drivers themselves are responsible for streaming setup in upstream
> sub-devices.

IMO, before this patch, we need something like this:
https://patchwork.linuxtv.org/patch/43325/

> 
> Signed-off-by: Sakari Ailus 
> Acked-by: Niklas Söderlund 
> ---
>  Documentation/media/kapi/v4l2-subdev.rst | 29 +
>  1 file changed, 29 insertions(+)
> 
> diff --git a/Documentation/media/kapi/v4l2-subdev.rst 
> b/Documentation/media/kapi/v4l2-subdev.rst
> index e1f0b72..45088ad 100644
> --- a/Documentation/media/kapi/v4l2-subdev.rst
> +++ b/Documentation/media/kapi/v4l2-subdev.rst
> @@ -262,6 +262,35 @@ is called. After all subdevices have been located the 
> .complete() callback is
>  called. When a subdevice is removed from the system the .unbind() method is
>  called. All three callbacks are optional.
>  
> +Streaming control on Media controller enabled devices
> +^
> +
> +Starting and stopping the stream are somewhat complex operations that
> +often require walking the media graph to enable streaming on
> +sub-devices which the pipeline consists of. This involves interaction
> +between multiple drivers, sometimes more than two.

That's still not ok, as it creates a black hole for devnode-based
devices.

I would change it to something like:

Streaming control
^

Starting and stopping the stream are somewhat complex operations that
often require to enable streaming on sub-devices which the pipeline 
consists of. This involves interaction between multiple drivers, 
sometimes
more than two. 

The ``.s_stream()`` op in :c:type:`v4l2_subdev_video_ops` is responsible
for starting and stopping the stream on the sub-device it is called
on. 

Streaming control on devnode-centric devices


On **devnode-centric** devices, the main driver is responsible enable
stream all all sub-devices. On most cases, all the main driver need
to do is to broadcast s_stream to all connected sub-devices by calling
:c:func:`v4l2_device_call_all`, e. g.::

v4l2_device_call_all(>v4l2_dev, 0, video, s_stream, 1);

Streaming control on mc-centric devices
~~~

On **mc-centric** devices, it usually requires walking the media graph
to enable streaming only at the sub-devices which the pipeline consists
of.

(place here the details for such scenario)

> +The ``.s_stream()`` op in :c:type:`v4l2_subdev_video_ops` is responsible
> +for starting and stopping the stream on the sub-device it is called
> +on. A device driver is only responsible for calling the ``.s_stream()`` ops
> +of the adjacent sub-devices that are connected to its sink pads
> +through an enabled link. A driver may not call ``.s_stream()`` op
> +of any other sub-device further up in the pipeline, for instance.
> +
> +This means that a sub-device driver is thus in direct control of
> +whether the upstream sub-devices start (or stop) streaming before or
> +after the sub-device itself is set up for streaming.
> +
> +.. note::
> +
> +   As the ``.s_stream()`` callback is called recursively through the
> +   sub-devices along the pipeline, it is important to keep the
> +   recursion as short as possible. To this end, drivers are encouraged
> +   to avoid recursively calling ``.s_stream()`` internally to reduce
> +   stack usage. Instead, the ``.s_stream()`` op of the directly
> +   connected sub-devices should come from the callback through which
> +   the driver was first called.
> +

That sounds too complex, and can lead into troubles, if the same
sub-device driver is used on completely different devices.

IMHO, it should be up to the main driver to navigate at the MC
pipeline and call s_stream(), and not to the sub-drivers.

Thanks,
Mauro


[PATCH 0/4] drivers: make i2c_adapter const

2017-08-19 Thread Bhumika Goyal
Make i2c_adapter const. Done using Coccinelle.

Bhumika Goyal (4):
  i2c: busses: make i2c_adapter const
  [media] media: pci: make i2c_adapter const
  [media] radio-usb-si4713: make i2c_adapter const
  [media] usb: make i2c_adapter const

 drivers/i2c/busses/i2c-kempld.c   | 2 +-
 drivers/i2c/busses/i2c-ocores.c   | 2 +-
 drivers/i2c/busses/i2c-octeon-platdrv.c   | 2 +-
 drivers/i2c/busses/i2c-thunderx-pcidrv.c  | 2 +-
 drivers/i2c/busses/i2c-xiic.c | 2 +-
 drivers/media/pci/cobalt/cobalt-i2c.c | 2 +-
 drivers/media/pci/cx18/cx18-i2c.c | 2 +-
 drivers/media/pci/cx23885/cx23885-i2c.c   | 2 +-
 drivers/media/pci/cx25821/cx25821-i2c.c   | 2 +-
 drivers/media/pci/ivtv/ivtv-i2c.c | 4 ++--
 drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c | 2 +-
 drivers/media/pci/saa7134/saa7134-i2c.c   | 2 +-
 drivers/media/pci/saa7164/saa7164-i2c.c   | 2 +-
 drivers/media/radio/si4713/radio-usb-si4713.c | 2 +-
 drivers/media/usb/au0828/au0828-i2c.c | 2 +-
 drivers/media/usb/cx231xx/cx231xx-i2c.c   | 2 +-
 drivers/media/usb/em28xx/em28xx-i2c.c | 2 +-
 drivers/media/usb/hdpvr/hdpvr-i2c.c   | 2 +-
 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c  | 2 +-
 drivers/media/usb/stk1160/stk1160-i2c.c   | 2 +-
 drivers/media/usb/usbvision/usbvision-i2c.c   | 4 ++--
 21 files changed, 23 insertions(+), 23 deletions(-)

-- 
1.9.1



[PATCH 1/4] i2c: busses: make i2c_adapter const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/i2c/busses/i2c-kempld.c  | 2 +-
 drivers/i2c/busses/i2c-ocores.c  | 2 +-
 drivers/i2c/busses/i2c-octeon-platdrv.c  | 2 +-
 drivers/i2c/busses/i2c-thunderx-pcidrv.c | 2 +-
 drivers/i2c/busses/i2c-xiic.c| 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
index 25993d2..e879190 100644
--- a/drivers/i2c/busses/i2c-kempld.c
+++ b/drivers/i2c/busses/i2c-kempld.c
@@ -289,7 +289,7 @@ static u32 kempld_i2c_func(struct i2c_adapter *adap)
.functionality  = kempld_i2c_func,
 };
 
-static struct i2c_adapter kempld_i2c_adapter = {
+static const struct i2c_adapter kempld_i2c_adapter = {
.owner  = THIS_MODULE,
.name   = "i2c-kempld",
.class  = I2C_CLASS_HWMON | I2C_CLASS_SPD,
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index 34f1889..8c42ca7 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -276,7 +276,7 @@ static u32 ocores_func(struct i2c_adapter *adap)
.functionality = ocores_func,
 };
 
-static struct i2c_adapter ocores_adapter = {
+static const struct i2c_adapter ocores_adapter = {
.owner = THIS_MODULE,
.name = "i2c-ocores",
.class = I2C_CLASS_DEPRECATED,
diff --git a/drivers/i2c/busses/i2c-octeon-platdrv.c 
b/drivers/i2c/busses/i2c-octeon-platdrv.c
index 917524c..64bda83 100644
--- a/drivers/i2c/busses/i2c-octeon-platdrv.c
+++ b/drivers/i2c/busses/i2c-octeon-platdrv.c
@@ -126,7 +126,7 @@ static u32 octeon_i2c_functionality(struct i2c_adapter 
*adap)
.functionality = octeon_i2c_functionality,
 };
 
-static struct i2c_adapter octeon_i2c_ops = {
+static const struct i2c_adapter octeon_i2c_ops = {
.owner = THIS_MODULE,
.name = "OCTEON adapter",
.algo = _i2c_algo,
diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c 
b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
index ea35a895..df0976f 100644
--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
+++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
@@ -75,7 +75,7 @@ static u32 thunderx_i2c_functionality(struct i2c_adapter 
*adap)
.functionality = thunderx_i2c_functionality,
 };
 
-static struct i2c_adapter thunderx_i2c_ops = {
+static const struct i2c_adapter thunderx_i2c_ops = {
.owner  = THIS_MODULE,
.name   = "ThunderX adapter",
.algo   = _i2c_algo,
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 34b27bf..ae6ed25 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -721,7 +721,7 @@ static u32 xiic_func(struct i2c_adapter *adap)
.functionality = xiic_func,
 };
 
-static struct i2c_adapter xiic_adapter = {
+static const struct i2c_adapter xiic_adapter = {
.owner = THIS_MODULE,
.name = DRIVER_NAME,
.class = I2C_CLASS_DEPRECATED,
-- 
1.9.1



[PATCH 2/4] [media] media: pci: make i2c_adapter const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal 
---
 drivers/media/pci/cobalt/cobalt-i2c.c | 2 +-
 drivers/media/pci/cx18/cx18-i2c.c | 2 +-
 drivers/media/pci/cx23885/cx23885-i2c.c   | 2 +-
 drivers/media/pci/cx25821/cx25821-i2c.c   | 2 +-
 drivers/media/pci/ivtv/ivtv-i2c.c | 4 ++--
 drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c | 2 +-
 drivers/media/pci/saa7134/saa7134-i2c.c   | 2 +-
 drivers/media/pci/saa7164/saa7164-i2c.c   | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/media/pci/cobalt/cobalt-i2c.c 
b/drivers/media/pci/cobalt/cobalt-i2c.c
index ad16b89..1a5c556 100644
--- a/drivers/media/pci/cobalt/cobalt-i2c.c
+++ b/drivers/media/pci/cobalt/cobalt-i2c.c
@@ -301,7 +301,7 @@ static u32 cobalt_func(struct i2c_adapter *adap)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter cobalt_i2c_adap_template = {
+static const struct i2c_adapter cobalt_i2c_adap_template = {
.name = "cobalt i2c driver",
.algo = NULL,   /* set by i2c-algo-bit */
.algo_data = NULL,  /* filled from template */
diff --git a/drivers/media/pci/cx18/cx18-i2c.c 
b/drivers/media/pci/cx18/cx18-i2c.c
index eabdd4c..2eb62b2 100644
--- a/drivers/media/pci/cx18/cx18-i2c.c
+++ b/drivers/media/pci/cx18/cx18-i2c.c
@@ -206,7 +206,7 @@ static int cx18_getsda(void *data)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter cx18_i2c_adap_template = {
+static const struct i2c_adapter cx18_i2c_adap_template = {
.name = "cx18 i2c driver",
.algo = NULL,   /* set by i2c-algo-bit */
.algo_data = NULL,  /* filled from template */
diff --git a/drivers/media/pci/cx23885/cx23885-i2c.c 
b/drivers/media/pci/cx23885/cx23885-i2c.c
index 8528032..0f21467 100644
--- a/drivers/media/pci/cx23885/cx23885-i2c.c
+++ b/drivers/media/pci/cx23885/cx23885-i2c.c
@@ -264,7 +264,7 @@ static u32 cx23885_functionality(struct i2c_adapter *adap)
 
 /* --- */
 
-static struct i2c_adapter cx23885_i2c_adap_template = {
+static const struct i2c_adapter cx23885_i2c_adap_template = {
.name  = "cx23885",
.owner = THIS_MODULE,
.algo  = _i2c_algo_template,
diff --git a/drivers/media/pci/cx25821/cx25821-i2c.c 
b/drivers/media/pci/cx25821/cx25821-i2c.c
index 263a1cf..49d 100644
--- a/drivers/media/pci/cx25821/cx25821-i2c.c
+++ b/drivers/media/pci/cx25821/cx25821-i2c.c
@@ -285,7 +285,7 @@ static u32 cx25821_functionality(struct i2c_adapter *adap)
 #endif
 };
 
-static struct i2c_adapter cx25821_i2c_adap_template = {
+static const struct i2c_adapter cx25821_i2c_adap_template = {
.name = "cx25821",
.owner = THIS_MODULE,
.algo = _i2c_algo_template,
diff --git a/drivers/media/pci/ivtv/ivtv-i2c.c 
b/drivers/media/pci/ivtv/ivtv-i2c.c
index dea80ef..1ef6c72 100644
--- a/drivers/media/pci/ivtv/ivtv-i2c.c
+++ b/drivers/media/pci/ivtv/ivtv-i2c.c
@@ -632,7 +632,7 @@ static u32 ivtv_functionality(struct i2c_adapter *adap)
 };
 
 /* template for our-bit banger */
-static struct i2c_adapter ivtv_i2c_adap_hw_template = {
+static const struct i2c_adapter ivtv_i2c_adap_hw_template = {
.name = "ivtv i2c driver",
.algo = _algo,
.algo_data = NULL,  /* filled from template */
@@ -682,7 +682,7 @@ static int ivtv_getsda_old(void *data)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter ivtv_i2c_adap_template = {
+static const struct i2c_adapter ivtv_i2c_adap_template = {
.name = "ivtv i2c driver",
.algo = NULL,   /* set by i2c-algo-bit */
.algo_data = NULL,  /* filled from template */
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c 
b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
index b49e4f9..b13e319 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
@@ -300,7 +300,7 @@ static u32 netup_i2c_func(struct i2c_adapter *adap)
.functionality  = netup_i2c_func,
 };
 
-static struct i2c_adapter netup_i2c_adapter = {
+static const struct i2c_adapter netup_i2c_adapter = {
.owner  = THIS_MODULE,
.name   = NETUP_UNIDVB_NAME,
.class  = I2C_CLASS_HWMON | I2C_CLASS_SPD,
diff --git a/drivers/media/pci/saa7134/saa7134-i2c.c 
b/drivers/media/pci/saa7134/saa7134-i2c.c
index 9d0e69e..8f2ed63 100644
--- a/drivers/media/pci/saa7134/saa7134-i2c.c
+++ b/drivers/media/pci/saa7134/saa7134-i2c.c
@@ -339,7 +339,7 @@ static u32 functionality(struct i2c_adapter *adap)
.functionality = functionality,
 };
 
-static struct i2c_adapter saa7134_adap_template = {
+static const struct i2c_adapter saa7134_adap_template = {
 

[PATCH 4/4] [media] usb: make i2c_adapter const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal 
---
 drivers/media/usb/au0828/au0828-i2c.c| 2 +-
 drivers/media/usb/cx231xx/cx231xx-i2c.c  | 2 +-
 drivers/media/usb/em28xx/em28xx-i2c.c| 2 +-
 drivers/media/usb/hdpvr/hdpvr-i2c.c  | 2 +-
 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +-
 drivers/media/usb/stk1160/stk1160-i2c.c  | 2 +-
 drivers/media/usb/usbvision/usbvision-i2c.c  | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/usb/au0828/au0828-i2c.c 
b/drivers/media/usb/au0828/au0828-i2c.c
index 42b352b..9074a98 100644
--- a/drivers/media/usb/au0828/au0828-i2c.c
+++ b/drivers/media/usb/au0828/au0828-i2c.c
@@ -336,7 +336,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap)
 
 /* --- */
 
-static struct i2c_adapter au0828_i2c_adap_template = {
+static const struct i2c_adapter au0828_i2c_adap_template = {
.name  = KBUILD_MODNAME,
.owner = THIS_MODULE,
.algo  = _i2c_algo_template,
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 8ce6b81..23648da 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -459,7 +459,7 @@ static u32 functionality(struct i2c_adapter *adap)
.functionality = functionality,
 };
 
-static struct i2c_adapter cx231xx_adap_template = {
+static const struct i2c_adapter cx231xx_adap_template = {
.owner = THIS_MODULE,
.name = "cx231xx",
.algo = _algo,
diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
b/drivers/media/usb/em28xx/em28xx-i2c.c
index 60b195c..66c5012 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -876,7 +876,7 @@ static u32 functionality(struct i2c_adapter *i2c_adap)
.functionality = functionality,
 };
 
-static struct i2c_adapter em28xx_adap_template = {
+static const struct i2c_adapter em28xx_adap_template = {
.owner = THIS_MODULE,
.name = "em28xx",
.algo = _algo,
diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c 
b/drivers/media/usb/hdpvr/hdpvr-i2c.c
index fcab550..7329310 100644
--- a/drivers/media/usb/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c
@@ -184,7 +184,7 @@ static u32 hdpvr_functionality(struct i2c_adapter *adapter)
.functionality = hdpvr_functionality,
 };
 
-static struct i2c_adapter hdpvr_i2c_adapter_template = {
+static const struct i2c_adapter hdpvr_i2c_adapter_template = {
.name   = "Hauppage HD PVR I2C",
.owner  = THIS_MODULE,
.algo   = _algo,
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c 
b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
index 20a52b7..3618ace 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
@@ -519,7 +519,7 @@ static u32 pvr2_i2c_functionality(struct i2c_adapter *adap)
.functionality = pvr2_i2c_functionality,
 };
 
-static struct i2c_adapter pvr2_i2c_adap_template = {
+static const struct i2c_adapter pvr2_i2c_adap_template = {
.owner = THIS_MODULE,
.class = 0,
 };
diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c 
b/drivers/media/usb/stk1160/stk1160-i2c.c
index 3f2517b..2c70173 100644
--- a/drivers/media/usb/stk1160/stk1160-i2c.c
+++ b/drivers/media/usb/stk1160/stk1160-i2c.c
@@ -240,7 +240,7 @@ static u32 functionality(struct i2c_adapter *adap)
.functionality = functionality,
 };
 
-static struct i2c_adapter adap_template = {
+static const struct i2c_adapter adap_template = {
.owner = THIS_MODULE,
.name = "stk1160",
.algo = ,
diff --git a/drivers/media/usb/usbvision/usbvision-i2c.c 
b/drivers/media/usb/usbvision/usbvision-i2c.c
index 68acafb..837bd4d 100644
--- a/drivers/media/usb/usbvision/usbvision-i2c.c
+++ b/drivers/media/usb/usbvision/usbvision-i2c.c
@@ -173,7 +173,7 @@ static u32 functionality(struct i2c_adapter *adap)
 /* --- */
 /* usbvision specific I2C functions*/
 /* --- */
-static struct i2c_adapter i2c_adap_template;
+static const struct i2c_adapter i2c_adap_template;
 
 int usbvision_i2c_register(struct usb_usbvision *usbvision)
 {
@@ -441,7 +441,7 @@ static int usbvision_i2c_read(struct usb_usbvision 
*usbvision, unsigned char add
return rdcount;
 }
 
-static struct i2c_adapter i2c_adap_template = {
+static const struct i2c_adapter i2c_adap_template = {
.owner = THIS_MODULE,
.name  = "usbvision",
 };
-- 
1.9.1



[PATCH 3/4] [media] radio-usb-si4713: make i2c_adapter const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal 
---
 drivers/media/radio/si4713/radio-usb-si4713.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c 
b/drivers/media/radio/si4713/radio-usb-si4713.c
index e5e5a16..f20aac2 100644
--- a/drivers/media/radio/si4713/radio-usb-si4713.c
+++ b/drivers/media/radio/si4713/radio-usb-si4713.c
@@ -409,7 +409,7 @@ static u32 si4713_functionality(struct i2c_adapter *adapter)
 
 /* This name value shows up in the sysfs filename associated
with this I2C adapter */
-static struct i2c_adapter si4713_i2c_adapter_template = {
+static const struct i2c_adapter si4713_i2c_adapter_template = {
.name   = "si4713-i2c",
.owner  = THIS_MODULE,
.algo   = _algo,
-- 
1.9.1



[PATCH RFC] media: open.rst: document devnode-centric and mc-centric types

2017-08-19 Thread Mauro Carvalho Chehab
When we added support for omap3, back in 2010, we added a new
type of V4L2 devices that aren't fully controlled via the V4L2
device node. Yet, we never made it clear, at the V4L2 spec,
about the differences between both types.

Let's document them with the current implementation.

Signed-off-by: Mauro Carvalho Chehab 
---

This patch is a result of this week's discussion we had with regards to merging
a patch series from Sakari documenting the need of propagating streaming
control between sub-devices on some complex mc-centric devices.

One big gap on our documentation popped up: while we have distinct behavior
for mc-centric and devnode-centric types of V4L2 devices, we never clearly
documented about that.

This RFC patch is a first attempt to have a definition of those types, and to
standardize the names we use to distinguish between those types.

Comments are welcome.


 Documentation/media/uapi/v4l/open.rst | 37 +++
 1 file changed, 37 insertions(+)

diff --git a/Documentation/media/uapi/v4l/open.rst 
b/Documentation/media/uapi/v4l/open.rst
index afd116edb40d..9cf4f74c466a 100644
--- a/Documentation/media/uapi/v4l/open.rst
+++ b/Documentation/media/uapi/v4l/open.rst
@@ -6,6 +6,43 @@
 Opening and Closing Devices
 ***
 
+Types of V4L2 devices
+=
+
+V4L2 devices are usually complex: they're implemented via a main driver and
+several other drivers. The main driver always exposes a V4L2 device node
+(see :ref:`v4l2_device_naming`). The other devices are called **sub-devices**.
+They are usually controlled via a serial bus (I2C or SMBus).
+
+When V4L2 started, there was only one type of device, fully controlled via
+V4L2 device nodes. We call those devices as **devnode-centric devices**.
+Since the end of 2010, a new type of V4L2 device was added, in order to
+support complex devices that are common on embedded systems. Those devices
+are controlled mainly via the media controller. So, they're called:
+**mc-centric devices**.
+
+On a **devnode-centric device**, the device and their corresponding hardware
+pipelines are controlled via the V4L2 device node. They may optionally
+expose the hardware pipelines via the
+:ref:`media controller API `.
+
+On a **mc-centric device**, before using the V4L2 device, it is required to
+set the hardware pipelines via the
+:ref:`media controller API `. On those devices, the
+sub-devices' configuration can be controlled via the
+:ref:`sub-device API `, with creates one device node per sub device.
+On such devices, the V4L2 device node is mainly responsible for controlling
+the streaming features, while the media controller and the subdevices device
+nodes are responsible for configuring the hardware.
+
+.. note::
+
+   Currently, it is forbidden for a **devnode-centric device** to expose
+   subdevices via :ref:`sub-device API `, although this might
+   change in the future.
+
+
+.. _v4l2_device_naming:
 
 Device Naming
 =
-- 
2.13.3




[PATCH 05/15] mei: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/misc/mei/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 40c7908..1ac10cb 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -845,7 +845,7 @@ static void mei_cl_bus_dev_release(struct device *dev)
kfree(cldev);
 }
 
-static struct device_type mei_cl_device_type = {
+static const struct device_type mei_cl_device_type = {
.release= mei_cl_bus_dev_release,
 };
 
-- 
1.9.1



[PATCH 02/15] drm: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.
---
 drivers/gpu/drm/drm_sysfs.c  | 2 +-
 drivers/gpu/drm/ttm/ttm_module.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 1c5b5ce..84e4ebe 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -39,7 +39,7 @@
  * drm_connector_unregister().
  */
 
-static struct device_type drm_sysfs_device_minor = {
+static const struct device_type drm_sysfs_device_minor = {
.name = "drm_minor"
 };
 
diff --git a/drivers/gpu/drm/ttm/ttm_module.c b/drivers/gpu/drm/ttm/ttm_module.c
index 66fc639..e6604e0 100644
--- a/drivers/gpu/drm/ttm/ttm_module.c
+++ b/drivers/gpu/drm/ttm/ttm_module.c
@@ -37,7 +37,7 @@
 static DECLARE_WAIT_QUEUE_HEAD(exit_q);
 static atomic_t device_released;
 
-static struct device_type ttm_drm_class_type = {
+static const struct device_type ttm_drm_class_type = {
.name = "ttm",
/**
 * Add pm ops here.
-- 
1.9.1



[PATCH 03/15] [media] i2c: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/i2c/soc_camera/mt9t031.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/soc_camera/mt9t031.c 
b/drivers/media/i2c/soc_camera/mt9t031.c
index 714fb35..4802d30 100644
--- a/drivers/media/i2c/soc_camera/mt9t031.c
+++ b/drivers/media/i2c/soc_camera/mt9t031.c
@@ -592,7 +592,7 @@ static int mt9t031_runtime_resume(struct device *dev)
.runtime_resume = mt9t031_runtime_resume,
 };
 
-static struct device_type mt9t031_dev_type = {
+static const struct device_type mt9t031_dev_type = {
.name   = "MT9T031",
.pm = _dev_pm_ops,
 };
-- 
1.9.1



[PATCH 00/15] drivers: make device_type const

2017-08-19 Thread Bhumika Goyal
Make device_type const. Done using Coccinelle.

Bhumika Goyal (15):
  EDAC: make device_type const
  drm: make device_type const
  [media] i2c: make device_type const
  [media] rc: make device_type const
  mei: make device_type const
  mtd:  make device_type const
  mux: make device_type const
  PCI: make device_type const
  phy: tegra: make device_type const
  platform/x86: wmi: make device_type const
  remoteproc: make device_type const
  s390/zcrypt: make device_type const
  scsi: make device_type const
  staging: greybus: make device_type const
  usb: make device_type const

 drivers/edac/edac_mc_sysfs.c   | 8 
 drivers/edac/i7core_edac.c | 4 ++--
 drivers/gpu/drm/drm_sysfs.c| 2 +-
 drivers/gpu/drm/ttm/ttm_module.c   | 2 +-
 drivers/media/i2c/soc_camera/mt9t031.c | 2 +-
 drivers/media/rc/rc-main.c | 2 +-
 drivers/misc/mei/bus.c | 2 +-
 drivers/mtd/mtdcore.c  | 2 +-
 drivers/mux/mux-core.c | 2 +-
 drivers/pci/endpoint/pci-epf-core.c| 4 ++--
 drivers/phy/tegra/xusb.c   | 4 ++--
 drivers/platform/x86/wmi.c | 6 +++---
 drivers/remoteproc/remoteproc_core.c   | 2 +-
 drivers/s390/crypto/ap_card.c  | 2 +-
 drivers/s390/crypto/ap_queue.c | 2 +-
 drivers/scsi/fcoe/fcoe_sysfs.c | 4 ++--
 drivers/scsi/scsi_transport_iscsi.c| 4 ++--
 drivers/staging/greybus/gbphy.c| 2 +-
 drivers/usb/common/ulpi.c  | 2 +-
 19 files changed, 29 insertions(+), 29 deletions(-)

-- 
1.9.1



[PATCH 07/15] mux: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/mux/mux-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mux/mux-core.c b/drivers/mux/mux-core.c
index 2fe96c4..68bd16d 100644
--- a/drivers/mux/mux-core.c
+++ b/drivers/mux/mux-core.c
@@ -58,7 +58,7 @@ static void mux_chip_release(struct device *dev)
kfree(mux_chip);
 }
 
-static struct device_type mux_type = {
+static const struct device_type mux_type = {
.name = "mux-chip",
.release = mux_chip_release,
 };
-- 
1.9.1



[PATCH 08/15] PCI: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/pci/endpoint/pci-epf-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/endpoint/pci-epf-core.c 
b/drivers/pci/endpoint/pci-epf-core.c
index 6877d6a..9d0de12 100644
--- a/drivers/pci/endpoint/pci-epf-core.c
+++ b/drivers/pci/endpoint/pci-epf-core.c
@@ -27,7 +27,7 @@
 #include 
 
 static struct bus_type pci_epf_bus_type;
-static struct device_type pci_epf_type;
+static const struct device_type pci_epf_type;
 
 /**
  * pci_epf_linkup() - Notify the function driver that EPC device has
@@ -275,7 +275,7 @@ static void pci_epf_dev_release(struct device *dev)
kfree(epf);
 }
 
-static struct device_type pci_epf_type = {
+static const struct device_type pci_epf_type = {
.release= pci_epf_dev_release,
 };
 
-- 
1.9.1



[PATCH 14/15] staging: greybus: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/greybus/gbphy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/gbphy.c b/drivers/staging/greybus/gbphy.c
index 603de6f..80c1da8 100644
--- a/drivers/staging/greybus/gbphy.c
+++ b/drivers/staging/greybus/gbphy.c
@@ -66,7 +66,7 @@ static int gb_gbphy_idle(struct device *dev)
   gb_gbphy_idle)
 };
 
-static struct device_type greybus_gbphy_dev_type = {
+static const struct device_type greybus_gbphy_dev_type = {
.name=  "gbphy_device",
.release =  gbphy_dev_release,
.pm =   _gbphy_pm_ops,
-- 
1.9.1



[PATCH 09/15] phy: tegra: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/phy/tegra/xusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 3cbcb25..bd3f1b6 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -155,7 +155,7 @@ static void tegra_xusb_pad_release(struct device *dev)
pad->soc->ops->remove(pad);
 }
 
-static struct device_type tegra_xusb_pad_type = {
+static const struct device_type tegra_xusb_pad_type = {
.release = tegra_xusb_pad_release,
 };
 
@@ -512,7 +512,7 @@ static void tegra_xusb_port_release(struct device *dev)
 {
 }
 
-static struct device_type tegra_xusb_port_type = {
+static const struct device_type tegra_xusb_port_type = {
.release = tegra_xusb_port_release,
 };
 
-- 
1.9.1



[PATCH 13/15] scsi: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/scsi/fcoe/fcoe_sysfs.c  | 4 ++--
 drivers/scsi/scsi_transport_iscsi.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 9cf3d56..5c8310b 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -659,13 +659,13 @@ static void fcoe_fcf_device_release(struct device *dev)
kfree(fcf);
 }
 
-static struct device_type fcoe_ctlr_device_type = {
+static const struct device_type fcoe_ctlr_device_type = {
.name = "fcoe_ctlr",
.groups = fcoe_ctlr_attr_groups,
.release = fcoe_ctlr_device_release,
 };
 
-static struct device_type fcoe_fcf_device_type = {
+static const struct device_type fcoe_fcf_device_type = {
.name = "fcoe_fcf",
.groups = fcoe_fcf_attr_groups,
.release = fcoe_fcf_device_release,
diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index a424eae..b9513f8 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1009,7 +1009,7 @@ static void iscsi_flashnode_sess_release(struct device 
*dev)
kfree(fnode_sess);
 }
 
-static struct device_type iscsi_flashnode_sess_dev_type = {
+static const struct device_type iscsi_flashnode_sess_dev_type = {
.name = "iscsi_flashnode_sess_dev_type",
.groups = iscsi_flashnode_sess_attr_groups,
.release = iscsi_flashnode_sess_release,
@@ -1195,7 +1195,7 @@ static void iscsi_flashnode_conn_release(struct device 
*dev)
kfree(fnode_conn);
 }
 
-static struct device_type iscsi_flashnode_conn_dev_type = {
+static const struct device_type iscsi_flashnode_conn_dev_type = {
.name = "iscsi_flashnode_conn_dev_type",
.groups = iscsi_flashnode_conn_attr_groups,
.release = iscsi_flashnode_conn_release,
-- 
1.9.1



[PATCH 10/15] platform/x86: wmi: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/platform/x86/wmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index e32ba57..a37c253 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -810,19 +810,19 @@ static int wmi_dev_remove(struct device *dev)
.remove = wmi_dev_remove,
 };
 
-static struct device_type wmi_type_event = {
+static const struct device_type wmi_type_event = {
.name = "event",
.groups = wmi_event_groups,
.release = wmi_dev_release,
 };
 
-static struct device_type wmi_type_method = {
+static const struct device_type wmi_type_method = {
.name = "method",
.groups = wmi_method_groups,
.release = wmi_dev_release,
 };
 
-static struct device_type wmi_type_data = {
+static const struct device_type wmi_type_data = {
.name = "data",
.groups = wmi_data_groups,
.release = wmi_dev_release,
-- 
1.9.1



[PATCH 12/15] s390/zcrypt: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/s390/crypto/ap_card.c  | 2 +-
 drivers/s390/crypto/ap_queue.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/crypto/ap_card.c b/drivers/s390/crypto/ap_card.c
index 836efac9..0329148 100644
--- a/drivers/s390/crypto/ap_card.c
+++ b/drivers/s390/crypto/ap_card.c
@@ -153,7 +153,7 @@ static ssize_t ap_modalias_show(struct device *dev,
NULL
 };
 
-static struct device_type ap_card_type = {
+static const struct device_type ap_card_type = {
.name = "ap_card",
.groups = ap_card_dev_attr_groups,
 };
diff --git a/drivers/s390/crypto/ap_queue.c b/drivers/s390/crypto/ap_queue.c
index 0f1a5d0..e2a85c26 100644
--- a/drivers/s390/crypto/ap_queue.c
+++ b/drivers/s390/crypto/ap_queue.c
@@ -577,7 +577,7 @@ static ssize_t ap_interrupt_show(struct device *dev,
NULL
 };
 
-static struct device_type ap_queue_type = {
+static const struct device_type ap_queue_type = {
.name = "ap_queue",
.groups = ap_queue_dev_attr_groups,
 };
-- 
1.9.1



[PATCH 15/15] usb: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/usb/common/ulpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
index 930e8f3..4aa5195 100644
--- a/drivers/usb/common/ulpi.c
+++ b/drivers/usb/common/ulpi.c
@@ -135,7 +135,7 @@ static void ulpi_dev_release(struct device *dev)
kfree(to_ulpi_dev(dev));
 }
 
-static struct device_type ulpi_dev_type = {
+static const struct device_type ulpi_dev_type = {
.name = "ulpi_device",
.groups = ulpi_dev_attr_groups,
.release = ulpi_dev_release,
-- 
1.9.1



[PATCH 11/15] remoteproc: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/remoteproc/remoteproc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c 
b/drivers/remoteproc/remoteproc_core.c
index 364ef28..48b2c5d 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1360,7 +1360,7 @@ static void rproc_type_release(struct device *dev)
kfree(rproc);
 }
 
-static struct device_type rproc_type = {
+static const struct device_type rproc_type = {
.name   = "remoteproc",
.release= rproc_type_release,
 };
-- 
1.9.1



[PATCH 06/15] mtd: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/mtd/mtdcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index f872a99..e7ea842 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -340,7 +340,7 @@ static ssize_t mtd_bbtblocks_show(struct device *dev,
 };
 ATTRIBUTE_GROUPS(mtd);
 
-static struct device_type mtd_devtype = {
+static const struct device_type mtd_devtype = {
.name   = "mtd",
.groups = mtd_groups,
.release= mtd_release,
-- 
1.9.1



[PATCH 04/15] [media] rc: make device_type const

2017-08-19 Thread Bhumika Goyal
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/rc/rc-main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index a9eba00..ea3da3e 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1532,7 +1532,7 @@ static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR,
.attrs  = rc_dev_wakeup_filter_attrs,
 };
 
-static struct device_type rc_dev_type = {
+static const struct device_type rc_dev_type = {
.release= rc_dev_release,
.uevent = rc_dev_uevent,
 };
-- 
1.9.1



[PATCH 01/15] EDAC: make device_type const

2017-08-19 Thread Bhumika Goyal
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/edac/edac_mc_sysfs.c | 8 
 drivers/edac/i7core_edac.c   | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index dbc6446..e4fcfa8 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -304,7 +304,7 @@ static void csrow_attr_release(struct device *dev)
kfree(csrow);
 }
 
-static struct device_type csrow_attr_type = {
+static const struct device_type csrow_attr_type = {
.groups = csrow_attr_groups,
.release= csrow_attr_release,
 };
@@ -644,7 +644,7 @@ static void dimm_attr_release(struct device *dev)
kfree(dimm);
 }
 
-static struct device_type dimm_attr_type = {
+static const struct device_type dimm_attr_type = {
.groups = dimm_attr_groups,
.release= dimm_attr_release,
 };
@@ -920,7 +920,7 @@ static void mci_attr_release(struct device *dev)
kfree(mci);
 }
 
-static struct device_type mci_attr_type = {
+static const struct device_type mci_attr_type = {
.groups = mci_attr_groups,
.release= mci_attr_release,
 };
@@ -1074,7 +1074,7 @@ static void mc_attr_release(struct device *dev)
kfree(dev);
 }
 
-static struct device_type mc_attr_type = {
+static const struct device_type mc_attr_type = {
.release= mc_attr_release,
 };
 /*
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index d36cc84..c16c3b9 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1094,7 +1094,7 @@ static void addrmatch_release(struct device *device)
kfree(device);
 }
 
-static struct device_type addrmatch_type = {
+static const struct device_type addrmatch_type = {
.groups = addrmatch_groups,
.release= addrmatch_release,
 };
@@ -1125,7 +1125,7 @@ static void all_channel_counts_release(struct device 
*device)
kfree(device);
 }
 
-static struct device_type all_channel_counts_type = {
+static const struct device_type all_channel_counts_type = {
.groups = all_channel_counts_groups,
.release= all_channel_counts_release,
 };
-- 
1.9.1