aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-ams-delta.c
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>2018-06-22 00:41:24 +0200
committerTony Lindgren <tony@atomide.com>2018-07-02 23:05:14 -0700
commit97abda99a56949059955ac0d82c0f6c8277416c4 (patch)
treec9520ee9b3fcd34fa2d22300da456649dd5541e7 /arch/arm/mach-omap1/board-ams-delta.c
parentARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin (diff)
downloadlinux-dev-97abda99a56949059955ac0d82c0f6c8277416c4.tar.xz
linux-dev-97abda99a56949059955ac0d82c0f6c8277416c4.zip
ARM: OMAP1: ams-delta FIQ: don't use static GPIO numbers
With introduction of GPIO lookup tables to Amstrad Delta board init file, semantics of symbols representing OMAP GPIO pins defined in <mach/board-ams-delta.h> changed from statically assigned global GPIO numbers to hardware pin numbers local to OMAP "gpio-0-15" chip. This patch modifies deferred FIQ interrupt handler so it no longer uses static GPIO numbers in favour of IRQ data descriptors obtained at FIQ initialization time from descriptor of the GPIO chip with use of its hardware pin numbers. The chip descriptor is passed from the board init file. As a benefit, the deferred FIQ handler should work faster. Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> [tony@atomide.com: removed duplicate gpiochip_match_by_label] Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/board-ams-delta.c')
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 9b3073e698eb..e937372e704a 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -613,6 +613,28 @@ static struct gpiod_hog ams_delta_gpio_hogs[] = {
{},
};
+/*
+ * The purpose of this function is to take care of proper initialization of
+ * devices and data structures which depend on GPIO lines provided by OMAP GPIO
+ * banks but their drivers don't use GPIO lookup tables or GPIO layer at all.
+ * The function may be called as soon as OMAP GPIO devices are probed.
+ * Since that happens at postcore_initcall, it can be called successfully
+ * from init_machine or later.
+ * Dependent devices may be registered from within this function or later.
+ */
+static void __init omap_gpio_deps_init(void)
+{
+ struct gpio_chip *chip;
+
+ chip = gpiochip_find(OMAP_GPIO_LABEL, gpiochip_match_by_label);
+ if (!chip) {
+ pr_err("%s: OMAP GPIO chip not found\n", __func__);
+ return;
+ }
+
+ ams_delta_init_fiq(chip);
+}
+
static void __init ams_delta_init(void)
{
/* mux pins for uarts */
@@ -633,6 +655,7 @@ static void __init ams_delta_init(void)
omap_cfg_reg(J19_1610_CAM_D6);
omap_cfg_reg(J18_1610_CAM_D7);
+ omap_gpio_deps_init();
gpiod_add_hogs(ams_delta_gpio_hogs);
omap_serial_init();
@@ -674,8 +697,6 @@ static void __init ams_delta_init(void)
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);
omapfb_set_lcd_config(&ams_delta_lcd_config);