From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Varadarajan, Charulatha" <charu@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Nayak, Rajendra" <rnayak@ti.com>,
"paul@pwsan.com" <paul@pwsan.com>,
"tony@atomide.com" <tony@atomide.com>
Subject: Re: [PATCH 9/9] OMAP:GPIO: Implement GPIO as a platform device
Date: Wed, 12 May 2010 07:47:52 -0700 [thread overview]
Message-ID: <87pr11qiqv.fsf@deeprootsystems.com> (raw)
In-Reply-To: <EAF47CD23C76F840A9E7FCE10091EFAB02C54EF825@dbde02.ent.ti.com> (Charulatha Varadarajan's message of "Wed\, 12 May 2010 17\:59\:06 +0530")
"Varadarajan, Charulatha" <charu@ti.com> writes:
>>
>> >> -----Original Message-----
>> >> From: Kevin Hilman [mailto:khilman@deeprootsystems.com]
>> >> Sent: Saturday, May 01, 2010 5:34 AM
>> >> To: Varadarajan, Charulatha
>> >> Cc: linux-omap@vger.kernel.org; Nayak, Rajendra; paul@pwsan.com;
>> tony@atomide.com
>> >> Subject: Re: [PATCH 9/9] OMAP:GPIO: Implement GPIO as a platform device
>> >>
> [...]
>> >> >
>> >> > +static int init_gpio_info(void)
>> >> > +{
>> >> > + gpio_bank_bits = 32;
>> >> > +
>> >> > + if (cpu_is_omap15xx()) {
>> >> > + gpio_bank_count = 2;
>> >> > + gpio_bank_bits = 16;
>> >> > + } else if (cpu_is_omap16xx()) {
>> >> > + gpio_bank_count = 5;
>> >> > + gpio_bank_bits = 16;
>> >> > + } else if (cpu_is_omap7xx())
>> >> > + gpio_bank_count = 7;
>> >> > + else 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;
>> >>
>> >> Both the bank count and bank bits could be part of platform_data
>> >> and set in the SoC specific init. This is the GPIO driver part
>> >> and we're trying to make this as SoC independent as possible. Anytime
>> >> you need to add a cpu_is* or #ifdef in this code indicates something
>> >> that should be part of SoC specific init and passed in.
>> >
>> > bank count and bank bits are not specific to each device, but SoC specific.
>> > Hence I did not consider passing it as part of platform_data, because this
>> information would be duplicated across all devices in that SoC.
>> >
>> > It would be good if we have a way to pass the SoC specific data which is
>> > common for all the devices rather than duplicating them by sending them via
>> > platform_data.
>> >
>> > Anyways, I can move it to platform_data if there is no other way.
>>
>> Probably the right place for the SoC specifics is attached to the SoC
>> specific hwmod using the dev_attr pointer. That struct can then
>> be passed in via platform_data.
>>
>> You can see how Thara did this for SmartReflex as an example.
>>
>
> Using dev_attr for OMAP2PLUS is fine. How about OMAP1?
> 1. To be implemented in a uniform way, may I get this info as
> part of platform_data?
> 2. Use dev_attr for OMAP2PLUS and use platform_data for OMAP1?
Not sure I understand the question.
You should be able to use a dev_attr struct in OMAP1 and OMAP2+, as
there is technically nothing hwmod specific in the dev_attr. It
is attached to the hwmod as a 'void *' and should be passed into the driver
as the platform_data.
Kevin
next prev parent reply other threads:[~2010-05-12 14:47 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 [this message]
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
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=87pr11qiqv.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.