mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Michael Walle <michael@walle.cc>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: regmap: move struct gpio_regmap definition
Date: Wed, 3 Mar 2021 08:05:26 +0100	[thread overview]
Message-ID: <4197E9C5-56BD-44A2-A250-FC6BAE13480C@gmail.com> (raw)
In-Reply-To: <CACRpkdbHV+HCfTw__2u_EF1SbmG_0Ce-6VMs7wbAe+HtJXYM_A@mail.gmail.com>

Hi Linus,

> El 2 mar 2021, a las 23:39, Linus Walleij <linus.walleij@linaro.org> escribió:
> 
> On Tue, Mar 2, 2021 at 7:14 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote:
> 
>> I'm trying to add support for bcm63xx pin controllers, and Linus
>> suggested that I could use gpio regmap instead of adding duplicated code.
>> However, I need to access gpio_chip inside gpio_regmap to call
>> pinctrl_add_gpio_range() with gpio_chip.base.
> 
> Can't you just put the ranges in the device tree using the standard
> property gpio-ranges?

Ok, I’ll use that on v3 :).

So I guess that I should also call gpio_direction_input() and gpio_direction_output() directly to replace gpio_chip->direction_input() and gpio_chip->direction_output() for the two drivers that need it (BCM6358 and BCM6368).

> 
> These will be added automatically after the chip is added.
> 
> It is documented in
> Documentation/devicetree/bindings/gpio/gpio.txt
> a bit down the file.

Thanks for the link :)

> 
> The code is in of_gpiochip_add_pin_range() in gpiolib-of.c
> called from of_gpiochip_add() which is always called
> when gpiochip_add_data_with_key(), the main gpiochip
> registering function is called.
> 
> This would just do the work for you with no effort in the driver.
> 
> It is a bit counterintuitive that this can be done in the device
> tree but the hierarchical IRQs cannot do the same clever
> manouver to map IRQs, sorry.
> 
> Yours,
> Linus Walleij

Best regards,
Álvaro.

      reply	other threads:[~2021-03-03 12:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 18:06 Álvaro Fernández Rojas
2021-03-02 18:10 ` Michael Walle
2021-03-02 18:14   ` Álvaro Fernández Rojas
2021-03-02 19:24     ` Michael Walle
2021-03-02 19:52       ` Álvaro Fernández Rojas
2021-03-02 22:39     ` Linus Walleij
2021-03-03  7:05       ` Álvaro Fernández Rojas [this message]

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=4197E9C5-56BD-44A2-A250-FC6BAE13480C@gmail.com \
    --to=noltari@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    /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

all inboxes | Powered by JetHome®