All of lore.kernel.org
 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>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Michael Walle" <michael@walle.cc>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	"Jonas Gorski" <jonas.gorski@gmail.com>,
	"Álvaro Fernández Rojas" <noltari@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-power@fi.rohmeurope.com,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v4 0/3] gpio: gpio-regmap: Support few custom operations
Date: Thu, 27 May 2021 00:46:42 +0200	[thread overview]
Message-ID: <CACRpkdaSr_CV1pKS44Ru15AEJ0-1429+6E7Lei2sPHdaijr9iw@mail.gmail.com> (raw)
In-Reply-To: <cover.1622008846.git.matti.vaittinen@fi.rohmeurope.com>

On Wed, May 26, 2021 at 8:02 AM Matti Vaittinen
<matti.vaittinen@fi.rohmeurope.com> wrote:

> Support providing some IC specific operations at gpio_regmap registration.

I see there is some discussion around the abstractions here.

I can only say how we designed gpio-mmio.c (CONFIG_GPIO_GENERIC).

It was designed for GPIO controllers with 8, 16 or 32 bits of GPIO,
each stuffed in a consecutive bit in a set of registers. We later
amended it to deal with bigendian as well, and 64 bit registers,
and some quirks around the registers (like just readable etc).

But that's it. For anything more complex we have opted for
users to write their own drivers with elaborate code.

As library it can sometimes be combined with an irqchip,
if the interrupts are simple.

But overall: each GPIO needs to be a single bit, not 2 not 3
not in every 7th register etc.

I would not try to turn gpio regmap into a Rube Goldberg Machine
panacea-fit-all for all kinds of register and bit layouts, it's nice to
be able to combine it with an interrupt chip or pin controller if those
functions are also simple, like the set/get registers.

Any too bold ambitions will be hard to maintain, I think.

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org>
To: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: "Matti Vaittinen" <mazziesaccount@gmail.com>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Michael Walle" <michael@walle.cc>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	"Jonas Gorski" <jonas.gorski@gmail.com>,
	"Álvaro Fernández Rojas" <noltari@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-power@fi.rohmeurope.com,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v4 0/3] gpio: gpio-regmap: Support few custom operations
Date: Thu, 27 May 2021 00:46:42 +0200	[thread overview]
Message-ID: <CACRpkdaSr_CV1pKS44Ru15AEJ0-1429+6E7Lei2sPHdaijr9iw@mail.gmail.com> (raw)
In-Reply-To: <cover.1622008846.git.matti.vaittinen@fi.rohmeurope.com>

On Wed, May 26, 2021 at 8:02 AM Matti Vaittinen
<matti.vaittinen@fi.rohmeurope.com> wrote:

> Support providing some IC specific operations at gpio_regmap registration.

I see there is some discussion around the abstractions here.

I can only say how we designed gpio-mmio.c (CONFIG_GPIO_GENERIC).

It was designed for GPIO controllers with 8, 16 or 32 bits of GPIO,
each stuffed in a consecutive bit in a set of registers. We later
amended it to deal with bigendian as well, and 64 bit registers,
and some quirks around the registers (like just readable etc).

But that's it. For anything more complex we have opted for
users to write their own drivers with elaborate code.

As library it can sometimes be combined with an irqchip,
if the interrupts are simple.

But overall: each GPIO needs to be a single bit, not 2 not 3
not in every 7th register etc.

I would not try to turn gpio regmap into a Rube Goldberg Machine
panacea-fit-all for all kinds of register and bit layouts, it's nice to
be able to combine it with an interrupt chip or pin controller if those
functions are also simple, like the set/get registers.

Any too bold ambitions will be hard to maintain, I think.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-05-26 22:46 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  6:02 [PATCH v4 0/3] gpio: gpio-regmap: Support few custom operations Matti Vaittinen
2021-05-26  6:02 ` Matti Vaittinen
2021-05-26  6:10 ` [PATCH v4 1/3] gpio: regmap: Support few IC specific operations Matti Vaittinen
2021-05-26  6:10   ` Matti Vaittinen
2021-05-26  6:10 ` [PATCH v4 2/3] gpio: gpio-regmap: Use devm_add_action_or_reset() Matti Vaittinen
2021-05-26  6:10   ` Matti Vaittinen
2021-05-28 17:17   ` Michael Walle
2021-05-28 17:17     ` Michael Walle
2021-06-02 11:54     ` Bartosz Golaszewski
2021-06-02 11:54       ` Bartosz Golaszewski
2021-06-03  4:26       ` Matti Vaittinen
2021-06-03  4:26         ` Matti Vaittinen
2021-06-03  7:40         ` Michael Walle
2021-06-03  7:40           ` Michael Walle
2021-05-26  6:10 ` [PATCH v4 3/3] gpio: bd71815: Use gpio-regmap Matti Vaittinen
2021-05-26  6:10   ` Matti Vaittinen
2021-05-26  8:42 ` [PATCH v4 0/3] gpio: gpio-regmap: Support few custom operations Andy Shevchenko
2021-05-26  8:42   ` Andy Shevchenko
2021-05-26  9:07   ` Michael Walle
2021-05-26  9:07     ` Michael Walle
2021-05-26  9:44     ` Matti Vaittinen
2021-05-26  9:44       ` Matti Vaittinen
2021-05-26 10:27       ` Michael Walle
2021-05-26 10:27         ` Michael Walle
2021-05-26 11:00         ` Matti Vaittinen
2021-05-26 11:00           ` Matti Vaittinen
2021-05-26 22:46 ` Linus Walleij [this message]
2021-05-26 22:46   ` Linus Walleij
2021-05-27  6:32   ` Matti Vaittinen
2021-05-27  6:32     ` Matti Vaittinen
2021-05-28  0:53     ` Linus Walleij
2021-05-28  0:53       ` Linus Walleij
2021-05-28  6:33       ` Vaittinen, Matti
2021-05-28  6:33         ` Vaittinen, Matti
2021-05-28 14:31         ` Bartosz Golaszewski
2021-05-28 14:31           ` Bartosz Golaszewski
2021-05-28 15:42           ` Vaittinen, Matti
2021-05-28 15:42             ` Vaittinen, Matti
2021-05-28 17:23             ` Michael Walle
2021-05-28 17:23               ` Michael Walle
2021-05-31  7:42               ` Vaittinen, Matti
2021-05-31  7:42                 ` Vaittinen, Matti

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=CACRpkdaSr_CV1pKS44Ru15AEJ0-1429+6E7Lei2sPHdaijr9iw@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=f.fainelli@gmail.com \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=michael@walle.cc \
    --cc=noltari@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.