All of lore.kernel.org
 help / color / mirror / Atom feed
From: carlo@caione.org (Carlo Caione)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/3] pinctrl: Add support for Meson8b
Date: Sat, 28 Mar 2015 11:24:22 +0100	[thread overview]
Message-ID: <CAOQ7t2bpsoB-kTjwnydLccNf056j3J5D35jsYRNUo6f5PF-pbQ@mail.gmail.com> (raw)
In-Reply-To: <20150328100643.GA21693@gmail.com>

On Sat, Mar 28, 2015 at 11:06 AM, Beniamino Galvani <b.galvani@gmail.com> wrote:
> On Thu, Mar 19, 2015 at 10:34:12PM +0100, Carlo Caione wrote:
>> From: Carlo Caione <carlo@endlessm.com>
>>
>> This patch adds support for the AmLogic Meson8b SoC.
>>
>> Signed-off-by: Carlo Caione <carlo@endlessm.com>
>> ---
>>  drivers/pinctrl/meson/Makefile          |   2 +-
>>  drivers/pinctrl/meson/pinctrl-meson.c   |   4 +
>>  drivers/pinctrl/meson/pinctrl-meson.h   |   1 +
>>  drivers/pinctrl/meson/pinctrl-meson8b.c | 900 ++++++++++++++++++++++++++++++++
>>  include/dt-bindings/gpio/meson8b-gpio.h |  32 ++
>>  5 files changed, 938 insertions(+), 1 deletion(-)
>>  create mode 100644 drivers/pinctrl/meson/pinctrl-meson8b.c
>>  create mode 100644 include/dt-bindings/gpio/meson8b-gpio.h
>>
>> [...]
>>
>> +static struct meson_bank meson8b_banks[] = {
>> +     /*   name    first                      last                   pullen  pull    dir     out     in  */
>> +     BANK("X",    PIN(GPIOX_0, 0),           PIN(GPIOX_21, 0),      4,  0,  4,  0,  0,  0,  1,  0,  2,  0),
>> +     BANK("Y",    PIN(GPIOY_0, 0),           PIN(GPIOY_14, 0),      3,  0,  3,  0,  3,  0,  4,  0,  5,  0),
>> +     BANK("DV",   PIN(GPIODV_9, 0),          PIN(GPIODV_29, 0),     0,  0,  0,  0,  7,  0,  8,  0,  9,  0),
>> +     BANK("H",    PIN(GPIOH_0, 0),           PIN(GPIOH_9, 0),       1, 16,  1, 16,  9, 19, 10, 19, 11, 19),
>> +     BANK("CARD", PIN(CARD_0, 0),            PIN(CARD_6, 0),        2, 20,  2, 20,  0, 22,  1, 22,  2, 22),
>> +     BANK("BOOT", PIN(BOOT_0, 0),            PIN(BOOT_18, 0),       2,  0,  2,  0,  9,  0, 10,  0, 11,  0),
>> +     BANK("DIF",  PIN(DIF_0_P, DIF_OFF),     PIN(DIF_4_N, DIF_OFF), 5,  8,  5,  8, 12, 12, 13, 12, 14, 12),
>> +};
>
> So DIF pins belong to the standard domain and this is ok since they
> use the same range of registers of other non-AO pins, but see below...
>
>> +
>> +static struct meson_bank meson8b_ao_banks[] = {
>> +     /*   name    first                  last                      pullen  pull    dir     out     in  */
>> +     BANK("AO",   PIN(GPIOAO_0, AO_OFF), PIN(GPIO_TEST_N, AO_OFF), 0,  0,  0, 16,  0,  0,  0, 16,  1,  0),
>> +};
>> +
>>
>> [...]
>>
>> --- /dev/null
>> +++ b/include/dt-bindings/gpio/meson8b-gpio.h
>> @@ -0,0 +1,32 @@
>> +
>> +#ifndef _DT_BINDINGS_MESON8B_GPIO_H
>> +#define _DT_BINDINGS_MESON8B_GPIO_H
>> +
>> +#include <dt-bindings/gpio/meson8-gpio.h>
>> +
>> +/* GPIO Bank DIF */
>> +#define DIF_0_P              0
>> +#define DIF_0_N              1
>> +#define DIF_1_P              2
>> +#define DIF_1_N              3
>> +#define DIF_2_P              4
>> +#define DIF_2_N              5
>> +#define DIF_3_P              6
>> +#define DIF_3_N              7
>> +#define DIF_4_P              8
>> +#define DIF_4_N              9
>> +
>> +#endif /* _DT_BINDINGS_MESON8B_GPIO_H */
>
> ... however these definitions start from 0 and thus overlap with the
> definitions in meson8-gpio.h.
>
> This means that the following GPIO specifier in a DTS:
>
>    gpios = <&gpio DIF_0_P GPIO_ACTIVE_HIGH>
>
> has the same effect as
>
>    gpios = <&gpio GPIOX_0 GPIO_ACTIVE_HIGH>
>
> I think that DIF_* pins should have a different numbering, for example
> starting just after the end of the last non-AO pin. AO pin should also
> be shifted accordingly.

Right. Fix in v4.

Thanks for the review.

-- 
Carlo Caione

  reply	other threads:[~2015-03-28 10:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 21:34 [PATCH v3 0/3] Amlogic Meson8b pinctrl driver support Carlo Caione
2015-03-19 21:34 ` [PATCH v3 1/3] pinctrl: Cleanup Meson8 driver Carlo Caione
2015-03-28  9:47   ` Beniamino Galvani
2015-04-07  9:42   ` Linus Walleij
2015-03-19 21:34 ` [PATCH v3 2/3] documentation: Extend pinctrl docs for Meson8b Carlo Caione
2015-03-28  9:49   ` Beniamino Galvani
2015-04-07  9:43   ` Linus Walleij
2015-03-19 21:34 ` [PATCH v3 3/3] pinctrl: Add support " Carlo Caione
2015-03-28 10:06   ` Beniamino Galvani
2015-03-28 10:24     ` Carlo Caione [this message]
2015-03-27  9:02 ` [PATCH v3 0/3] Amlogic Meson8b pinctrl driver support Linus Walleij

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=CAOQ7t2bpsoB-kTjwnydLccNf056j3J5D35jsYRNUo6f5PF-pbQ@mail.gmail.com \
    --to=carlo@caione.org \
    --cc=linux-arm-kernel@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.