Re: [PATCH] staging: rts5208: add missed pci_release_regions

2019-12-06 Thread Dan Carpenter
On Fri, Dec 06, 2019 at 03:55:15PM +0800, Chuhong Yuan wrote:
> The driver forgets to call pci_release_regions() in probe failure
> and remove.
> Add the missed calls to fix it.
> 
> Signed-off-by: Chuhong Yuan 

Looks good.

Reviewed-by: Dan Carpenter 

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/vc04_services/bcm2835-camera: distinct numeration and names for devices

2019-12-06 Thread Michael Kupfer
Create a static atomic counter for numerating cameras.
Use the Media Subsystem Kernel Internal API to create distinct
device-names, so that the camera-number (given by the counter)
matches the camera-name.

Co-developed-by: Kay Friedrich 
Signed-off-by: Kay Friedrich 
Signed-off-by: Michael Kupfer 
---
 .../vc04_services/bcm2835-camera/bcm2835-camera.c| 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c 
b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index beb6a0063bb8..be5f90a8b49d 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -60,6 +60,9 @@ MODULE_PARM_DESC(max_video_width, "Threshold for video mode");
 module_param(max_video_height, int, 0644);
 MODULE_PARM_DESC(max_video_height, "Threshold for video mode");
 
+/* camera instance counter */
+static atomic_t camera_instance = ATOMIC_INIT(0);
+
 /* global device data array */
 static struct bm2835_mmal_dev *gdev[MAX_BCM2835_CAMERAS];
 
@@ -1870,7 +1873,6 @@ static int bcm2835_mmal_probe(struct platform_device 
*pdev)
 
/* v4l2 core mutex used to protect all fops and v4l2 ioctls. */
mutex_init(&dev->mutex);
-   dev->camera_num = camera;
dev->max_width = resolutions[camera][0];
dev->max_height = resolutions[camera][1];
 
@@ -1886,8 +1888,9 @@ static int bcm2835_mmal_probe(struct platform_device 
*pdev)
dev->capture.fmt = &formats[3]; /* JPEG */
 
/* v4l device registration */
-   snprintf(dev->v4l2_dev.name, sizeof(dev->v4l2_dev.name),
-"%s", BM2835_MMAL_MODULE_NAME);
+   dev->camera_num = v4l2_device_set_name(&dev->v4l2_dev,
+  BM2835_MMAL_MODULE_NAME,
+  &camera_instance);
ret = v4l2_device_register(NULL, &dev->v4l2_dev);
if (ret) {
dev_err(&pdev->dev, "%s: could not register V4L2 
device: %d\n",
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 2/6] staging: most: rename core.h to most.h

2019-12-06 Thread Greg KH
On Mon, Nov 25, 2019 at 04:51:32PM +0100, Christian Gromm wrote:
> This patch renames the core header file core.h to most.h. The intention
> behind this is to have a meaningful name once this file is moved to the
> /include/linux directory.

Does everything in this .h file have to be exposed to the whole kernel?
Are there any things in here that are local only to the most "core"
code?

If this whole thing is public, you might want to clean up your naming of
some structures:

> +enum mbo_status_flags {

enum most_buffer_status_flags?


> +struct mbo {

struct most_buffer_object?

> +struct core_component {

struct most_core_component?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 4/6] staging: most: move core files out of the staging area

2019-12-06 Thread Greg KH
On Mon, Nov 25, 2019 at 04:51:34PM +0100, Christian Gromm wrote:
> This patch moves the core module to the /drivers/most directory
> and makes all necessary changes in order to not break the build.
> 
> Signed-off-by: Christian Gromm 
> ---
>  drivers/Kconfig|1 +
>  drivers/Makefile   |1 +
>  drivers/most/Kconfig   |   15 +
>  drivers/most/Makefile  |4 +
>  drivers/most/configfs.c|  708 +
>  drivers/most/core.c| 1523 
> 

When renaming or moving files, generate the patch with -M so that we see
it as a rename, not as an remove/add type of patch.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5 2/2] dt-bindings: iio: accel: add binding documentation for ADIS16240

2019-12-06 Thread Jonathan Cameron
On Thu, 5 Dec 2019 09:21:29 -0600
Rob Herring  wrote:

> On Sat, Nov 23, 2019 at 08:35:10PM -0300, Rodrigo Carvalho wrote:
> > This patch add device tree binding documentation for ADIS16240.
> > 
> > Signed-off-by: Rodrigo Ribeiro Carvalho   
> 
> checkpatch.pl complains about a mismatch between the author and S-o-b.
The open question on patch 1 is resolved, so respin with the points Rob pointed
out her resolved and I'll pick up v6.

Thanks,

Jonathan

> 
> > ---
> > V5:
> >   - None 
> > 
> >  .../bindings/iio/accel/adi,adis16240.yaml | 49 +++
> >  1 file changed, 49 insertions(+)
> >  create mode 100644 
> > Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml 
> > b/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml
> > new file mode 100644
> > index ..8e902f7c49e6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml
> > @@ -0,0 +1,49 @@
> > +# SPDX-License-Identifier: GPL-2.0  
> 
> Dual license new bindings please: (GPL-2.0-only OR BSD-2-Clause)
> 
> With that,
> 
> Reviewed-by: Rob Herring 
> 
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/accel/adi,adis16240.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: ADIS16240 Programmable Impact Sensor and Recorder driver
> > +
> > +maintainers:
> > +  - Alexandru Ardelean 
> > +
> > +description: |
> > +  ADIS16240 Programmable Impact Sensor and Recorder driver that supports
> > +  SPI interface.
> > +https://www.analog.com/en/products/adis16240.html
> > +
> > +properties:
> > +  compatible:
> > +enum:
> > +  - adi,adis16240
> > +
> > +  reg:
> > +maxItems: 1
> > +
> > +  interrupts:
> > +maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +
> > +examples:
> > +  - |
> > +#include 
> > +#include 
> > +spi0 {
> > +#address-cells = <1>;
> > +#size-cells = <0>;
> > +
> > +/* Example for a SPI device node */
> > +accelerometer@0 {
> > +compatible = "adi,adis16240";
> > +reg = <0>;
> > +spi-max-frequency = <250>;
> > +interrupt-parent = <&gpio0>;
> > +interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> > +};
> > +};
> > -- 
> > 2.24.0
> >   

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wfx: fix reset GPIO polarity

2019-12-06 Thread Michał Mirosław
On Thu, Dec 05, 2019 at 03:43:49PM +, Jérôme Pouiller wrote:
> On Thursday 5 December 2019 15:49:55 CET Michał Mirosław wrote:
> > On Thu, Dec 05, 2019 at 02:08:23PM +, Jérôme Pouiller wrote:
> > > On Wednesday 4 December 2019 17:59:46 CET Michał Mirosław wrote:
> > > > Driver inverts meaning of GPIO_ACTIVE_LOW/HIGH. Fix it to prevent
> > > > confusion.
> > > >
> > > > Signed-off-by: Michał Mirosław 
> > > > ---
> > > >  drivers/staging/wfx/bus_spi.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/wfx/bus_spi.c 
> > > > b/drivers/staging/wfx/bus_spi.c
> > > > index ab0cda1e124f..73d0157a86ba 100644
> > > > --- a/drivers/staging/wfx/bus_spi.c
> > > > +++ b/drivers/staging/wfx/bus_spi.c
> > > > @@ -199,9 +199,9 @@ static int wfx_spi_probe(struct spi_device *func)
> > > > if (!bus->gpio_reset) {
> > > > dev_warn(&func->dev, "try to load firmware anyway\n");
> > > > } else {
> > > > -   gpiod_set_value(bus->gpio_reset, 0);
> > > > -   udelay(100);
> > > > gpiod_set_value(bus->gpio_reset, 1);
> > > > +   udelay(100);
> > > > +   gpiod_set_value(bus->gpio_reset, 0);
> > > > udelay(2000);
> > > > }
> > > Hello Michał,
> > >
> > > I did not find real consensus in kernel code. My personal taste would
> > > be to keep this gpio "ACTIVE_HIGH" and rename it gpio_nreset. What do
> > > you think about it?
> > >
> > > (in add, this solution would explicitly change the name of the DT
> > > attribute instead of changing the semantic of the existing attribute)
> > 
> > As a user (board developer) I would expect that DT describes the
> > GPIO meaning directly: so when I specify GPIO_ACTIVE_HIGH flag I also
> > wire up the board so that outputing 1 would match the active state of
> > the chip's signal (that might be inverted for some reason). I think we
> > should stick to what is said in Documentation/devicetree/bindings/gpio.txt
> > (section 1.1).
> > 
> > Since this is a new driver in kernel I would prefer to fix it at the start.
> > Changing the name of the GPIO would also be ok, but since there is no DT
> > binding yet, I guess there will come up an issue of 'compatible' string
> > format that does not match 'vendor,chip' now, so we can use the difference
> > for backwards compatibility with out-of-tree driver if needed.
> 
> Current 'compatible' string is "silabs,wfx-spi" (for now, it is the
> same for out-of-tree and in-tree driver). And indeed, "wfx" does not
> names a chip.
> 
> The three chips currently supported are wf200, wf200s and wfm200. Since
> the driver provides DT bindings for SPI and SDIO buses, I think we
> have to keep the "-spi" suffix. So compatible strings should be
> "silabs,wf200-spi", "silabs,wf200s-spi" and "silabs,wfm200-spi", right?
[...]

I wonder if the '-spi' part is necessary? The interface is determined by
putting device node as a child of an SPI or MMC controller node. Kernel
won't probe SPI driver for MMC device anyway (nor the other way around).

Best Regards
Michał Mirosław
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v6 1/2] staging: iio: accel: adis16240: enforce SPI mode on probe function

2019-12-06 Thread Rodrigo Carvalho
According to the datasheet, this driver supports only SPI mode 3,
so we should enforce it on probe function.

Signed-off-by: Rodrigo Carvalho 
---
V6:
  -none

 drivers/staging/iio/accel/adis16240.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/iio/accel/adis16240.c 
b/drivers/staging/iio/accel/adis16240.c
index 82099db4bf0c..77b6b81767b9 100644
--- a/drivers/staging/iio/accel/adis16240.c
+++ b/drivers/staging/iio/accel/adis16240.c
@@ -400,6 +400,13 @@ static int adis16240_probe(struct spi_device *spi)
indio_dev->num_channels = ARRAY_SIZE(adis16240_channels);
indio_dev->modes = INDIO_DIRECT_MODE;
 
+   spi->mode = SPI_MODE_3;
+   ret = spi_setup(spi);
+   if (ret) {
+   dev_err(&spi->dev, "spi_setup failed!\n");
+   return ret;
+   }
+
ret = adis_init(st, indio_dev, spi, &adis16240_data);
if (ret)
return ret;
-- 
2.24.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v6 2/2] dt-bindings: iio: accel: add binding documentation for ADIS16240

2019-12-06 Thread Rodrigo Carvalho
This patch add device tree binding documentation for ADIS16240.

Signed-off-by: Rodrigo Carvalho 
---
V6:
  - Update SPDX license identifier

 .../bindings/iio/accel/adi,adis16240.yaml | 49 +++
 1 file changed, 49 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml

diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml 
b/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml
new file mode 100644
index ..4147f02b5e3c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/adi,adis16240.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ADIS16240 Programmable Impact Sensor and Recorder driver
+
+maintainers:
+  - Alexandru Ardelean 
+
+description: |
+  ADIS16240 Programmable Impact Sensor and Recorder driver that supports
+  SPI interface.
+https://www.analog.com/en/products/adis16240.html
+
+properties:
+  compatible:
+enum:
+  - adi,adis16240
+
+  reg:
+maxItems: 1
+
+  interrupts:
+maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+#include 
+#include 
+spi0 {
+#address-cells = <1>;
+#size-cells = <0>;
+
+/* Example for a SPI device node */
+accelerometer@0 {
+compatible = "adi,adis16240";
+reg = <0>;
+spi-max-frequency = <250>;
+interrupt-parent = <&gpio0>;
+interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+};
+};
-- 
2.24.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel