RE: [PATCH 5/9] OMAP:GPIO: Introduce support for OMAP2PLUS chip specific GPIO

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

 



Tony/Kevin,

> > > +{
> > > +	if (cpu_is_omap242x())
> > > +		gpio_bank_count = 4;
> > > +	else if (cpu_is_omap243x())
> > > +		gpio_bank_count = 5;
> > > +	else if (cpu_is_omap34xx() || cpu_is_omap44xx())
> > > +		gpio_bank_count = OMAP34XX_NR_GPIOS;
> > > +
> > > +	if (gpio_init())
> > > +		return -EINVAL;
> > > +
> > > +	early_platform_driver_register_all("earlygpio");
> > > +	early_platform_driver_probe("earlygpio", gpio_bank_count, 0);
> > > +	return 0;
> > > +}
> >
> > Then please replace this init with something like:
> 
> Okay.
> 
> >
> > #ifdef CONFIG_ARCH_OMAP2
> > int __init omap242x_gpio_init(void)
> > {
> > 	if (!cpu_is_omap2420())
> > 		return -EINVAL;
> >
> > 	gpio_bank_count = 4;
> >
> > 	return gpio_init(METHOD_GPIO_24XX);
> > }
> > subsys_initcall(omap242x_gpio_init);
> >
> > int __init omap243x_gpio_init(void)
> > {
> > 	if (!cpu_is_omap2430())
> > 		return -EINVAL;
> >
> > 	gpio_bank_count = 5;
> >
> > 	return gpio_init(METHOD_GPIO_24XX);
> > }
> > subsys_initcall(omap243x_gpio_init);
> > #endif
> >
> > #ifdef CONFIG_ARCH_OMAP3
> > int __init omap34xx_gpio_init(void)
> > {
> > 	if (!cpu_is_omap34xx())
> > 		return -EINVAL;
> >
> > 	gpio_bank_count = OMAP34X_NR_GPIOS;
> >
> > 	return gpio_init(METHOD_GPIO_34XX);
> > }
> > subsys_initcall(omap34xx_gpio_init);
> > #endif
> > ...
> >
> > This way it will be more future proof when new omaps get added
> > and the if else stuff disappears. Also then you'll have an omap
> > specific function to initialize the gpio stuff.
> >
> > Note that then early_platform_driver_register_all and
> > early_platform_driver_probe can be moved to gpio_init.
> >
> > With multi-omap build the subsys_initcall runs for all of the
> > selected platforms, but returns early except for the machine
> > we're running on. All the code is optimized out for omap
> > specific product kernels.
> 
> Okay. Will do the needful and send new patch series in 2 weeks.

subsys_initcall is not sufficient for SoC specific gpio_init as it needs
to be done before machine_init functions access gpio APIs. Hence I am 
making SoC specific gpio_init as postcore_initcall.


> 

--
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