All of lore.kernel.org
 help / color / mirror / Atom feed
From: jbrunet@baylibre.com (Jerome Brunet)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 0/8] pinctrl: meson: clean pin offsets
Date: Thu, 21 Sep 2017 17:00:09 +0200	[thread overview]
Message-ID: <1506006009.2703.175.camel@baylibre.com> (raw)
In-Reply-To: <CACRpkdYmO2PSKU-qkBMW7C35kHf=usfOoEAobQDMMdzd1RFSTw@mail.gmail.com>

On Thu, 2017-09-21 at 14:21 +0200, Linus Walleij wrote:
> On Wed, Sep 20, 2017 at 3:39 PM, Jerome Brunet <jbrunet@baylibre.com> wrote:
> 
> > The initial goal of this series was move to TEST_N pin from the EE
> > controller to AO controller, where it belongs. This meant modify the
> > EE_OFF value.
> > 
> > This offset is a quirk we brought from the vendor driver when it was
> > initially merged. There no reason to keep this around and we could simply
> > let pinctrl figure the pin base value.
> > 
> > Removing this offset, while simple, ends up being quite a patch bomb.
> > This is why I split the change over 5 first patches, so the important
> > change, patch #1 remains visible. Of course, to avoid breaking bisect,
> > these first 5 patches should be squashed into one. (If you prefer that I
> > squash it myself, I may have to send you a PR as the patch would exceed
> > VGER 100000 characters limit)
> > 
> > The last change is this series, while not directly related, also requires
> > to adjust the gpio-line-names property in DT. Having these changes going
> > together would make it easier to coordinate the DTS changes.
> > 
> > This was changeset has been test on gxbb P200, gxl libretech-cc.  It was
> > also boot tested on meson8 (Thx Martin!)
> > 
> > Jerome Brunet (8):
> >   pinctrl: meson: remove offset from pinctrl
> >   pinctrl: meson: remove offset continued - gxbb
> >   pinctrl: meson: remove offset continued - gxl
> >   pinctrl: meson: remove offset continued - meson8
> >   pinctrl: meson: remove offset continued - meson8b
> >   pinctrl: meson: get rid of pin_base
> >   pinctrl: meson-gx: TEST_N belongs to the AO controller
> >   pinctrl: meson-gxbb: add missing GPIOX_22 pin
> 
> Looks good just waiting for review from Carlo && || Kevin.

Thanks Linus,

After doing this rework, I noticed that this driver (not the only one though)
assume gpio offset (param of gpio calls) and pin offset are the same thing ...
instead of relying pinctrl (and gpio-ranges) to do the translation.

To make things a bit more clean, I was thinking about forwarding all gpios
framework calls to pinconf, so the gpio to pin offset would go through the
proper mapping function.

Is this the way to do it ?

Using gpio_pinctrl_set_config() I should be able to achieve almost any "write"
functions but I got stuck on gpio_get()

ATM the moment there is no gpio_pinctrl_get_config() or something similar to
read stuff in the gpio framework from pinconf. Would you be open to add
something like this ?

> 
> Yours,
> Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: Jerome Brunet <jbrunet@baylibre.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Carlo Caione <carlo@caione.org>,
	Kevin Hilman <khilman@baylibre.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Subject: Re: [PATCH 0/8] pinctrl: meson: clean pin offsets
Date: Thu, 21 Sep 2017 17:00:09 +0200	[thread overview]
Message-ID: <1506006009.2703.175.camel@baylibre.com> (raw)
In-Reply-To: <CACRpkdYmO2PSKU-qkBMW7C35kHf=usfOoEAobQDMMdzd1RFSTw@mail.gmail.com>

On Thu, 2017-09-21 at 14:21 +0200, Linus Walleij wrote:
> On Wed, Sep 20, 2017 at 3:39 PM, Jerome Brunet <jbrunet@baylibre.com> wrote:
> 
> > The initial goal of this series was move to TEST_N pin from the EE
> > controller to AO controller, where it belongs. This meant modify the
> > EE_OFF value.
> > 
> > This offset is a quirk we brought from the vendor driver when it was
> > initially merged. There no reason to keep this around and we could simply
> > let pinctrl figure the pin base value.
> > 
> > Removing this offset, while simple, ends up being quite a patch bomb.
> > This is why I split the change over 5 first patches, so the important
> > change, patch #1 remains visible. Of course, to avoid breaking bisect,
> > these first 5 patches should be squashed into one. (If you prefer that I
> > squash it myself, I may have to send you a PR as the patch would exceed
> > VGER 100000 characters limit)
> > 
> > The last change is this series, while not directly related, also requires
> > to adjust the gpio-line-names property in DT. Having these changes going
> > together would make it easier to coordinate the DTS changes.
> > 
> > This was changeset has been test on gxbb P200, gxl libretech-cc.  It was
> > also boot tested on meson8 (Thx Martin!)
> > 
> > Jerome Brunet (8):
> >   pinctrl: meson: remove offset from pinctrl
> >   pinctrl: meson: remove offset continued - gxbb
> >   pinctrl: meson: remove offset continued - gxl
> >   pinctrl: meson: remove offset continued - meson8
> >   pinctrl: meson: remove offset continued - meson8b
> >   pinctrl: meson: get rid of pin_base
> >   pinctrl: meson-gx: TEST_N belongs to the AO controller
> >   pinctrl: meson-gxbb: add missing GPIOX_22 pin
> 
> Looks good just waiting for review from Carlo && || Kevin.

Thanks Linus,

After doing this rework, I noticed that this driver (not the only one though)
assume gpio offset (param of gpio calls) and pin offset are the same thing ...
instead of relying pinctrl (and gpio-ranges) to do the translation.

To make things a bit more clean, I was thinking about forwarding all gpios
framework calls to pinconf, so the gpio to pin offset would go through the
proper mapping function.

Is this the way to do it ?

Using gpio_pinctrl_set_config() I should be able to achieve almost any "write"
functions but I got stuck on gpio_get()

ATM the moment there is no gpio_pinctrl_get_config() or something similar to
read stuff in the gpio framework from pinconf. Would you be open to add
something like this ?

> 
> Yours,
> Linus Walleij


WARNING: multiple messages have this Message-ID (diff)
From: jbrunet@baylibre.com (Jerome Brunet)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/8] pinctrl: meson: clean pin offsets
Date: Thu, 21 Sep 2017 17:00:09 +0200	[thread overview]
Message-ID: <1506006009.2703.175.camel@baylibre.com> (raw)
In-Reply-To: <CACRpkdYmO2PSKU-qkBMW7C35kHf=usfOoEAobQDMMdzd1RFSTw@mail.gmail.com>

On Thu, 2017-09-21 at 14:21 +0200, Linus Walleij wrote:
> On Wed, Sep 20, 2017 at 3:39 PM, Jerome Brunet <jbrunet@baylibre.com> wrote:
> 
> > The initial goal of this series was move to TEST_N pin from the EE
> > controller to AO controller, where it belongs. This meant modify the
> > EE_OFF value.
> > 
> > This offset is a quirk we brought from the vendor driver when it was
> > initially merged. There no reason to keep this around and we could simply
> > let pinctrl figure the pin base value.
> > 
> > Removing this offset, while simple, ends up being quite a patch bomb.
> > This is why I split the change over 5 first patches, so the important
> > change, patch #1 remains visible. Of course, to avoid breaking bisect,
> > these first 5 patches should be squashed into one. (If you prefer that I
> > squash it myself, I may have to send you a PR as the patch would exceed
> > VGER 100000 characters limit)
> > 
> > The last change is this series, while not directly related, also requires
> > to adjust the gpio-line-names property in DT. Having these changes going
> > together would make it easier to coordinate the DTS changes.
> > 
> > This was changeset has been test on gxbb P200, gxl libretech-cc.  It was
> > also boot tested on meson8 (Thx Martin!)
> > 
> > Jerome Brunet (8):
> >   pinctrl: meson: remove offset from pinctrl
> >   pinctrl: meson: remove offset continued - gxbb
> >   pinctrl: meson: remove offset continued - gxl
> >   pinctrl: meson: remove offset continued - meson8
> >   pinctrl: meson: remove offset continued - meson8b
> >   pinctrl: meson: get rid of pin_base
> >   pinctrl: meson-gx: TEST_N belongs to the AO controller
> >   pinctrl: meson-gxbb: add missing GPIOX_22 pin
> 
> Looks good just waiting for review from Carlo && || Kevin.

Thanks Linus,

After doing this rework, I noticed that this driver (not the only one though)
assume gpio offset (param of gpio calls) and pin offset are the same thing ...
instead of relying pinctrl (and gpio-ranges) to do the translation.

To make things a bit more clean, I was thinking about forwarding all gpios
framework calls to pinconf, so the gpio to pin offset would go through the
proper mapping function.

Is this the way to do it ?

Using gpio_pinctrl_set_config() I should be able to achieve almost any "write"
functions but I got stuck on gpio_get()

ATM the moment there is no gpio_pinctrl_get_config() or something similar to
read stuff in the gpio framework from pinconf. Would you be open to add
something like this ?

> 
> Yours,
> Linus Walleij

  reply	other threads:[~2017-09-21 15:00 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 13:39 [PATCH 0/8] pinctrl: meson: clean pin offsets Jerome Brunet
2017-09-20 13:39 ` Jerome Brunet
2017-09-20 13:39 ` Jerome Brunet
2017-09-20 13:39 ` [PATCH 1/8] pinctrl: meson: remove offset from pinctrl Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-10-05 11:22   ` Linus Walleij
2017-10-05 11:22     ` Linus Walleij
2017-10-05 11:22     ` Linus Walleij
2017-10-05 11:22     ` Linus Walleij
2017-10-05 11:47     ` Jerome Brunet
2017-10-05 11:47       ` Jerome Brunet
2017-10-05 11:47       ` Jerome Brunet
2017-09-20 13:39 ` [PATCH 2/8] pinctrl: meson: remove offset continued - gxbb Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-10-05 11:24   ` Linus Walleij
2017-10-05 11:24     ` Linus Walleij
2017-10-05 11:24     ` Linus Walleij
2017-10-05 11:24     ` Linus Walleij
2017-09-20 13:39 ` [PATCH 3/8] pinctrl: meson: remove offset continued - gxl Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-10-05 11:25   ` Linus Walleij
2017-10-05 11:25     ` Linus Walleij
2017-10-05 11:25     ` Linus Walleij
2017-09-20 13:39 ` [PATCH 4/8] pinctrl: meson: remove offset continued - meson8 Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-10-05 11:26   ` Linus Walleij
2017-10-05 11:26     ` Linus Walleij
2017-10-05 11:26     ` Linus Walleij
2017-09-20 13:39 ` [PATCH 5/8] pinctrl: meson: remove offset continued - meson8b Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-10-05 11:29   ` Linus Walleij
2017-10-05 11:29     ` Linus Walleij
2017-10-05 11:29     ` Linus Walleij
2017-09-20 13:39 ` [PATCH 6/8] pinctrl: meson: get rid of pin_base Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-10-05 11:43   ` Linus Walleij
2017-10-05 11:43     ` Linus Walleij
2017-10-05 11:43     ` Linus Walleij
2017-10-05 11:43     ` Linus Walleij
2017-09-20 13:39 ` [PATCH 7/8] pinctrl: meson-gx: TEST_N belongs to the AO controller Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-10-05 11:44   ` Linus Walleij
2017-10-05 11:44     ` Linus Walleij
2017-10-05 11:44     ` Linus Walleij
2017-09-20 13:39 ` [PATCH 8/8] pinctrl: meson-gxbb: add missing GPIOX_22 pin Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-09-20 13:39   ` Jerome Brunet
2017-10-05 11:45   ` Linus Walleij
2017-10-05 11:45     ` Linus Walleij
2017-10-05 11:45     ` Linus Walleij
2017-09-21 12:21 ` [PATCH 0/8] pinctrl: meson: clean pin offsets Linus Walleij
2017-09-21 12:21   ` Linus Walleij
2017-09-21 12:21   ` Linus Walleij
2017-09-21 12:21   ` Linus Walleij
2017-09-21 15:00   ` Jerome Brunet [this message]
2017-09-21 15:00     ` Jerome Brunet
2017-09-21 15:00     ` Jerome Brunet
2017-09-22  8:47     ` Linus Walleij
2017-09-22  8:47       ` Linus Walleij
2017-09-22  8:47       ` Linus Walleij
2017-09-30 20:33 ` Kevin Hilman
2017-09-30 20:33   ` Kevin Hilman
2017-09-30 20:33   ` Kevin Hilman
2017-09-30 20:35 ` Kevin Hilman
2017-09-30 20:35   ` Kevin Hilman
2017-09-30 20:35   ` Kevin Hilman

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=1506006009.2703.175.camel@baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=linus-amlogic@lists.infradead.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 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.