From: "Varadarajan, Charulatha" <charu@ti.com>
To: Kevin Hilman <khilman@ti.com>
Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>,
linux-omap@vger.kernel.org, santosh.shilimkar@ti.com,
tony@atomide.com, linux-arm-kernel@lists.infradead.org, "Cousson,
Benoit" <b-cousson@ti.com>, Paul Walmsley <paul@pwsan.com>
Subject: Re: [PATCH 02/15] OMAP2PLUS: GPIO: Fix non-wakeup GPIO and rev_ids
Date: Thu, 26 May 2011 15:08:06 +0530 [thread overview]
Message-ID: <BANLkTik2=da94cZh23gwx1hzZQK6H_hy2Q@mail.gmail.com> (raw)
In-Reply-To: <87sjs2sbvy.fsf@ti.com>
On Thu, May 26, 2011 at 03:04, Kevin Hilman <khilman@ti.com> wrote:
> Tarun Kanti DebBarma <tarun.kanti@ti.com> writes:
>
>> From: Charulatha V <charu@ti.com>
>>
>> Non-wakeup GPIOs are available only in OMAP2420 and OMAP3430. But
>> the GPIO driver initializes the non-wakeup GPIO bits for OMAP24xx
>> (bothe OMAP 2420 and 2430) & not for OMAP3 which is incorrect.
>
> Can you cite the documentation you're using for the OMAP3 non-wakeup
> GPIOs?
I am referring to Table 25-5. GPIO Channel Description at page no 3354
OMAP3430 public TRM Version P.
>
> This is a change of functionality from current code, where all OMAP3
> GPIOs are considered wakeup capable.
>
> I'd like this to be tackled in two patches. One for the
> cleanup/consolidation, and one for change in behavior.
Okay.
>
> For this cleanup/consolidation (this series), please keep existing
> functionality and focus on the cleanup. Then, in an additional patch
> (on top of the cleanup/conslidation), change the functionality with a
> detailed changelog.
Okay.
>
> Thanks,
>
> Kevin
>
>> Fix the above by providing non-wakeup GPIO information through pdata
>> specific to the SoC.
>>
>> The GPIO rev id provided in the hwmod database is the same for OMAP2420
>> and OMAP2430. Change the GPIO rev ids in hwmod database as given below
>> so that it can be used to identify OMAP2420 and OMAP2430.
>> OMAP2420 - 0
>> OMAP2430 - 1
>> OMAP3 - 2
>> OMAP4 - 3
>>
>> Signed-off-by: Charulatha V <charu@ti.com>
>> Cc: Cousson, Benoit <b-cousson@ti.com>
>> Cc: Paul Walmsley <paul@pwsan.com>
>> ---
>> arch/arm/mach-omap2/gpio.c | 26 ++++++++++++++++++++++++--
>> arch/arm/mach-omap2/omap_hwmod_2430_data.c | 2 +-
>> arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 2 +-
>> arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 2 +-
>> arch/arm/plat-omap/include/plat/gpio.h | 1 +
>> drivers/gpio/gpio_omap.c | 11 +++--------
>> 6 files changed, 31 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
>> index 0446bd1..6cd26b4 100644
>> --- a/arch/arm/mach-omap2/gpio.c
>> +++ b/arch/arm/mach-omap2/gpio.c
>> @@ -56,6 +56,28 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
>> return -ENOMEM;
>> }
>>
>> + switch (oh->class->rev) {
>> + case 0:
>> + if (id == 1)
>> + /* non-wakeup GPIO pins for OMAP2420 Bank1 */
>> + pdata->non_wakeup_gpios = 0xe203ffc0;
>> + else if (id == 2)
>> + /* non-wakeup GPIO pins for OMAP2420 Bank2 */
>> + pdata->non_wakeup_gpios = 0x08700040;
>> + break;
>> + case 2:
>> + if (id == 2)
>> + /* non-wakeup GPIO pins for OMAP3 Bank2 */
>> + pdata->non_wakeup_gpios = 0x00000001;
>> + else if (id == 6)
>> + /* non-wakeup GPIO pins for OMAP3 Bank6 */
>> + pdata->non_wakeup_gpios = 0x08000000;
>> + break;
>> + default:
>> + /* No non-wakeup GPIO pins for other SoCs */
>> + break;
>> + }
>> +
>> dev_attr = (struct omap_gpio_dev_attr *)oh->dev_attr;
>> pdata->bank_width = dev_attr->bank_width;
>> pdata->dbck_flag = dev_attr->dbck_flag;
>> @@ -70,6 +92,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
>> switch (oh->class->rev) {
>> case 0:
>> case 1:
>> + case 2:
>> pdata->bank_type = METHOD_GPIO_24XX;
>> pdata->regs->revision = OMAP24XX_GPIO_REVISION;
>> pdata->regs->direction = OMAP24XX_GPIO_OE;
>> @@ -86,7 +109,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
>> pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN;
>> pdata->regs->ctrl = OMAP24XX_GPIO_CTRL;
>> break;
>> - case 2:
>> + case 3:
>> pdata->bank_type = METHOD_GPIO_44XX;
>> pdata->regs->revision = OMAP4_GPIO_REVISION;
>> pdata->regs->direction = OMAP4_GPIO_OE;
>> @@ -108,7 +131,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
>> kfree(pdata);
>> return -EINVAL;
>> }
>> -
>> od = omap_device_build(name, id - 1, oh, pdata,
>> sizeof(*pdata), omap_gpio_latency,
>> ARRAY_SIZE(omap_gpio_latency),
>> diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
>> index 9682dd5..ae702b5 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
>> @@ -1728,7 +1728,7 @@ static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = {
>> static struct omap_hwmod_class omap243x_gpio_hwmod_class = {
>> .name = "gpio",
>> .sysc = &omap243x_gpio_sysc,
>> - .rev = 0,
>> + .rev = 1,
>> };
>>
>> /* gpio1 */
>> diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
>> index 909a84d..05e7005 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
>> @@ -2117,7 +2117,7 @@ static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
>> static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = {
>> .name = "gpio",
>> .sysc = &omap3xxx_gpio_sysc,
>> - .rev = 1,
>> + .rev = 2,
>> };
>>
>> /* gpio_dev_attr*/
>> diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
>> index abc548a..ea30752 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
>> @@ -1703,7 +1703,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = {
>> static struct omap_hwmod_class omap44xx_gpio_hwmod_class = {
>> .name = "gpio",
>> .sysc = &omap44xx_gpio_sysc,
>> - .rev = 2,
>> + .rev = 3,
>> };
>>
>> /* gpio dev_attr */
>> diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
>> index caf432c..8014a8a 100644
>> --- a/arch/arm/plat-omap/include/plat/gpio.h
>> +++ b/arch/arm/plat-omap/include/plat/gpio.h
>> @@ -199,6 +199,7 @@ struct omap_gpio_platform_data {
>> int bank_width; /* GPIO bank width */
>> int bank_stride; /* Only needed for omap1 MPUIO */
>> bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
>> + u32 non_wakeup_gpios;
>>
>> struct omap_gpio_reg_offs *regs;
>> };
>> diff --git a/drivers/gpio/gpio_omap.c b/drivers/gpio/gpio_omap.c
>> index dfdc45e..0ba4cdb 100644
>> --- a/drivers/gpio/gpio_omap.c
>> +++ b/drivers/gpio/gpio_omap.c
>> @@ -1008,7 +1008,7 @@ static inline int init_gpio_info(struct platform_device *pdev)
>> }
>>
>> /* TODO: Cleanup cpu_is_* checks */
>> -static void omap_gpio_mod_init(struct gpio_bank *bank, int id)
>> +static void omap_gpio_mod_init(struct gpio_bank *bank)
>> {
>> if (cpu_class_is_omap2()) {
>> if (cpu_is_omap44xx()) {
>> @@ -1028,12 +1028,6 @@ static void omap_gpio_mod_init(struct gpio_bank *bank, int id)
>>
>> /* Initialize interface clk ungated, module enabled */
>> __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
>> - } else if (cpu_is_omap24xx()) {
>> - static const u32 non_wakeup_gpios[] = {
>> - 0xe203ffc0, 0x08700040
>> - };
>> - if (id < ARRAY_SIZE(non_wakeup_gpios))
>> - bank->non_wakeup_gpios = non_wakeup_gpios[id];
>> }
>> } else if (cpu_class_is_omap1()) {
>> if (bank_is_mpuio(bank))
>> @@ -1179,6 +1173,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
>> bank->dbck_flag = pdata->dbck_flag;
>> bank->stride = pdata->bank_stride;
>> bank->width = pdata->bank_width;
>> + bank->non_wakeup_gpios = pdata->non_wakeup_gpios;
>>
>> bank->regs = pdata->regs;
>>
>> @@ -1205,7 +1200,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
>> pm_runtime_enable(bank->dev);
>> pm_runtime_get_sync(bank->dev);
>>
>> - omap_gpio_mod_init(bank, id);
>> + omap_gpio_mod_init(bank);
>> omap_gpio_chip_init(bank);
>> omap_gpio_show_rev(bank);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-05-26 9:38 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 14:24 [PATCH 00/15] OMAP: GPIO: Cleanup OMAP GPIO driver Tarun Kanti DebBarma
2011-05-24 14:24 ` [PATCH 01/15] OMAP: GPIO: Avoid cpu_is checks during module ena/disable Tarun Kanti DebBarma
2011-05-25 21:19 ` Kevin Hilman
2011-05-26 9:38 ` Varadarajan, Charulatha
2011-05-24 14:24 ` [PATCH 02/15] OMAP2PLUS: GPIO: Fix non-wakeup GPIO and rev_ids Tarun Kanti DebBarma
2011-05-25 21:34 ` Kevin Hilman
2011-05-26 9:38 ` Varadarajan, Charulatha [this message]
2011-05-26 17:15 ` Kevin Hilman
2011-05-26 17:39 ` Varadarajan, Charulatha
2011-05-26 18:32 ` Kevin Hilman
2011-05-26 9:23 ` Premi, Sanjeev
2011-05-26 9:43 ` Varadarajan, Charulatha
2011-05-26 10:11 ` Cousson, Benoit
2011-05-26 11:47 ` Premi, Sanjeev
2011-05-26 12:11 ` Cousson, Benoit
2011-05-26 12:38 ` Premi, Sanjeev
2011-05-26 12:46 ` Cousson, Benoit
2011-05-26 13:19 ` Premi, Sanjeev
2011-05-26 13:38 ` B.J. Buchalter
2011-05-26 14:12 ` Cousson, Benoit
2011-05-24 14:24 ` [PATCH 03/15] OMAP: GPIO: Remove dependency on gpio_bank_count Tarun Kanti DebBarma
2011-05-24 14:24 ` [PATCH 04/15] OMAP2PLUS: GPIO: Use flag to identify wkup dmn GPIO Tarun Kanti DebBarma
2011-05-25 21:40 ` Kevin Hilman
2011-05-24 14:24 ` [PATCH 05/15] OMAP: GPIO: Make gpio_context part of gpio_bank structure Tarun Kanti DebBarma
2011-05-25 21:41 ` Kevin Hilman
2011-05-26 9:58 ` Premi, Sanjeev
2011-05-26 10:07 ` Varadarajan, Charulatha
2011-05-26 9:59 ` Premi, Sanjeev
2011-05-24 14:24 ` [PATCH 06/15] OMAP4: GPIO: Save/restore context Tarun Kanti DebBarma
2011-05-25 21:43 ` Kevin Hilman
2011-05-26 9:37 ` Varadarajan, Charulatha
2011-05-24 14:24 ` [PATCH 07/15] OMAP: GPIO: handle save/restore ctx in GPIO driver Tarun Kanti DebBarma
2011-05-25 22:33 ` Kevin Hilman
2011-05-25 22:36 ` Kevin Hilman
2011-05-24 14:24 ` [PATCH 08/15] OMAP2+: GPIO: make workaround_enabled bank specific Tarun Kanti DebBarma
2011-05-25 22:39 ` Kevin Hilman
2011-05-26 9:37 ` Varadarajan, Charulatha
2011-05-24 14:24 ` [PATCH 09/15] OMAP: GPIO: cleanup suspend and resume functions Tarun Kanti DebBarma
2011-05-25 22:57 ` Kevin Hilman
2011-05-26 10:02 ` Varadarajan, Charulatha
2011-05-24 14:24 ` [PATCH 10/15] OMAP: GPIO: cleanup prepare/resume idle functions Tarun Kanti DebBarma
2011-05-25 23:00 ` Kevin Hilman
2011-05-24 14:24 ` [PATCH 11/15] OMAP: GPIO: Remove hardcoded offsets in ctxt save/restore Tarun Kanti DebBarma
2011-05-25 23:01 ` Kevin Hilman
2011-05-26 9:36 ` Varadarajan, Charulatha
2011-05-26 9:42 ` Premi, Sanjeev
2011-05-26 9:48 ` Varadarajan, Charulatha
2011-05-24 14:24 ` [PATCH 12/15] OMAP: GPIO: Fix: use wake set/clear regs Tarun Kanti DebBarma
2011-05-25 23:14 ` Kevin Hilman
2011-05-26 9:36 ` Varadarajan, Charulatha
2011-05-24 14:24 ` [PATCH 13/15] OMAP: GPIO: clean set_gpio_triggering function Tarun Kanti DebBarma
2011-05-25 23:27 ` Kevin Hilman
2011-05-26 9:55 ` Varadarajan, Charulatha
2011-05-24 14:24 ` [PATCH 14/15] OMAP: GPIO: Use memset for omap_gpio_reg_offs Tarun Kanti DebBarma
2011-05-25 23:30 ` Kevin Hilman
2011-05-24 14:24 ` [PATCH 15/15] OMAP: GPIO: clean omap_gpio_mod_init function Tarun Kanti DebBarma
2011-05-25 23:48 ` Kevin Hilman
2011-06-03 11:20 ` Varadarajan, Charulatha
2011-06-03 14:31 ` Kevin Hilman
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='BANLkTik2=da94cZh23gwx1hzZQK6H_hy2Q@mail.gmail.com' \
--to=charu@ti.com \
--cc=b-cousson@ti.com \
--cc=khilman@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=santosh.shilimkar@ti.com \
--cc=tarun.kanti@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).