* [PATCH] OMAP/gpio: drop MPUIO static base
@ 2023-09-12 8:44 Linus Walleij
2023-09-26 7:09 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2023-09-12 8:44 UTC (permalink / raw)
To: Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren,
Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Bartosz Golaszewski, Andy Shevchenko
Cc: linux-arm-kernel, linux-omap, linux-gpio, Linus Walleij
The OMAP GPIO driver hardcodes the MPIO chip base, but there
is no point: we have already moved all consumers over to using
descriptor look-ups.
Drop the MPUIO GPIO base and use dynamic assignment.
Root out the unused instances of the OMAP_MPUIO() macro and
delete the unused OMAP_GPIO_IS_MPUIO() macro.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Maybe Bartosz can merge this into the GPIO tree with Tony's
et al blessing?
---
arch/arm/mach-omap1/board-palmte.c | 5 -----
drivers/gpio/gpio-omap.c | 3 +--
include/linux/platform_data/gpio-omap.h | 3 ---
3 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 7e061d671fde..c917cb2c6e17 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -51,11 +51,6 @@
#define PALMTE_HDQ_GPIO 11
#define PALMTE_HEADPHONES_GPIO 14
#define PALMTE_SPEAKER_GPIO 15
-#define PALMTE_DC_GPIO OMAP_MPUIO(2)
-#define PALMTE_MMC_SWITCH_GPIO OMAP_MPUIO(4)
-#define PALMTE_MMC1_GPIO OMAP_MPUIO(6)
-#define PALMTE_MMC2_GPIO OMAP_MPUIO(7)
-#define PALMTE_MMC3_GPIO OMAP_MPUIO(11)
static const unsigned int palmte_keymap[] = {
KEY(0, 0, KEY_F1), /* Calendar */
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index a927680c66f8..262ec0c1c658 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1048,15 +1048,14 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct device *pm_dev)
bank->chip.label = "mpuio";
if (bank->regs->wkup_en)
bank->chip.parent = &omap_mpuio_device.dev;
- bank->chip.base = OMAP_MPUIO(0);
} else {
label = devm_kasprintf(bank->chip.parent, GFP_KERNEL, "gpio-%d-%d",
gpio, gpio + bank->width - 1);
if (!label)
return -ENOMEM;
bank->chip.label = label;
- bank->chip.base = -1;
}
+ bank->chip.base = -1;
bank->chip.ngpio = bank->width;
irq = &bank->chip.irq;
diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h
index f377817ce75c..cdd8cfb424f5 100644
--- a/include/linux/platform_data/gpio-omap.h
+++ b/include/linux/platform_data/gpio-omap.h
@@ -144,9 +144,6 @@
#define OMAP_MAX_GPIO_LINES 192
-#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
-#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
-
#ifndef __ASSEMBLER__
struct omap_gpio_reg_offs {
u16 revision;
---
base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
change-id: 20230912-omap-mpuio-base-9adbacf742fb
Best regards,
--
Linus Walleij <linus.walleij@linaro.org>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP/gpio: drop MPUIO static base
2023-09-12 8:44 [PATCH] OMAP/gpio: drop MPUIO static base Linus Walleij
@ 2023-09-26 7:09 ` Tony Lindgren
2023-10-04 0:36 ` Janusz Krzysztofik
2023-10-04 9:37 ` Bartosz Golaszewski
0 siblings, 2 replies; 5+ messages in thread
From: Tony Lindgren @ 2023-09-26 7:09 UTC (permalink / raw)
To: Linus Walleij
Cc: Aaro Koskinen, Janusz Krzysztofik, Grygorii Strashko,
Santosh Shilimkar, Kevin Hilman, Bartosz Golaszewski,
Andy Shevchenko, linux-arm-kernel, linux-omap, linux-gpio
* Linus Walleij <linus.walleij@linaro.org> [230912 08:45]:
> The OMAP GPIO driver hardcodes the MPIO chip base, but there
> is no point: we have already moved all consumers over to using
> descriptor look-ups.
>
> Drop the MPUIO GPIO base and use dynamic assignment.
>
> Root out the unused instances of the OMAP_MPUIO() macro and
> delete the unused OMAP_GPIO_IS_MPUIO() macro.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Maybe Bartosz can merge this into the GPIO tree with Tony's
> et al blessing?
Best to wait for Tested-by from Aaro on this one.
As far as I'm concerned, good to see this:
Reviewed-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP/gpio: drop MPUIO static base
2023-09-26 7:09 ` Tony Lindgren
@ 2023-10-04 0:36 ` Janusz Krzysztofik
2023-10-04 10:23 ` Linus Walleij
2023-10-04 9:37 ` Bartosz Golaszewski
1 sibling, 1 reply; 5+ messages in thread
From: Janusz Krzysztofik @ 2023-10-04 0:36 UTC (permalink / raw)
To: Linus Walleij, Tony Lindgren
Cc: Aaro Koskinen, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Bartosz Golaszewski, Andy Shevchenko, linux-arm-kernel,
linux-omap, linux-gpio
[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]
Hi Linus, Tony,
Dnia wtorek, 26 września 2023 09:09:53 CEST Tony Lindgren pisze:
> * Linus Walleij <linus.walleij@linaro.org> [230912 08:45]:
> > The OMAP GPIO driver hardcodes the MPIO chip base, but there
> > is no point: we have already moved all consumers over to using
> > descriptor look-ups.
> >
> > Drop the MPUIO GPIO base and use dynamic assignment.
On my OMAP1510 based ams_delta with the patch applied on top of v6.6-rc4:
root@amsdelta:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 512-527, parent: platform/omap_gpio.0, mpuio:
gpio-512 ( |data ) in lo
gpio-513 ( |data ) in lo
gpio-514 ( |data ) in lo
gpio-515 ( |data ) in lo
gpio-516 ( |data ) in lo
gpio-517 ( |data ) in lo
gpio-518 ( |data ) in lo
gpio-519 ( |data ) in lo
gpiochip1: GPIOs 528-543, parent: platform/omap_gpio.1, gpio-0-15:
gpio-528 ( |keybrd_data ) in lo
gpio-529 ( |keybrd_clk ) in lo IRQ
gpio-530 ( |modem_irq ) in lo
gpio-532 ( |hook_switch ) in hi IRQ
gpio-540 ( |rdy ) in hi
gpiochip2: GPIOs 544-551, parent: platform/basic-mmio-gpio.0, latch1:
gpio-544 ( |camera ) out lo
...
GPIO based hardware seems to be working correctly. I'm only not sure if
we should maybe change the name to something else than gpio-0-15 (mpuio
looks OK).
> >
> > Root out the unused instances of the OMAP_MPUIO() macro and
> > delete the unused OMAP_GPIO_IS_MPUIO() macro.
> >
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> > Maybe Bartosz can merge this into the GPIO tree with Tony's
> > et al blessing?
>
> Best to wait for Tested-by from Aaro on this one.
>
> As far as I'm concerned, good to see this:
>
> Reviewed-by: Tony Lindgren <tony@atomide.com>
Tested-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP/gpio: drop MPUIO static base
2023-09-26 7:09 ` Tony Lindgren
2023-10-04 0:36 ` Janusz Krzysztofik
@ 2023-10-04 9:37 ` Bartosz Golaszewski
1 sibling, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2023-10-04 9:37 UTC (permalink / raw)
To: Tony Lindgren
Cc: Linus Walleij, Aaro Koskinen, Janusz Krzysztofik,
Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Andy Shevchenko, linux-arm-kernel, linux-omap, linux-gpio
On Tue, Sep 26, 2023 at 9:09 AM Tony Lindgren <tony@atomide.com> wrote:
>
> * Linus Walleij <linus.walleij@linaro.org> [230912 08:45]:
> > The OMAP GPIO driver hardcodes the MPIO chip base, but there
> > is no point: we have already moved all consumers over to using
> > descriptor look-ups.
> >
> > Drop the MPUIO GPIO base and use dynamic assignment.
> >
> > Root out the unused instances of the OMAP_MPUIO() macro and
> > delete the unused OMAP_GPIO_IS_MPUIO() macro.
> >
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> > Maybe Bartosz can merge this into the GPIO tree with Tony's
> > et al blessing?
>
> Best to wait for Tested-by from Aaro on this one.
>
> As far as I'm concerned, good to see this:
>
> Reviewed-by: Tony Lindgren <tony@atomide.com>
Patch applied, thanks!
Bart
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP/gpio: drop MPUIO static base
2023-10-04 0:36 ` Janusz Krzysztofik
@ 2023-10-04 10:23 ` Linus Walleij
0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2023-10-04 10:23 UTC (permalink / raw)
To: Janusz Krzysztofik
Cc: Tony Lindgren, Aaro Koskinen, Grygorii Strashko,
Santosh Shilimkar, Kevin Hilman, Bartosz Golaszewski,
Andy Shevchenko, linux-arm-kernel, linux-omap, linux-gpio
Ji Janusz,
On Wed, Oct 4, 2023 at 2:36 AM Janusz Krzysztofik <jmkrzyszt@gmail.com> wrote:
> Tested-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Wow thanks a lot Janusz, I was really scared that this patch would not work
but here we are!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-10-04 10:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-12 8:44 [PATCH] OMAP/gpio: drop MPUIO static base Linus Walleij
2023-09-26 7:09 ` Tony Lindgren
2023-10-04 0:36 ` Janusz Krzysztofik
2023-10-04 10:23 ` Linus Walleij
2023-10-04 9:37 ` Bartosz Golaszewski
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).