All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Varadarajan, Charulatha" <charu@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"Nayak, Rajendra" <rnayak@ti.com>,
	"paul@pwsan.com" <paul@pwsan.com>
Subject: Re: [PATCH 5/9] OMAP:GPIO: Introduce support for OMAP2PLUS chip specific GPIO
Date: Wed, 12 May 2010 07:49:25 -0700	[thread overview]
Message-ID: <87ljbpqioa.fsf@deeprootsystems.com> (raw)
In-Reply-To: <EAF47CD23C76F840A9E7FCE10091EFAB02C54EF826@dbde02.ent.ti.com> (Charulatha Varadarajan's message of "Wed\, 12 May 2010 17\:59\:31 +0530")

"Varadarajan, Charulatha" <charu@ti.com> writes:

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

OK.  Please add a comment at the postcore_initcall() location with the
details as to why it is needed and what it needs to go before etc.

Kevin

  reply	other threads:[~2010-05-12 14:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22 15:55 [PATCH 00/09] OMAP:GPIO:Implement GPIO in HWMOD way Charulatha V
2010-04-22 15:55 ` [PATCH 1/9] OMAP:GPIO: Modify init() in preparation for platform device implementation Charulatha V
2010-04-22 15:55   ` [PATCH 2/9] OMAP:GPIO: Introduce support for OMAP15xx chip specific GPIO Charulatha V
2010-04-22 15:55     ` [PATCH 3/9] OMAP:GPIO: Introduce support for OMAP16xx " Charulatha V
2010-04-22 15:55       ` [PATCH 4/9] OMAP:GPIO: Introduce support for OMAP7xx " Charulatha V
2010-04-22 15:55         ` [PATCH 5/9] OMAP:GPIO: Introduce support for OMAP2PLUS " Charulatha V
2010-04-22 15:55           ` [PATCH 6/9] OMAP:GPIO:hwmod: add GPIO hwmods for OMAP3 Charulatha V
2010-04-22 15:55             ` [PATCH 7/9] OMAP:GPIO:hwmod: add GPIO hwmods for OMAP2420 Charulatha V
2010-04-22 15:55               ` [PATCH 8/9] OMAP:GPIO:hwmod: add GPIO hwmods for OMAP2430 Charulatha V
2010-04-22 15:55                 ` [PATCH 9/9] OMAP:GPIO: Implement GPIO as a platform device Charulatha V
2010-05-01  0:04                   ` Kevin Hilman
2010-05-04 15:59                     ` Varadarajan, Charulatha
2010-05-05 20:59                       ` Kevin Hilman
2010-05-05 22:37                         ` Tony Lindgren
2010-05-07  6:52                         ` Varadarajan, Charulatha
2010-05-12 12:29                         ` Varadarajan, Charulatha
2010-05-12 14:47                           ` Kevin Hilman
2010-05-20 10:13             ` [PATCH 6/9] OMAP:GPIO:hwmod: add GPIO hwmods for OMAP3 Benoit Cousson
2010-05-20 10:16               ` Varadarajan, Charulatha
2010-04-30 23:03           ` [PATCH 5/9] OMAP:GPIO: Introduce support for OMAP2PLUS chip specific GPIO Kevin Hilman
2010-05-04 15:59             ` Varadarajan, Charulatha
2010-05-11 14:43               ` Varadarajan, Charulatha
2010-05-11 15:25                 ` Kevin Hilman
2010-05-05 22:31           ` Tony Lindgren
2010-05-07  6:52             ` Varadarajan, Charulatha
2010-05-12 12:29             ` Varadarajan, Charulatha
2010-05-12 14:49               ` Kevin Hilman [this message]
2010-05-07  6:57 ` [PATCH 00/09] OMAP:GPIO:Implement GPIO in HWMOD way Varadarajan, Charulatha
2010-05-07 15:32   ` Tony Lindgren
2010-05-10 15:14     ` Kevin Hilman
2010-05-10 22:22       ` Tony Lindgren
2010-05-11 15:21         ` Kevin Hilman
2010-05-11 15:54           ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ljbpqioa.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=charu@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=rnayak@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.