2015-06-30 14:20:18

by Dmitry Osipenko

[permalink] [raw]
Subject: [PATCH v2] ARM: tegra: paz00: use con_id's to refer GPIO's in gpiod_lookup table

Commit 72daceb9a10a ("net: rfkill: gpio: Add default GPIO driver mappings
for ACPI") removed possibility to request GPIO by table index for non-ACPI
platforms without changing it users. As result "shutdown" GPIO request
will fail if request for "reset" GPIO succeeded or "reset" will be
requested instead of "shutdown" if "reset" wasn't defined. Fix it by
making gpiod_lookup_table use con_id's instead of indexes.

Signed-off-by: Dmitry Osipenko <[email protected]>
Fixes: 72daceb (net: rfkill: gpio: Add default GPIO driver mappings for ACPI)
Cc: <[email protected]> # v3.19+
Acked-by: Alexandre Courbot <[email protected]>
---

v2: s/GPIO_LOOKUP_IDX/GPIO_LOOKUP/, otherwise "shutdown" GPIO won't be requested

arch/arm/mach-tegra/board-paz00.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
index fbe74c6..49d1110 100644
--- a/arch/arm/mach-tegra/board-paz00.c
+++ b/arch/arm/mach-tegra/board-paz00.c
@@ -39,8 +39,8 @@ static struct platform_device wifi_rfkill_device = {
static struct gpiod_lookup_table wifi_gpio_lookup = {
.dev_id = "rfkill_gpio",
.table = {
- GPIO_LOOKUP_IDX("tegra-gpio", 25, NULL, 0, 0),
- GPIO_LOOKUP_IDX("tegra-gpio", 85, NULL, 1, 0),
+ GPIO_LOOKUP("tegra-gpio", 25, "reset", 0),
+ GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0),
{ },
},
};
--
2.4.4


2015-06-30 20:46:06

by Marc Dietrich

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: tegra: paz00: use con_id's to refer GPIO's in gpiod_lookup table

Am Dienstag 30 Juni 2015, 17:15:50 schrieb Dmitry Osipenko:
> Commit 72daceb9a10a ("net: rfkill: gpio: Add default GPIO driver mappings
> for ACPI") removed possibility to request GPIO by table index for non-ACPI
> platforms without changing it users. As result "shutdown" GPIO request
> will fail if request for "reset" GPIO succeeded or "reset" will be
> requested instead of "shutdown" if "reset" wasn't defined. Fix it by
> making gpiod_lookup_table use con_id's instead of indexes.
>
> Signed-off-by: Dmitry Osipenko <[email protected]>
> Fixes: 72daceb (net: rfkill: gpio: Add default GPIO driver mappings for
> ACPI) Cc: <[email protected]> # v3.19+
> Acked-by: Alexandre Courbot <[email protected]>

beside a small typo in the commit message (is users -> its users) this looks
good now. I can confirm that the gpio's are all available now.

Reviewed-by: Marc Dietrich <[email protected]>

> ---
>
> v2: s/GPIO_LOOKUP_IDX/GPIO_LOOKUP/, otherwise "shutdown" GPIO won't be
> requested
>
> arch/arm/mach-tegra/board-paz00.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-tegra/board-paz00.c
> b/arch/arm/mach-tegra/board-paz00.c index fbe74c6..49d1110 100644
> --- a/arch/arm/mach-tegra/board-paz00.c
> +++ b/arch/arm/mach-tegra/board-paz00.c
> @@ -39,8 +39,8 @@ static struct platform_device wifi_rfkill_device = {
> static struct gpiod_lookup_table wifi_gpio_lookup = {
> .dev_id = "rfkill_gpio",
> .table = {
> - GPIO_LOOKUP_IDX("tegra-gpio", 25, NULL, 0, 0),
> - GPIO_LOOKUP_IDX("tegra-gpio", 85, NULL, 1, 0),
> + GPIO_LOOKUP("tegra-gpio", 25, "reset", 0),
> + GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0),
> { },
> },
> };


Attachments:
signature.asc (490.00 B)
This is a digitally signed message part.