arm: spear: enable GPIO3 and 4 clocks when the GPIO controller driver is built
authorQuentin Schulz <quentin.schulz@bootlin.com>
Fri, 31 Aug 2018 14:15:53 +0000 (16:15 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 11 Sep 2018 01:19:32 +0000 (21:19 -0400)
There are multiple GPIOs that can be used with the same driver depending
on the CONFIG_GPIO_BASE defined in the controller driver.

GPIO3 and 4 require a clock to be enabled so let's enable them when the
driver is built.

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
arch/arm/cpu/arm926ejs/spear/cpu.c
arch/arm/include/asm/arch-spear/spr_misc.h

index e852a88..88a40c6 100644 (file)
@@ -49,6 +49,9 @@ int arch_cpu_init(void)
 #if defined(CONFIG_USB_EHCI_SPEAR)
        periph1_clken |= PERIPH_USBH1 | PERIPH_USBH2;
 #endif
+#if defined(CONFIG_SPEAR_GPIO)
+       periph1_clken |= MISC_GPIO3ENB | MISC_GPIO4ENB;
+#endif
 
        writel(periph1_clken, &misc_p->periph1_clken);
 
index c906730..65063fc 100644 (file)
@@ -144,6 +144,7 @@ struct misc_regs {
 #define MISC_USBDENB                   0x01000000
 #define MISC_ETHENB                    0x00800000
 #define MISC_SMIENB                    0x00200000
+#define MISC_GPIO3ENB                  0x00040000
 #define MISC_GPT3ENB                   0x00010000
 #define MISC_GPIO4ENB                  0x00002000
 #define MISC_GPT2ENB                   0x00000800