linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: Matti Vaittinen <mazziesaccount@gmail.com>,
	Guenter Roeck <linux@roeck-us.net>,
	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>,
	"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>,
	bogdan-petru.chircu-mare@nxp.com
Subject: Re: [PATCH v9 5/8] gpio: Initial support for ROHM bd70528 GPIO block
Date: Thu, 14 Feb 2019 09:00:33 +0100	[thread overview]
Message-ID: <CACRpkdYqSyWGSy6OKukE_SQWi1r0uOQD91JwpqUgrbJq28gbUQ@mail.gmail.com> (raw)
In-Reply-To: <8334d6064575249e871e88aa6057b134795232e3.1550063882.git.matti.vaittinen@fi.rohmeurope.com>

On Wed, Feb 13, 2019 at 2:34 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>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.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

  reply	other threads:[~2019-02-14  8:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 13:27 [PATCH v9 0/8] support ROHM BD70528 PMIC Matti Vaittinen
2019-02-13 13:28 ` [PATCH v9 1/8] mfd: regulator: clk: split rohm-bd718x7.h Matti Vaittinen
2019-02-13 13:29 ` [PATCH v9 2/8] mfd: bd70528: Support ROHM bd70528 PMIC - core Matti Vaittinen
2019-02-13 13:29 ` [PATCH v9 3/8] clk: bd718x7: Support ROHM BD70528 clk block Matti Vaittinen
2019-02-13 17:43   ` Stephen Boyd
2019-02-13 13:33 ` [PATCH v9 4/8] devicetree: bindings: Document first ROHM BD70528 bindings Matti Vaittinen
2019-02-13 13:34 ` [PATCH v9 5/8] gpio: Initial support for ROHM bd70528 GPIO block Matti Vaittinen
2019-02-14  8:00   ` Linus Walleij [this message]
2019-02-14  8:29     ` Matti Vaittinen
2019-02-14 12:38       ` Matti Vaittinen
2019-02-13 13:35 ` [PATCH v9 6/8] rtc: bd70528: Initial support for ROHM bd70528 RTC Matti Vaittinen
2019-02-13 13:36 ` [PATCH v9 7/8] power: supply: Initial support for ROHM BD70528 PMIC charger block Matti Vaittinen
2019-02-13 13:37 ` [PATCH v9 8/8] watchdog: bd70528: Initial support for ROHM BD70528 watchdog block Matti Vaittinen
2019-02-13 15:09   ` Guenter Roeck
2019-02-14  8:18     ` Lee Jones
2019-02-14  8:23       ` 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=CACRpkdYqSyWGSy6OKukE_SQWi1r0uOQD91JwpqUgrbJq28gbUQ@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=bogdan-petru.chircu-mare@nxp.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).