Message ID | 20180518210954.29044-1-jmkrzyszt@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, * Janusz Krzysztofik <jmkrzyszt@gmail.com> [180518 14:12]: > Scope of the change is limited to GPIO pins used by board specific > device drivers which will be updated by follow-up patches of the > series. Those are some OMAP GPIO (gpio-0-15) and most of Amstrad Delta > latch2 GPIO bank pins. Remaining pins of those banks, as well as > Amstrad Delta latch1 pins, will be addressed later. > > Assign a label ("latch2") to the bank, enumerate its pins and put that > information, together with OMAP GPIO bank pins, in GPIO lookup tables. > Assign lookup tables to devices as soon as those devices are registered > and their names can be obtained. > > A step froward in: > - removal of hard-coded GPIO numbers from drivers, > - removal of board mach includes from drivers, > - switching to dynamically assigned GPIO numbers. Is this first patch safe for me to apply separately? Regards, Tony -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Monday, May 21, 2018 7:35:19 PM CEST Tony Lindgren wrote: > Hi, > > * Janusz Krzysztofik <jmkrzyszt@gmail.com> [180518 14:12]: > > Scope of the change is limited to GPIO pins used by board specific > > device drivers which will be updated by follow-up patches of the > > series. Those are some OMAP GPIO (gpio-0-15) and most of Amstrad Delta > > latch2 GPIO bank pins. Remaining pins of those banks, as well as > > Amstrad Delta latch1 pins, will be addressed later. > > > > Assign a label ("latch2") to the bank, enumerate its pins and put that > > information, together with OMAP GPIO bank pins, in GPIO lookup tables. > > Assign lookup tables to devices as soon as those devices are registered > > and their names can be obtained. > > > > A step froward in: > > - removal of hard-coded GPIO numbers from drivers, > > - removal of board mach includes from drivers, > > - switching to dynamically assigned GPIO numbers. > > Is this first patch safe for me to apply separately? Absolutely, it is. Thanks, Janusz -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
This is a follow up of initial submission of a series consisted of 6 changes, 3 of which have been already applied or reworkeed. V2 changelog: [PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables - already in mainline, commit 68e62a15a914 [PATCH 2/6] Input: ams_delta_serio: use GPIO lookup table - reworked and submitted as a series, already in linux-omap, commit 68e62a15a914 ("ARM: OMAP1: ams-delta: drop GPIO lookup table for serio device") followed by 9 more [PATCH 3/6] ASoC: ams_delta: use GPIO lookup table - already in mainline, commit d65777d1a2cd [PATCH 4/6] fbdev: omapfb: lcd_ams_delta: use GPIO lookup table - resubmitting as [PATCH v2 1/3 v2] v2: Remove problematic error code conversion no longer needed if used on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late devices back to init_machine") and commit 8853daf3b4ac ("gpiolib: Defer on non-DT find_chip_by_name() failure") already in linux-next [PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table - resubmitting as [PATCH v2 2/3 v4] v2: Fix handling of devm_gpiod_get_optional() return values - thanks to Andy Shevchenko. v3: Remove problematic error code conversion no longer needed if used on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late devices back to init_machine") and commit 8853daf3b4ac ("gpiolib: Defer on non-DT find_chip_by_name() failure") already in linux-next - thanks to Boris Brezillon v4: fix style issue - thanks to Boris Brezillon [PATCH 6/6] ARM: OMAP1: ams-delta: make board header file local to mach-omap1 - resending as [PATCH v2 3/3] Dependency on commit 8853daf3b4ac ("gpiolib: Defer on non-DT find_chip_by_name() failure") is not critical - it is not needed for clean build or run, it only prevents from potential future changes to driver initializaton order during device_initcall. I'm submitting the three patches in series because the last one depends on the other two. Thanks, Janusz -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Janusz, On mer., juil. 18 2018, Janusz Krzysztofik <jmkrzyszt@gmail.com> wrote: > This is a follow up of initial submission of a series consisted of > 6 changes, 3 of which have been already applied or reworkeed. > > V2 changelog: > [PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables > - already in mainline, commit 68e62a15a914 > [PATCH 2/6] Input: ams_delta_serio: use GPIO lookup table > - reworked and submitted as a series, already in linux-omap, > commit 68e62a15a914 ("ARM: OMAP1: ams-delta: drop GPIO lookup > table for serio device") followed by 9 more > [PATCH 3/6] ASoC: ams_delta: use GPIO lookup table > - already in mainline, commit d65777d1a2cd > [PATCH 4/6] fbdev: omapfb: lcd_ams_delta: use GPIO lookup table > - resubmitting as [PATCH v2 1/3 v2] > v2: Remove problematic error code conversion no longer > needed if used on top of commit d08605a64e67 ("ARM: OMAP1: > ams-delta: move late devices back to init_machine") > and commit 8853daf3b4ac ("gpiolib: Defer on non-DT > find_chip_by_name() failure") already in linux-next > [PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table > - resubmitting as [PATCH v2 2/3 v4] > v2: Fix handling of devm_gpiod_get_optional() return values - > thanks to Andy Shevchenko. > v3: Remove problematic error code conversion no longer needed > if used on top of commit d08605a64e67 ("ARM: OMAP1: > ams-delta: move late devices back to init_machine") and > commit 8853daf3b4ac ("gpiolib: Defer on non-DT > find_chip_by_name() failure") already in linux-next - thanks > to Boris Brezillon > v4: fix style issue - thanks to Boris Brezillon > [PATCH 6/6] ARM: OMAP1: ams-delta: make board header file local to > mach-omap1 > - resending as [PATCH v2 3/3] > > Dependency on commit 8853daf3b4ac ("gpiolib: Defer on non-DT > find_chip_by_name() failure") is not critical - it is not needed for > clean build or run, it only prevents from potential future changes to > driver initializaton order during device_initcall. > > I'm submitting the three patches in series because the last one depends > on the other two. I think that being in CC in this series is a mistake as I don't see anything related what I have done in this series. Gregory > > Thanks, > Janusz >
This is a follow up of initial submission of a series consisted of 6 changes, 3 of which have been already applied or reworkeed. Janusz Krzysztofik (3): video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table mtd: rawnand: ams-delta: use GPIO lookup table ARM: OMAP1: ams-delta: make board header file local to mach-omap1 I'm submitting the three patches in series because the last one depends on the other two. Tony, please set up an immutable tag for this series to be used by MTD as there are more changes on Amstrad Delta NAND driver coming in. Thanks, Janusz Changelog: v3: - rebased on top of v4.19-rc1 - added Acked-by: received from Miquel v2: [PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables - already in mainline, commit 68e62a15a914 [PATCH 2/6] Input: ams_delta_serio: use GPIO lookup table - reworked and submitted as a series, already in linux-omap, commit 68e62a15a914 ("ARM: OMAP1: ams-delta: drop GPIO lookup table for serio device") followed by 9 more [PATCH 3/6] ASoC: ams_delta: use GPIO lookup table - already in mainline, commit d65777d1a2cd [PATCH 4/6] fbdev: omapfb: lcd_ams_delta: use GPIO lookup table - resubmitting as [PATCH v2 1/3 v2] v2: Remove problematic error code conversion no longer needed if used on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late devices back to init_machine") and commit 8853daf3b4ac ("gpiolib: Defer on non-DT find_chip_by_name() failure") already in linux-next [PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table - resubmitting as [PATCH v2 2/3 v4] v2: Fix handling of devm_gpiod_get_optional() return values - thanks to Andy Shevchenko. v3: Remove problematic error code conversion no longer needed if used on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late devices back to init_machine") and commit 8853daf3b4ac ("gpiolib: Defer on non-DT find_chip_by_name() failure") already in linux-next - thanks to Boris Brezillon v4: fix style issue - thanks to Boris Brezillon [PATCH 6/6] ARM: OMAP1: ams-delta: make board header file local to mach-omap1 - resending as [PATCH v2 3/3] All dependencies mentioned in v2 changelog are satisfied in v4.19-rc1. diffstat: arch/arm/mach-omap1/ams-delta-fiq-handler.S | 2 arch/arm/mach-omap1/ams-delta-fiq.c | 3 arch/arm/mach-omap1/board-ams-delta.c | 2 arch/arm/mach-omap1/board-ams-delta.h | 2 drivers/mtd/nand/raw/ams-delta.c | 126 ++++++++++++++-------------- drivers/video/fbdev/omap/lcd_ams_delta.c | 55 ++++-------- 6 files changed, 93 insertions(+), 97 deletions(-)
On Monday, September 10, 2018 12:56:02 AM CEST Janusz Krzysztofik wrote: > > This is a follow up of initial submission of a series consisted of > 6 changes, 3 of which have been already applied or reworkeed. > > > Janusz Krzysztofik (3): > video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table > mtd: rawnand: ams-delta: use GPIO lookup table Hi Tony, Please ignore this patch. It may no longer be possible to merged it cleanly with nand/next tree. I'll exclude it from the series, rebase on top of nand/ next and submit via linux-mtd. That shouldn't affect the two remaining patches of the series which should still apply and merge cleanly, but I can resend them renumbered if you wish. Thanks, Janusz > ARM: OMAP1: ams-delta: make board header file local to mach-omap1 > > > I'm submitting the three patches in series because the last one depends > on the other two. > > Tony, please set up an immutable tag for this series to be used by MTD > as there are more changes on Amstrad Delta NAND driver coming in. > > Thanks, > Janusz > > > Changelog: > v3: > - rebased on top of v4.19-rc1 > - added Acked-by: received from Miquel > > v2: > [PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables > - already in mainline, commit 68e62a15a914 > [PATCH 2/6] Input: ams_delta_serio: use GPIO lookup table > - reworked and submitted as a series, already in linux-omap, > commit 68e62a15a914 ("ARM: OMAP1: ams-delta: drop GPIO lookup > table for serio device") followed by 9 more > [PATCH 3/6] ASoC: ams_delta: use GPIO lookup table > - already in mainline, commit d65777d1a2cd > [PATCH 4/6] fbdev: omapfb: lcd_ams_delta: use GPIO lookup table > - resubmitting as [PATCH v2 1/3 v2] > v2: Remove problematic error code conversion no longer > needed if used on top of commit d08605a64e67 ("ARM: OMAP1: > ams-delta: move late devices back to init_machine") > and commit 8853daf3b4ac ("gpiolib: Defer on non-DT > find_chip_by_name() failure") already in linux-next > [PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table > - resubmitting as [PATCH v2 2/3 v4] > v2: Fix handling of devm_gpiod_get_optional() return values - > thanks to Andy Shevchenko. > v3: Remove problematic error code conversion no longer needed > if used on top of commit d08605a64e67 ("ARM: OMAP1: > ams-delta: move late devices back to init_machine") and > commit 8853daf3b4ac ("gpiolib: Defer on non-DT > find_chip_by_name() failure") already in linux-next - thanks > to Boris Brezillon > v4: fix style issue - thanks to Boris Brezillon > [PATCH 6/6] ARM: OMAP1: ams-delta: make board header file local to > mach-omap1 > - resending as [PATCH v2 3/3] > > All dependencies mentioned in v2 changelog are satisfied in v4.19-rc1. > > > diffstat: > arch/arm/mach-omap1/ams-delta-fiq-handler.S | 2 > arch/arm/mach-omap1/ams-delta-fiq.c | 3 > arch/arm/mach-omap1/board-ams-delta.c | 2 > arch/arm/mach-omap1/board-ams-delta.h | 2 > drivers/mtd/nand/raw/ams-delta.c | 126 +++++++++++++ +-------------- > drivers/video/fbdev/omap/lcd_ams_delta.c | 55 ++++-------- > 6 files changed, 93 insertions(+), 97 deletions(-) > >
* Janusz Krzysztofik <jmkrzyszt@gmail.com> [180919 18:13]: > On Monday, September 10, 2018 12:56:02 AM CEST Janusz Krzysztofik wrote: > > > > This is a follow up of initial submission of a series consisted of > > 6 changes, 3 of which have been already applied or reworkeed. > > > > > > Janusz Krzysztofik (3): > > video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table > > mtd: rawnand: ams-delta: use GPIO lookup table > > Hi Tony, > > Please ignore this patch. It may no longer be possible to merged it cleanly > with nand/next tree. I'll exclude it from the series, rebase on top of nand/ > next and submit via linux-mtd. OK sounds good to me. > That shouldn't affect the two remaining patches of the series which should > still apply and merge cleanly, but I can resend them renumbered if you wish. Up to the mtd and fb folks as far as I'm concerned :) Regards, Tony
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 52e8e53ca154..4b78e73f8bf7 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -12,6 +12,7 @@ * published by the Free Software Foundation. */ #include <linux/gpio/driver.h> +#include <linux/gpio/machine.h> #include <linux/gpio.h> #include <linux/kernel.h> #include <linux/init.h> @@ -202,7 +203,10 @@ static struct resource latch2_resources[] = { }, }; +#define LATCH2_LABEL "latch2" + static struct bgpio_pdata latch2_pdata = { + .label = LATCH2_LABEL, .base = AMS_DELTA_LATCH2_GPIO_BASE, .ngpio = AMS_DELTA_LATCH2_NGPIO, }; @@ -217,6 +221,23 @@ static struct platform_device latch2_gpio_device = { }, }; +#define LATCH2_PIN_LCD_VBLEN 0 +#define LATCH2_PIN_LCD_NDISP 1 +#define LATCH2_PIN_NAND_NCE 2 +#define LATCH2_PIN_NAND_NRE 3 +#define LATCH2_PIN_NAND_NWP 4 +#define LATCH2_PIN_NAND_NWE 5 +#define LATCH2_PIN_NAND_ALE 6 +#define LATCH2_PIN_NAND_CLE 7 +#define LATCH2_PIN_KEYBRD_PWR 8 +#define LATCH2_PIN_KEYBRD_DATAOUT 9 +#define LATCH2_PIN_SCARD_RSTIN 10 +#define LATCH2_PIN_SCARD_CMDVCC 11 +#define LATCH2_PIN_MODEM_NRESET 12 +#define LATCH2_PIN_MODEM_CODEC 13 +#define LATCH2_PIN_HOOKFLASH1 14 +#define LATCH2_PIN_HOOKFLASH2 15 + static const struct gpio latch_gpios[] __initconst = { { .gpio = LATCH1_GPIO_BASE + 6, @@ -323,6 +344,22 @@ static struct platform_device ams_delta_nand_device = { .resource = ams_delta_nand_resources, }; +#define OMAP_GPIO_LABEL "gpio-0-15" + +static struct gpiod_lookup_table ams_delta_nand_gpio_table = { + .table = { + GPIO_LOOKUP(OMAP_GPIO_LABEL, AMS_DELTA_GPIO_PIN_NAND_RB, "rdy", + 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NCE, "nce", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NRE, "nre", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWP, "nwp", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWE, "nwe", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_ALE, "ale", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_CLE, "cle", 0), + { }, + }, +}; + static struct resource ams_delta_kp_resources[] = { [0] = { .start = INT_KEYBOARD, @@ -358,6 +395,14 @@ static struct platform_device ams_delta_lcd_device = { .id = -1, }; +static struct gpiod_lookup_table ams_delta_lcd_gpio_table = { + .table = { + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_LCD_VBLEN, "vblen", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_LCD_NDISP, "ndisp", 0), + { }, + }, +}; + static const struct gpio_led gpio_leds[] __initconst = { { .name = "camera", @@ -449,11 +494,35 @@ static struct platform_device ams_delta_audio_device = { .id = -1, }; +static struct gpiod_lookup_table ams_delta_audio_gpio_table = { + .table = { + GPIO_LOOKUP(OMAP_GPIO_LABEL, AMS_DELTA_GPIO_PIN_HOOK_SWITCH, + "hook_switch", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_MODEM_CODEC, + "modem_codec", 0), + { }, + }, +}; + static struct platform_device cx20442_codec_device = { .name = "cx20442-codec", .id = -1, }; +static struct gpiod_lookup_table ams_delta_serio_gpio_table = { + .table = { + GPIO_LOOKUP(OMAP_GPIO_LABEL, AMS_DELTA_GPIO_PIN_KEYBRD_DATA, + "data", 0), + GPIO_LOOKUP(OMAP_GPIO_LABEL, AMS_DELTA_GPIO_PIN_KEYBRD_CLK, + "clock", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_KEYBRD_PWR, + "power", 0), + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_KEYBRD_DATAOUT, + "dataout", 0), + { }, + }, +}; + static struct platform_device *ams_delta_devices[] __initdata = { &latch1_gpio_device, &latch2_gpio_device, @@ -468,6 +537,16 @@ static struct platform_device *late_devices[] __initdata = { &cx20442_codec_device, }; +static struct gpiod_lookup_table *ams_delta_gpio_tables[] __initdata = { + &ams_delta_audio_gpio_table, + &ams_delta_serio_gpio_table, +}; + +static struct gpiod_lookup_table *late_gpio_tables[] __initdata = { + &ams_delta_lcd_gpio_table, + &ams_delta_nand_gpio_table, +}; + static void __init ams_delta_init(void) { /* mux pins for uarts */ @@ -500,6 +579,20 @@ static void __init ams_delta_init(void) gpio_led_register_device(-1, &leds_pdata); platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); + /* + * As soon as devices have been registered, assign their dev_names + * to respective GPIO lookup tables before they are added. + */ + ams_delta_audio_gpio_table.dev_id = + dev_name(&ams_delta_audio_device.dev); + /* + * No device name is assigned to GPIO lookup table for serio device + * as long as serio driver is not converted to platform device driver. + */ + + gpiod_add_lookup_tables(ams_delta_gpio_tables, + ARRAY_SIZE(ams_delta_gpio_tables)); + ams_delta_init_fiq(); omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1); @@ -570,6 +663,15 @@ static int __init late_init(void) platform_add_devices(late_devices, ARRAY_SIZE(late_devices)); + /* + * As soon as devices have been registered, assign their dev_names + * to respective GPIO lookup tables before they are added. + */ + ams_delta_lcd_gpio_table.dev_id = dev_name(&ams_delta_lcd_device.dev); + ams_delta_nand_gpio_table.dev_id = dev_name(&ams_delta_nand_device.dev); + + gpiod_add_lookup_tables(late_gpio_tables, ARRAY_SIZE(late_gpio_tables)); + err = platform_device_register(&modem_nreset_device); if (err) { pr_err("Couldn't register the modem regulator device\n");
Scope of the change is limited to GPIO pins used by board specific device drivers which will be updated by follow-up patches of the series. Those are some OMAP GPIO (gpio-0-15) and most of Amstrad Delta latch2 GPIO bank pins. Remaining pins of those banks, as well as Amstrad Delta latch1 pins, will be addressed later. Assign a label ("latch2") to the bank, enumerate its pins and put that information, together with OMAP GPIO bank pins, in GPIO lookup tables. Assign lookup tables to devices as soon as those devices are registered and their names can be obtained. A step froward in: - removal of hard-coded GPIO numbers from drivers, - removal of board mach includes from drivers, - switching to dynamically assigned GPIO numbers. Created and compile tested agains linux-4.17-rc3 Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> --- arch/arm/mach-omap1/board-ams-delta.c | 102 ++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+)