From: Linus Walleij <linus.walleij@linaro.org>
To: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: Matti Vaittinen <mazziesaccount@gmail.com>,
heikki.haikola@fi.rohmeurope.com,
mikko.mutanen@fi.rohmeurope.com, Lee Jones <lee.jones@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mark Brown <broonie@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Sebastian Reichel <sre@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-clk <linux-clk@vger.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux PM list <linux-pm@vger.kernel.org>,
linux-rtc@vger.kernel.org,
LINUXWATCHDOG <linux-watchdog@vger.kernel.org>
Subject: Re: [RFC PATCH v2 07/10] gpio: Initial support for ROHM bd70528 GPIO block
Date: Mon, 28 Jan 2019 13:55:48 +0100 [thread overview]
Message-ID: <CACRpkdYTUB8vPiCF=s5-TARhv=DsPDQHVyCwP7fMc27gyDvKSg@mail.gmail.com> (raw)
In-Reply-To: <20190125110509.GA29310@localhost.localdomain>
Hi Matti!
Thanks for your patch!
On Fri, Jan 25, 2019 at 12:05 PM Matti Vaittinen
<matti.vaittinen@fi.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@fi.rohmeurope.com>
This is overall a very nicely written driver.
Just small comments:
> +#include <linux/gpio/driver.h>
> +#include <linux/interrupt.h>
Why interrupt? You do not use it.
> +static int bd70528_get_direction(struct gpio_chip *chip, unsigned int offset)
> +{
> + struct bd70528_gpio *bdgpio = gpiochip_get_data(chip);
> + int val, ret;
> +
> + /* Do we need to do something to IRQs here? */
Well you don't support IRQs yet so no problem as long as they're masked?
> + ret = regmap_read(bdgpio->chip.regmap, GPIO_OUT_REG(offset), &val);
> + if (ret) {
> + dev_err(bdgpio->chip.dev, "Could not read gpio direction\n");
> + return ret;
> + }
> +
> + return !(val & BD70528_GPIO_OUT_EN_MASK);
> +}
> +
> +static int bd70528_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
> + unsigned long config)
This is very nice. With Thomas Petazzoni's ongoing work you will be
able to also support pull up/down if you need it.
> +static int bd70528_direction_input(struct gpio_chip *chip, unsigned int offset)
> +{
> + struct bd70528_gpio *bdgpio = gpiochip_get_data(chip);
> +
> + /* Do we need to do something to IRQs here? */
Hmmm?
Apart from that it looks good. Feel free to add:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
on the next iteration.
Yours,
Linus Walleij
next prev parent reply other threads:[~2019-01-28 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 11:05 [RFC PATCH v2 07/10] gpio: Initial support for ROHM bd70528 GPIO block Matti Vaittinen
2019-01-28 12:55 ` Linus Walleij [this message]
2019-01-28 14:04 ` Matti Vaittinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACRpkdYTUB8vPiCF=s5-TARhv=DsPDQHVyCwP7fMc27gyDvKSg@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=bgolaszewski@baylibre.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.haikola@fi.rohmeurope.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mark.rutland@arm.com \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mazziesaccount@gmail.com \
--cc=mikko.mutanen@fi.rohmeurope.com \
--cc=mturquette@baylibre.com \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=sre@kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).