[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYqSyWGSy6OKukE_SQWi1r0uOQD91JwpqUgrbJq28gbUQ@mail.gmail.com>
Date: Thu, 14 Feb 2019 09:00:33 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc: Matti Vaittinen <mazziesaccount@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
heikki.haikola@...rohmeurope.com, mikko.mutanen@...rohmeurope.com,
Lee Jones <lee.jones@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Mark Brown <broonie@...nel.org>,
Greg KH <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Sebastian Reichel <sre@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Wim Van Sebroeck <wim@...ux-watchdog.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-clk <linux-clk@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux PM list <linux-pm@...r.kernel.org>,
linux-rtc@...r.kernel.org,
LINUXWATCHDOG <linux-watchdog@...r.kernel.org>,
bogdan-petru.chircu-mare@....com
Subject: Re: [PATCH v9 5/8] gpio: Initial support for ROHM bd70528 GPIO block
On Wed, Feb 13, 2019 at 2:34 PM Matti Vaittinen
<matti.vaittinen@...rohmeurope.com> wrote:
> ROHM BD70528 PMIC has 4 GPIO pins. Allow them to be
> controlled by GPIO framework.
>
> IRQs are handled by regmap-irq and GPIO driver is not
> aware of the irq usage.
>
> Signed-off-by: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
(...)
Just spotted this:
> +#include <linux/gpio/driver.h>
> +#include <linux/gpio.h>
A driver should only need <linux/gpio/driver.h>
the <linux/gpio.h> should not be used at all in new code,
it is a legacy header.
> +static int bd70528_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
> + unsigned long config)
> +{
> + struct bd70528_gpio *bdgpio = gpiochip_get_data(chip);
> +
> + switch (pinconf_to_config_param(config)) {
> + case PIN_CONFIG_DRIVE_OPEN_DRAIN:
> + return regmap_update_bits(bdgpio->chip.regmap,
> + GPIO_OUT_REG(offset),
> + BD70528_GPIO_DRIVE_MASK,
> + BD70528_GPIO_OPEN_DRAIN);
> + break;
> + case PIN_CONFIG_DRIVE_PUSH_PULL:
> + return regmap_update_bits(bdgpio->chip.regmap,
> + GPIO_OUT_REG(offset),
> + BD70528_GPIO_DRIVE_MASK,
> + BD70528_GPIO_PUSH_PULL);
> + break;
> + case PIN_CONFIG_INPUT_DEBOUNCE:
> + return bd70528_set_debounce(bdgpio, offset,
> + pinconf_to_config_argument(config));
> + break;
> + default:
> + break;
> + }
> + return -ENOTSUPP;
> +}
BTW I just merged code from Thomas Petazzoni that make it possible to
also support pull-up and pull-down from GPIO here if you want to enable
it.
Yours,
Linus Walleij
Powered by blists - more mailing lists