* [PATCH] Ask a question about why can't use GPIOAO: GPIO_TEST_N
@ 2022-07-14 2:07 Zhang Ning
2022-07-18 8:20 ` Neil Armstrong
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Ning @ 2022-07-14 2:07 UTC (permalink / raw)
To: narmstrong, linux-amlogic; +Cc: Zhang Ning
first this is not a code review, just ask a question.
I started to enable MagicBox M16S, and sent patches for review.
but leds are not enabled.
I have tried, and found gpioao: GPIO_TEST_N can control led on off.
thus I add it to dts:
leds {
compatible = "gpio-leds";
led-white {
color = <LED_COLOR_ID_WHITE>;
function = LED_FUNCTION_POWER;
gpios = <&gpio_ao GPIO_TEST_N GPIO_ACTIVE_HIGH>;
default-state = "keep";
};
};
but failed with error -22.
and simply change GPIO_TEST_N to GPIOAO_2, no error.
thus find pinctrl driver doesn't allow to use this gpio.
why?
Signed-off-by: Zhang Ning <zhangn1985@qq.com>
---
drivers/pinctrl/meson/pinctrl-meson-gxl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
index 51408996255b..fb5fa88b30c7 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
@@ -820,7 +820,7 @@ static struct meson_bank meson_gxl_periphs_banks[] = {
static struct meson_bank meson_gxl_aobus_banks[] = {
/* name first last irq pullen pull dir out in */
- BANK("AO", GPIOAO_0, GPIOAO_9, 0, 9, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
+ BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 9, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
};
static struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
--
2.35.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Ask a question about why can't use GPIOAO: GPIO_TEST_N
2022-07-14 2:07 [PATCH] Ask a question about why can't use GPIOAO: GPIO_TEST_N Zhang Ning
@ 2022-07-18 8:20 ` Neil Armstrong
0 siblings, 0 replies; 2+ messages in thread
From: Neil Armstrong @ 2022-07-18 8:20 UTC (permalink / raw)
To: Zhang Ning, linux-amlogic
Hi,
On 14/07/2022 04:07, Zhang Ning wrote:
> first this is not a code review, just ask a question.
>
> I started to enable MagicBox M16S, and sent patches for review.
>
> but leds are not enabled.
>
> I have tried, and found gpioao: GPIO_TEST_N can control led on off.
>
> thus I add it to dts:
>
> leds {
> compatible = "gpio-leds";
>
> led-white {
> color = <LED_COLOR_ID_WHITE>;
> function = LED_FUNCTION_POWER;
> gpios = <&gpio_ao GPIO_TEST_N GPIO_ACTIVE_HIGH>;
> default-state = "keep";
> };
> };
>
> but failed with error -22.
>
> and simply change GPIO_TEST_N to GPIOAO_2, no error.
>
> thus find pinctrl driver doesn't allow to use this gpio.
>
> why?
The TEST_N pinctrl needs a SMC call to set the pin GPIO direction, so it needs
more code to control the pin.
I did an experimental support a few years ago:
https://github.com/superna9999/linux/commits/amlogic/v4.19/gpio-test-n
I would need to be refreshed to work on 5.20.
Neil
>
> Signed-off-by: Zhang Ning <zhangn1985@qq.com>
> ---
> drivers/pinctrl/meson/pinctrl-meson-gxl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
> index 51408996255b..fb5fa88b30c7 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
> @@ -820,7 +820,7 @@ static struct meson_bank meson_gxl_periphs_banks[] = {
>
> static struct meson_bank meson_gxl_aobus_banks[] = {
> /* name first last irq pullen pull dir out in */
> - BANK("AO", GPIOAO_0, GPIOAO_9, 0, 9, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
> + BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 9, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
> };
>
> static struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-18 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 2:07 [PATCH] Ask a question about why can't use GPIOAO: GPIO_TEST_N Zhang Ning
2022-07-18 8:20 ` Neil Armstrong
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.