Thread (1 message) 1 message, 1 author, 2017-08-23

Re: [PATCH] mfd: Add support for TI LMP92001

From: Lee Jones <hidden>
Date: 2017-08-23 13:21:56
Also in: linux-gpio, linux-iio, lkml

On Wed, 23 Aug 2017, Abhisit Sangjan wrote:
quoted
quoted
From: Abhisit Sangjan <redacted>

TI LMP92001 Analog System Monitor and Controller
 
[...]
quoted
quoted
Signed-off-by: Abhisit Sangjan <redacted>
---
 Documentation/ABI/testing/sysfs-bus-iio-lmp920001  |  92 ++++
 .../devicetree/bindings/gpio/gpio-lmp92001.txt     |  22 +
 .../bindings/iio/adc/ti-lmp92001-adc.txt           |  21 +
 .../bindings/iio/dac/ti-lmp92001-dac.txt           |  35 ++
 drivers/gpio/Kconfig                               |   7 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-lmp92001.c                       | 209 +++++++++
 drivers/iio/adc/Kconfig                            |  10 +
 drivers/iio/adc/Makefile                           |   1 +
 drivers/iio/adc/lmp92001-adc.c                     | 500
+++++++++++++++++++++
quoted
 drivers/iio/dac/Kconfig                            |   9 +
 drivers/iio/dac/Makefile                           |   1 +
 drivers/iio/dac/lmp92001-dac.c                     | 390
++++++++++++++++
quoted
 drivers/mfd/Kconfig                                |  12 +
 drivers/mfd/Makefile                               |   4 +
 drivers/mfd/lmp92001-core.c                        | 308 +++++++++++++
 drivers/mfd/lmp92001-debug.c                       |  67 +++
 drivers/mfd/lmp92001-i2c.c                         | 215 +++++++++
 include/linux/mfd/lmp92001/core.h                  | 119 +++++
 include/linux/mfd/lmp92001/debug.h                 |  28 ++
 20 files changed, 2051 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-lmp920001
 create mode 100644 Documentation/devicetree/
bindings/gpio/gpio-lmp92001.txt
quoted
 create mode 100644 Documentation/devicetree/
bindings/iio/adc/ti-lmp92001-adc.txt
quoted
 create mode 100644 Documentation/devicetree/
bindings/iio/dac/ti-lmp92001-dac.txt
quoted
 create mode 100644 drivers/gpio/gpio-lmp92001.c
 create mode 100644 drivers/iio/adc/lmp92001-adc.c
 create mode 100644 drivers/iio/dac/lmp92001-dac.c
 create mode 100644 drivers/mfd/lmp92001-core.c
 create mode 100644 drivers/mfd/lmp92001-debug.c
 create mode 100644 drivers/mfd/lmp92001-i2c.c
 create mode 100644 include/linux/mfd/lmp92001/core.h
 create mode 100644 include/linux/mfd/lmp92001/debug.h
[...]
quoted
quoted
+struct lmp92001_gpio {
+     struct lmp92001 *lmp92001;
+     struct gpio_chip gpio_chip;
+};
+
+static int lmp92001_gpio_get_direction(struct gpio_chip *chip,
unsigned offset)

unsigned vs unsigned int
I am follow the function prototype, it is unsigned.

struct gpio_chip {
...
int (*get_direction)(struct gpio_chip *chip,
unsigned offset);
...
};
[...]
quoted
quoted
+#ifdef CONFIG_DEBUG_FS
+static void lmp92001_gpio_dbg_show(struct seq_file *s, struct gpio_chip
*chip)
quoted
+{
+     struct lmp92001_gpio *lmp92001_gpio = gpiochip_get_data(chip);
+     struct lmp92001 *lmp92001 = lmp92001_gpio->lmp92001;
+     int i, gpio;
+     unsigned int cgpo;
+     const char *label, *dir, *logic;
+
+     for (i = 0; i < chip->ngpio; i++) {
+             gpio = i + chip->base;
+
+             label = gpiochip_is_requested(chip, i);
+             if (!label)
+                     continue;
+
+             regmap_read(lmp92001->regmap, LMP92001_CGPO, &cgpo);
retval is not checked here (and elsewhere)
This function is return void.
Please clip your responses!

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help