Re: [PATCH v2 12/18] GPIO: OMAP: Clean omap_gpio_mod_init function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"DebBarma, Tarun Kanti" <tarun.kanti@xxxxxx> writes:

> Kevin,
> [...]
>> >
>> > With register offsets now defined for respective OMAP versions we can
>> get rid
>> > of cpu_class_* checks. In addition, organized common initialization for
>> the
>> > different OMAP silicon versions.
>> >
>> > Signed-off-by: Charulatha V <charu@xxxxxx>
>> > Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@xxxxxx>
>> 
>> Since the SYSCONFIG register settings are OMAP1-only and init-time only,
>> they could be done in the OMAP1-specific init functions.
> BTW, I needed some more clarifications here...
> The omap_gpio_mod_init() is called only once from _probe().
> So, does it make sense to have a separate init function?
> If yes, I have to call __init omap1_gpio_mod_init() from _probe() again.
> This is because I need the bank information supplied to it.

What I was thinking is something like the patch below (16xx only for
example, but would need to be done for other OMAP1 also).  This patch
will obviously not work, but read the comment in the patch to make it work.

Kevin

diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index c69b3b1..1d34a4c 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -218,8 +218,12 @@ static int __init omap16xx_gpio_init(void)
 	if (!cpu_is_omap16xx())
 		return -EINVAL;
 
-	for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++)
+	for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
+		u32 base = 0; /* get base from device's struct resource */
+
+		__raw_writew(0x0014, base + OMAP1610_GPIO_SYSCONFIG);
 		platform_device_register(omap16xx_gpio_dev[i]);
+	}
 
 	gpio_bank_count = ARRAY_SIZE(omap16xx_gpio_dev);
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux