linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Michael Walle <michael@walle.cc>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v4 1/2] gpio: Add support for IDT 79RC3243x GPIO controller
Date: Wed, 28 Apr 2021 18:02:29 +0300	[thread overview]
Message-ID: <CAHp75Vef9xMB=boEJitxG5TOanuGLFktj5Pxf8L7et+6BHx00Q@mail.gmail.com> (raw)
In-Reply-To: <3a23d7e901ac72630aadbd274517f8ec@walle.cc>

On Wed, Apr 28, 2021 at 5:48 PM Michael Walle <michael@walle.cc> wrote:
>
> [Adding Mark here, too]
>
> Am 2021-04-28 16:32, schrieb Andy Shevchenko:
> > On Wed, Apr 28, 2021 at 5:04 PM Michael Walle <michael@walle.cc> wrote:
> >> Am 2021-04-28 15:44, schrieb Andy Shevchenko:
> >> > On Wed, Apr 28, 2021 at 2:57 PM Michael Walle <michael@walle.cc> wrote:
> >> >>
> >> >> Am 2021-04-28 13:07, schrieb Andy Shevchenko:
> >> >> > On Wed, Apr 28, 2021 at 1:51 AM Michael Walle <michael@walle.cc> wrote:
> >> >> >> Am 2021-04-26 12:29, schrieb Andy Shevchenko:
> >> >> >> > On Mon, Apr 26, 2021 at 12:55 PM Thomas Bogendoerfer
> >> >> >> > <tsbogend@alpha.franken.de> wrote:
> >> >> >> >
> >> >> >> > 2) there is gpio-regmap generic code, that may be worth
> >> >> >> > considering.
> >> >> >>
> >> >> >> This driver uses memory mapped registers. While that is
> >> >> >> also possible with gpio-regmap, there is one drawback:
> >> >> >> it assumes gpiochip->can_sleep = true for now, see [1].
> >> >> >> Unfortunately, there is no easy way to ask the regmap
> >> >> >> if its mmio/fastio.
> >> >> >
> >> >> > I don't see how it is an impediment.
> >> >>
> >> >> You'd have to use the *_cansleep() variants with the gpios,
> >> >> which cannot be used everywhere, no?
> >> >
> >> > *can* sleep means that it requires a sleeping context to run, if your
> >> > controller is fine with that, there are no worries. OTOH if you want
> >> > to run this in an atomic context, then consumers can't do with that
> >> > kind of controller.
> >>
> >> Ok, then we are on the same track.
> >>
> >> > What I meant above (and you stripped it here) is
> >> > to add a patch that will fix that and set it based on
> >> > gpio_regmap_config.
> >>
> >> Yes, but ideally, it would ask the regmap. Otherwise that
> >> information is redundant and might mismatch, i.e. gpio_regmap_config
> >> tell can_sleep=false but the regmap is an I2C type for example. Also
> >> if a driver wants to support both regmap types, we are no step
> >> further.
> >
> > Yeah, I agree that is a band aid, but you are free to fix it actually
> > on regmap level.
> > I don't think it will require an enormous amount of work there.
>
> I'd love to fix that, but Mark was against exposing that property
> outside of regmap. So it it what it is for now ;) Maybe he'll change
> his mind or someone has another idea.

Then let's go to ugly variant with duplicating it in gpio-regmap
config. with a FIXME note or so. I don't think we should allow new
drivers be based on bgpio_init().

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-04-28 15:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  9:54 [PATCH v4 1/2] gpio: Add support for IDT 79RC3243x GPIO controller Thomas Bogendoerfer
2021-04-26  9:54 ` [PATCH v4 2/2] dt-bindings: gpio: Add devicetree binding for IDT 79RC32434 " Thomas Bogendoerfer
2021-04-30 20:19   ` Rob Herring
2021-05-01 12:13   ` Linus Walleij
2021-05-04 13:44     ` Rob Herring
2021-05-06 11:11       ` Linus Walleij
2021-05-11 21:13     ` Thomas Bogendoerfer
2021-04-26 10:29 ` [PATCH v4 1/2] gpio: Add support for IDT 79RC3243x " Andy Shevchenko
2021-04-27 22:51   ` Michael Walle
2021-04-28 11:07     ` Andy Shevchenko
2021-04-28 11:57       ` Michael Walle
2021-04-28 13:44         ` Andy Shevchenko
2021-04-28 14:04           ` Michael Walle
2021-04-28 14:32             ` Andy Shevchenko
2021-04-28 14:48               ` Michael Walle
2021-04-28 15:02                 ` Andy Shevchenko [this message]
2021-04-28 15:07                   ` Michael Walle

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='CAHp75Vef9xMB=boEJitxG5TOanuGLFktj5Pxf8L7et+6BHx00Q@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=tsbogend@alpha.franken.de \
    /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).