* [PATCH] pinctrl: meson: axg: Fix GPIO pin offsets
@ 2018-12-06 8:08 Carlo Caione
2018-12-07 5:14 ` Kevin Hilman
0 siblings, 1 reply; 3+ messages in thread
From: Carlo Caione @ 2018-12-06 8:08 UTC (permalink / raw)
To: jbrunet, narmstrong, u-boot, linux-amlogic; +Cc: Carlo Caione
The pin number (first and last) in the bank definition is missing the
pin base offset shifting. This is causing a miscalculation when
retrieving the register and pin offsets in the GPIO driver causing the
'gpio' command to drive the wrong pins / GPIOs in the second GPIO chip
(the AO bank is driven correctly because the shifting is already 0).
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
drivers/pinctrl/meson/pinctrl-meson-axg.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c
index a54fbce910..3bbbe817b4 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-axg.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c
@@ -14,7 +14,7 @@
#include "pinctrl-meson-axg.h"
-#define EE_OFF 14
+#define EE_OFF 15
/* emmc */
static const unsigned int emmc_nand_d0_pins[] = {BOOT_0};
@@ -893,17 +893,17 @@ static struct meson_pmx_func meson_axg_aobus_functions[] = {
};
static struct meson_bank meson_axg_periphs_banks[] = {
- /* name first last pullen pull dir out in */
- BANK("Z", GPIOZ_0, GPIOZ_10, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
- BANK("BOOT", BOOT_0, BOOT_14, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
- BANK("A", GPIOA_0, GPIOA_20, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
- BANK("X", GPIOX_0, GPIOX_22, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
- BANK("Y", GPIOY_0, GPIOY_15, 1, 0, 1, 0, 3, 0, 4, 0, 5, 0),
+ /* name first last pullen pull dir out in */
+ BANK("Z", PIN(GPIOZ_0, EE_OFF), PIN(GPIOZ_10, EE_OFF), 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
+ BANK("BOOT", PIN(BOOT_0, EE_OFF), PIN(BOOT_14, EE_OFF), 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
+ BANK("A", PIN(GPIOA_0, EE_OFF), PIN(GPIOA_20, EE_OFF), 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
+ BANK("X", PIN(GPIOX_0, EE_OFF), PIN(GPIOX_22, EE_OFF), 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
+ BANK("Y", PIN(GPIOY_0, EE_OFF), PIN(GPIOY_15, EE_OFF), 1, 0, 1, 0, 3, 0, 4, 0, 5, 0),
};
static struct meson_bank meson_axg_aobus_banks[] = {
- /* name first last pullen pull dir out in */
- BANK("AO", GPIOAO_0, GPIOAO_13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
+ /* name first last pullen pull dir out in */
+ BANK("AO", PIN(GPIOAO_0, 0), PIN(GPIOAO_13, 0), 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
};
static struct meson_pmx_bank meson_axg_periphs_pmx_banks[] = {
@@ -931,11 +931,11 @@ static struct meson_axg_pmx_data meson_axg_aobus_pmx_banks_data = {
struct meson_pinctrl_data meson_axg_periphs_pinctrl_data = {
.name = "periphs-banks",
- .pin_base = 11,
+ .pin_base = 15,
.groups = meson_axg_periphs_groups,
.funcs = meson_axg_periphs_functions,
.banks = meson_axg_periphs_banks,
- .num_pins = 100,
+ .num_pins = 86,
.num_groups = ARRAY_SIZE(meson_axg_periphs_groups),
.num_funcs = ARRAY_SIZE(meson_axg_periphs_functions),
.num_banks = ARRAY_SIZE(meson_axg_periphs_banks),
--
2.19.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: meson: axg: Fix GPIO pin offsets
2018-12-06 8:08 [PATCH] pinctrl: meson: axg: Fix GPIO pin offsets Carlo Caione
@ 2018-12-07 5:14 ` Kevin Hilman
2018-12-07 8:40 ` Neil Armstrong
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2018-12-07 5:14 UTC (permalink / raw)
To: Carlo Caione, jbrunet, narmstrong, u-boot, linux-amlogic; +Cc: Carlo Caione
Carlo Caione <ccaione@baylibre.com> writes:
> The pin number (first and last) in the bank definition is missing the
> pin base offset shifting. This is causing a miscalculation when
> retrieving the register and pin offsets in the GPIO driver causing the
> 'gpio' command to drive the wrong pins / GPIOs in the second GPIO chip
> (the AO bank is driven correctly because the shifting is already 0).
>
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This looks like it could use a Fixes: tag for stable.
Kevin
> ---
> drivers/pinctrl/meson/pinctrl-meson-axg.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c
> index a54fbce910..3bbbe817b4 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson-axg.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c
> @@ -14,7 +14,7 @@
>
> #include "pinctrl-meson-axg.h"
>
> -#define EE_OFF 14
> +#define EE_OFF 15
>
> /* emmc */
> static const unsigned int emmc_nand_d0_pins[] = {BOOT_0};
> @@ -893,17 +893,17 @@ static struct meson_pmx_func meson_axg_aobus_functions[] = {
> };
>
> static struct meson_bank meson_axg_periphs_banks[] = {
> - /* name first last pullen pull dir out in */
> - BANK("Z", GPIOZ_0, GPIOZ_10, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
> - BANK("BOOT", BOOT_0, BOOT_14, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
> - BANK("A", GPIOA_0, GPIOA_20, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
> - BANK("X", GPIOX_0, GPIOX_22, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
> - BANK("Y", GPIOY_0, GPIOY_15, 1, 0, 1, 0, 3, 0, 4, 0, 5, 0),
> + /* name first last pullen pull dir out in */
> + BANK("Z", PIN(GPIOZ_0, EE_OFF), PIN(GPIOZ_10, EE_OFF), 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
> + BANK("BOOT", PIN(BOOT_0, EE_OFF), PIN(BOOT_14, EE_OFF), 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
> + BANK("A", PIN(GPIOA_0, EE_OFF), PIN(GPIOA_20, EE_OFF), 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
> + BANK("X", PIN(GPIOX_0, EE_OFF), PIN(GPIOX_22, EE_OFF), 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
> + BANK("Y", PIN(GPIOY_0, EE_OFF), PIN(GPIOY_15, EE_OFF), 1, 0, 1, 0, 3, 0, 4, 0, 5, 0),
> };
>
> static struct meson_bank meson_axg_aobus_banks[] = {
> - /* name first last pullen pull dir out in */
> - BANK("AO", GPIOAO_0, GPIOAO_13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
> + /* name first last pullen pull dir out in */
> + BANK("AO", PIN(GPIOAO_0, 0), PIN(GPIOAO_13, 0), 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
> };
>
> static struct meson_pmx_bank meson_axg_periphs_pmx_banks[] = {
> @@ -931,11 +931,11 @@ static struct meson_axg_pmx_data meson_axg_aobus_pmx_banks_data = {
>
> struct meson_pinctrl_data meson_axg_periphs_pinctrl_data = {
> .name = "periphs-banks",
> - .pin_base = 11,
> + .pin_base = 15,
> .groups = meson_axg_periphs_groups,
> .funcs = meson_axg_periphs_functions,
> .banks = meson_axg_periphs_banks,
> - .num_pins = 100,
> + .num_pins = 86,
> .num_groups = ARRAY_SIZE(meson_axg_periphs_groups),
> .num_funcs = ARRAY_SIZE(meson_axg_periphs_functions),
> .num_banks = ARRAY_SIZE(meson_axg_periphs_banks),
> --
> 2.19.1
>
>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: meson: axg: Fix GPIO pin offsets
2018-12-07 5:14 ` Kevin Hilman
@ 2018-12-07 8:40 ` Neil Armstrong
0 siblings, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2018-12-07 8:40 UTC (permalink / raw)
To: Kevin Hilman, Carlo Caione, jbrunet, u-boot, linux-amlogic
Hi,
On 07/12/2018 06:14, Kevin Hilman wrote:
> Carlo Caione <ccaione@baylibre.com> writes:
>
>> The pin number (first and last) in the bank definition is missing the
>> pin base offset shifting. This is causing a miscalculation when
>> retrieving the register and pin offsets in the GPIO driver causing the
>> 'gpio' command to drive the wrong pins / GPIOs in the second GPIO chip
>> (the AO bank is driven correctly because the shifting is already 0).
>>
>> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
>
> This looks like it could use a Fixes: tag for stable.
Ah ah, it's an uboot patch ;-)
Anyway, Applied, thanks for the patch Carlo !
Neil
PS: You should add [PATCH u-boot] on the subject line like I do so kevin can filter them out
>
> Kevin
>
>> ---
>> drivers/pinctrl/meson/pinctrl-meson-axg.c | 22 +++++++++++-----------
>> 1 file changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c
>> index a54fbce910..3bbbe817b4 100644
>> --- a/drivers/pinctrl/meson/pinctrl-meson-axg.c
>> +++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c
>> @@ -14,7 +14,7 @@
>>
>> #include "pinctrl-meson-axg.h"
>>
>> -#define EE_OFF 14
>> +#define EE_OFF 15
>>
>> /* emmc */
>> static const unsigned int emmc_nand_d0_pins[] = {BOOT_0};
>> @@ -893,17 +893,17 @@ static struct meson_pmx_func meson_axg_aobus_functions[] = {
>> };
>>
>> static struct meson_bank meson_axg_periphs_banks[] = {
>> - /* name first last pullen pull dir out in */
>> - BANK("Z", GPIOZ_0, GPIOZ_10, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
>> - BANK("BOOT", BOOT_0, BOOT_14, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
>> - BANK("A", GPIOA_0, GPIOA_20, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
>> - BANK("X", GPIOX_0, GPIOX_22, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
>> - BANK("Y", GPIOY_0, GPIOY_15, 1, 0, 1, 0, 3, 0, 4, 0, 5, 0),
>> + /* name first last pullen pull dir out in */
>> + BANK("Z", PIN(GPIOZ_0, EE_OFF), PIN(GPIOZ_10, EE_OFF), 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
>> + BANK("BOOT", PIN(BOOT_0, EE_OFF), PIN(BOOT_14, EE_OFF), 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
>> + BANK("A", PIN(GPIOA_0, EE_OFF), PIN(GPIOA_20, EE_OFF), 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
>> + BANK("X", PIN(GPIOX_0, EE_OFF), PIN(GPIOX_22, EE_OFF), 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
>> + BANK("Y", PIN(GPIOY_0, EE_OFF), PIN(GPIOY_15, EE_OFF), 1, 0, 1, 0, 3, 0, 4, 0, 5, 0),
>> };
>>
>> static struct meson_bank meson_axg_aobus_banks[] = {
>> - /* name first last pullen pull dir out in */
>> - BANK("AO", GPIOAO_0, GPIOAO_13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
>> + /* name first last pullen pull dir out in */
>> + BANK("AO", PIN(GPIOAO_0, 0), PIN(GPIOAO_13, 0), 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
>> };
>>
>> static struct meson_pmx_bank meson_axg_periphs_pmx_banks[] = {
>> @@ -931,11 +931,11 @@ static struct meson_axg_pmx_data meson_axg_aobus_pmx_banks_data = {
>>
>> struct meson_pinctrl_data meson_axg_periphs_pinctrl_data = {
>> .name = "periphs-banks",
>> - .pin_base = 11,
>> + .pin_base = 15,
>> .groups = meson_axg_periphs_groups,
>> .funcs = meson_axg_periphs_functions,
>> .banks = meson_axg_periphs_banks,
>> - .num_pins = 100,
>> + .num_pins = 86,
>> .num_groups = ARRAY_SIZE(meson_axg_periphs_groups),
>> .num_funcs = ARRAY_SIZE(meson_axg_periphs_functions),
>> .num_banks = ARRAY_SIZE(meson_axg_periphs_banks),
>> --
>> 2.19.1
>>
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-07 8:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06 8:08 [PATCH] pinctrl: meson: axg: Fix GPIO pin offsets Carlo Caione
2018-12-07 5:14 ` Kevin Hilman
2018-12-07 8:40 ` Neil Armstrong
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).