Hi Rob,
Em Fri, 26 Mar 2021 15:17:23 -0600
Rob Herring [off-list ref] escreveu:
On Thu, Mar 25, 2021 at 07:05:36PM +0100, Mauro Carvalho Chehab wrote:
quoted
This driver is ready for mainstream. So, move it out of staging.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
.../mfd/hisilicon,hi6421-spmi-pmic.yaml | 135 ++++++++
MAINTAINERS | 7 +
drivers/mfd/Kconfig | 16 +
drivers/mfd/Makefile | 1 +
drivers/mfd/hi6421-spmi-pmic.c | 297 ++++++++++++++++++
drivers/staging/hikey9xx/Kconfig | 18 --
drivers/staging/hikey9xx/Makefile | 1 -
drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 297 ------------------
.../hikey9xx/hisilicon,hi6421-spmi-pmic.yaml | 135 --------
9 files changed, 456 insertions(+), 451 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mfd/hisilicon,hi6421-spmi-pmic.yaml
create mode 100644 drivers/mfd/hi6421-spmi-pmic.c
delete mode 100644 drivers/staging/hikey9xx/hi6421-spmi-pmic.c
delete mode 100644 drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml
diff --git a/Documentation/devicetree/bindings/mfd/hisilicon,hi6421-spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/hisilicon,hi6421-spmi-pmic.yaml
new file mode 100644
index 000000000000..3b23ad56b31a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/hisilicon,hi6421-spmi-pmic.yaml
...
quoted
+
+ gpios:
A named gpio is preferred (foo-gpios).
What is this gpio for?
This is IRQ GPIOs.
Right now, the drive calls:
ddata->gpio = of_get_gpio(np, 0);
which is an alias for of_get_named_gpio_flags() that hardcode the
name "gpios":
static inline int of_get_gpio_flags(struct device_node *np, int index,
enum of_gpio_flags *flags)
{
return of_get_named_gpio_flags(np, "gpios", index, flags);
}
It shouldn't be hard to replace it by:
ddata->gpio = of_get_named_gpio_flags(np, "irq-gpio", 0, NULL);
but it sounds that most drivers just use of_get_gpio(). The only one
doing it differently seems to be this one:
$ git grep -A1 of_get_named_gpio_flags|grep irq
drivers/mfd/stmpe.c: pdata->irq_gpio = of_get_named_gpio_flags(np, "irq-gpio", 0,
drivers/mfd/stmpe.c- &pdata->irq_trigger);
While the usage of "gpios" (without a prefix) seems to be more usual:
$ git grep -l of_get_gpio|grep -vE '(of_gpio.h|gpiolib.c)'
arch/mips/lantiq/xway/vmmc.c
arch/powerpc/platforms/44x/warp.c
arch/powerpc/platforms/85xx/sgy_cts1000.c
drivers/input/touchscreen/auo-pixcir-ts.c
drivers/media/i2c/s5k6a3.c
drivers/mfd/hi6421-spmi-pmic.c
drivers/pcmcia/at91_cf.c
drivers/regulator/gpio-regulator.c
drivers/soc/fsl/qe/gpio.c
drivers/spi/spi-mpc52xx.c
drivers/usb/host/fhci-hcd.c
sound/soc/codecs/ssm2518.c
Yet, as this is a new driver, if you prefer, I can use the named
variant and use either "irq-gpio" or "irq-gpios". Just let me know
the preference.
Thanks,
Mauro