* [PATCH] omap2+: mux: Remove the use of IDLE flag.
@ 2011-03-07 4:35 sricharan
2011-03-08 16:40 ` Tony Lindgren
0 siblings, 1 reply; 8+ messages in thread
From: sricharan @ 2011-03-07 4:35 UTC (permalink / raw)
To: linux-omap; +Cc: tony, b-cousson, santosh.shilimkar, paul
Currently OMAP_DEVICE_PAD_IDLE flag is used to mux pins
dynamically. This can be simplified by using the enabled
state variable of each pad. This also fixes the issue of
the static pads not getting muxed after idling and
disable/enable state transitions.
Signed-off-by: sricharan <r.sricharan@ti.com>
---
arch/arm/mach-omap2/mux.c | 19 +++++++------------
arch/arm/mach-omap2/mux.h | 1 -
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 8717370..bb043cb 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -359,7 +359,6 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
struct omap_device_pad *pad = hmux->pads_dynamic[i];
int val = -EINVAL;
- pad->flags |= OMAP_DEVICE_PAD_IDLE;
val = pad->idle;
omap_mux_write(pad->partition, val,
pad->mux->reg_offset);
@@ -369,25 +368,18 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
}
/* Runtime enabling of dynamic pads */
- if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic) {
- int idled = 0;
-
+ if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic
+ && hmux->enabled) {
for (i = 0; i < hmux->nr_pads_dynamic; i++) {
struct omap_device_pad *pad = hmux->pads_dynamic[i];
int val = -EINVAL;
- if (!(pad->flags & OMAP_DEVICE_PAD_IDLE))
- continue;
-
- pad->flags &= ~OMAP_DEVICE_PAD_IDLE;
val = pad->enable;
omap_mux_write(pad->partition, val,
pad->mux->reg_offset);
- idled++;
}
- if (idled)
- return;
+ return;
}
/* Enabling or disabling of all pads */
@@ -404,7 +396,6 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
pad->name, val);
break;
case _HWMOD_STATE_DISABLED:
- default:
/* Use safe mode unless OMAP_DEVICE_PAD_REMUX */
if (flags & OMAP_DEVICE_PAD_REMUX)
val = pad->off;
@@ -412,6 +403,10 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
val = OMAP_MUX_MODE7;
pr_debug("%s: Disabling %s %x\n", __func__,
pad->name, val);
+ break;
+ default:
+ /* Nothing to be done */
+ break;
};
if (val >= 0) {
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 1d5bf42..8920fa4 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -159,7 +159,6 @@ struct omap_board_mux {
u16 value;
};
-#define OMAP_DEVICE_PAD_IDLE BIT(7) /* Not needed for board-*.c */
#define OMAP_DEVICE_PAD_REMUX BIT(1) /* Dynamically remux a pad,
needs enable, idle and off
values */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] omap2+: mux: Remove the use of IDLE flag.
2011-03-07 4:35 [PATCH] omap2+: mux: Remove the use of IDLE flag sricharan
@ 2011-03-08 16:40 ` Tony Lindgren
2011-03-09 7:49 ` Sricharan R
2011-03-09 11:49 ` Sricharan R
0 siblings, 2 replies; 8+ messages in thread
From: Tony Lindgren @ 2011-03-08 16:40 UTC (permalink / raw)
To: sricharan; +Cc: linux-omap, b-cousson, santosh.shilimkar, paul
* sricharan <r.sricharan@ti.com> [110306 20:33]:
> Currently OMAP_DEVICE_PAD_IDLE flag is used to mux pins
> dynamically. This can be simplified by using the enabled
> state variable of each pad. This also fixes the issue of
> the static pads not getting muxed after idling and
> disable/enable state transitions.
Looks good, can you please repost one more time with linux-arm-kernel
mailing list also Cc'd?
Thanks,
Tony
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] omap2+: mux: Remove the use of IDLE flag.
2011-03-08 16:40 ` Tony Lindgren
@ 2011-03-09 7:49 ` Sricharan R
2011-03-09 11:49 ` Sricharan R
1 sibling, 0 replies; 8+ messages in thread
From: Sricharan R @ 2011-03-09 7:49 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, Benoit Cousson, Santosh Shilimkar, paul,
linux-arm-kernel
Tony,
>-----Original Message-----
>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>owner@vger.kernel.org] On Behalf Of Tony Lindgren
>Sent: Tuesday, March 08, 2011 10:11 PM
>To: sricharan
>Cc: linux-omap@vger.kernel.org; b-cousson@ti.com;
santosh.shilimkar@ti.com;
>paul@pswan.com
>Subject: Re: [PATCH] omap2+: mux: Remove the use of IDLE flag.
>
>* sricharan <r.sricharan@ti.com> [110306 20:33]:
>> Currently OMAP_DEVICE_PAD_IDLE flag is used to mux pins
>> dynamically. This can be simplified by using the enabled
>> state variable of each pad. This also fixes the issue of
>> the static pads not getting muxed after idling and
>> disable/enable state transitions.
>
>Looks good, can you please repost one more time with linux-arm-kernel
>mailing list also Cc'd?
>
Ok sure. I have re posted this to the linux-arm-kernel list.
>Thanks,
>
>Tony
>--
>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
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] omap2+: mux: Remove the use of IDLE flag.
2011-03-08 16:40 ` Tony Lindgren
2011-03-09 7:49 ` Sricharan R
@ 2011-03-09 11:49 ` Sricharan R
2011-03-09 20:32 ` [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag) Tony Lindgren
1 sibling, 1 reply; 8+ messages in thread
From: Sricharan R @ 2011-03-09 11:49 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, Benoit Cousson, Santosh Shilimkar, paul,
linux-arm-kernel
Tony,
>-----Original Message-----
>From: Sricharan R [mailto:r.sricharan@ti.com]
>Sent: Wednesday, March 09, 2011 1:19 PM
>To: 'Tony Lindgren'
>Cc: 'linux-omap@vger.kernel.org'; Benoit Cousson; Santosh Shilimkar;
>'paul@pswan.com'; 'linux-arm-kernel@lists.infradead.org'
>Subject: RE: [PATCH] omap2+: mux: Remove the use of IDLE flag.
>
[....]
>>* sricharan <r.sricharan@ti.com> [110306 20:33]:
>>> Currently OMAP_DEVICE_PAD_IDLE flag is used to mux pins
>>> dynamically. This can be simplified by using the enabled
>>> state variable of each pad. This also fixes the issue of
>>> the static pads not getting muxed after idling and
>>> disable/enable state transitions.
>>
>>Looks good, can you please repost one more time with linux-arm-kernel
>>mailing list also Cc'd?
>>
>Ok sure. I have re posted this to the linux-arm-kernel list.
Btw,I have fixed the comments on the below patches that
I sent for configuring the serial pads.
4430sdp:
http://marc.info/?l=linux-omap&m=129900334420003&w=2
omap4panda:
http://marc.info/?l=linux-omap&m=129900338520082&w=2
3430sdp:
http://marc.info/?l=linux-omap&m=129619117726479&w=2
Can you please check if they are ok?
Thanks,
Sricharan
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag)
2011-03-09 11:49 ` Sricharan R
@ 2011-03-09 20:32 ` Tony Lindgren
2011-03-10 4:26 ` Sricharan R
2011-03-11 6:13 ` Sricharan R
0 siblings, 2 replies; 8+ messages in thread
From: Tony Lindgren @ 2011-03-09 20:32 UTC (permalink / raw)
To: Sricharan R
Cc: linux-omap, Benoit Cousson, Santosh Shilimkar, paul,
linux-arm-kernel
* Sricharan R <r.sricharan@ti.com> [110309 03:47]:
>
> Btw,I have fixed the comments on the below patches that
> I sent for configuring the serial pads.
>
> 4430sdp:
> http://marc.info/?l=linux-omap&m=129900334420003&w=2
>
> omap4panda:
> http://marc.info/?l=linux-omap&m=129900338520082&w=2
>
> 3430sdp:
> http://marc.info/?l=linux-omap&m=129619117726479&w=2
>
> Can you please check if they are ok?
Look OK to me, but let's make things a bit easier to read
and maintain with the following patch. Can you please
update your patches to use this macro?
Each line then just becomes something like:
OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
Regards,
Tony
From: Tony Lindgren <tony@atomide.com>
Date: Wed, 9 Mar 2011 12:14:04 -0800
Subject: [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init
Add macro for defining static pins in the board file.
We can now start implementing pin multiplexing in the platform init
code for devices that call omap_hwmod_mux_init. Currently that is
only implemented for serial.c.
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -186,6 +186,12 @@ struct omap_device_pad {
struct omap_hwmod_mux_info;
+#define OMAP_MUX_STATIC(signal, mode) \
+{ \
+ .name = (signal), \
+ .enable = (mode), \
+}
+
#if defined(CONFIG_OMAP_MUX)
/**
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag)
2011-03-09 20:32 ` [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag) Tony Lindgren
@ 2011-03-10 4:26 ` Sricharan R
2011-03-11 6:13 ` Sricharan R
1 sibling, 0 replies; 8+ messages in thread
From: Sricharan R @ 2011-03-10 4:26 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, Benoit Cousson, Santosh Shilimkar, paul,
linux-arm-kernel
Tony,
>-----Original Message-----
>From: Tony Lindgren [mailto:tony@atomide.com]
>Sent: Thursday, March 10, 2011 2:02 AM
>To: Sricharan R
>Cc: linux-omap@vger.kernel.org; Benoit Cousson; Santosh Shilimkar;
>paul@pswan.com; linux-arm-kernel@lists.infradead.org
>Subject: [PATCH] omap2+: mux: Add macro for configuring static with
>omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE
flag)
>
>* Sricharan R <r.sricharan@ti.com> [110309 03:47]:
>>
>> Btw,I have fixed the comments on the below patches that
>> I sent for configuring the serial pads.
>>
>> 4430sdp:
>> http://marc.info/?l=linux-omap&m=129900334420003&w=2
>>
>> omap4panda:
>> http://marc.info/?l=linux-omap&m=129900338520082&w=2
>>
>> 3430sdp:
>> http://marc.info/?l=linux-omap&m=129619117726479&w=2
>>
>> Can you please check if they are ok?
>
>Look OK to me, but let's make things a bit easier to read
>and maintain with the following patch. Can you please
>update your patches to use this macro?
>
>Each line then just becomes something like:
>
>OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
> OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
>
Ok thanks. I will update and send again.
>Regards,
>
>Tony
>
>
>From: Tony Lindgren <tony@atomide.com>
>Date: Wed, 9 Mar 2011 12:14:04 -0800
>Subject: [PATCH] omap2+: mux: Add macro for configuring static with
>omap_hwmod_mux_init
>
>Add macro for defining static pins in the board file.
>
>We can now start implementing pin multiplexing in the platform init
>code for devices that call omap_hwmod_mux_init. Currently that is
>only implemented for serial.c.
>
>Signed-off-by: Tony Lindgren <tony@atomide.com>
>
>--- a/arch/arm/mach-omap2/mux.h
>+++ b/arch/arm/mach-omap2/mux.h
>@@ -186,6 +186,12 @@ struct omap_device_pad {
>
> struct omap_hwmod_mux_info;
>
>+#define OMAP_MUX_STATIC(signal, mode) \
>+{ \
>+ .name = (signal), \
>+ .enable = (mode), \
>+}
>+
> #if defined(CONFIG_OMAP_MUX)
>
> /**
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag)
2011-03-09 20:32 ` [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag) Tony Lindgren
2011-03-10 4:26 ` Sricharan R
@ 2011-03-11 6:13 ` Sricharan R
2011-03-11 19:35 ` Tony Lindgren
1 sibling, 1 reply; 8+ messages in thread
From: Sricharan R @ 2011-03-11 6:13 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, Benoit Cousson, Santosh Shilimkar, paul,
linux-arm-kernel
Tony,
>>Look OK to me, but let's make things a bit easier to read
>>and maintain with the following patch. Can you please
>>update your patches to use this macro?
>>
>>Each line then just becomes something like:
>>
>>OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
>> OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
>>
>Ok thanks. I will update and send again.
4430SDP:
http://marc.info/?l=linux-omap&m=129982347622340&w=2
omap4panda:
http://marc.info/?l=linux-omap&m=129982347722344&w=2
3430sdp:
http://marc.info/?l=linux-omap&m=129982347822347&w=2
I have reworked the patches using your MACRO.
I have applied on top of the omap-for-linus branch and
tested them on 4430sdp, 3430sdp, omap4panda.
Thanks,
Sricharan'
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag)
2011-03-11 6:13 ` Sricharan R
@ 2011-03-11 19:35 ` Tony Lindgren
0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2011-03-11 19:35 UTC (permalink / raw)
To: Sricharan R
Cc: linux-omap, Benoit Cousson, Santosh Shilimkar, paul,
linux-arm-kernel
* Sricharan R <r.sricharan@ti.com> [110310 22:10]:
> Tony,
> >>Look OK to me, but let's make things a bit easier to read
> >>and maintain with the following patch. Can you please
> >>update your patches to use this macro?
> >>
> >>Each line then just becomes something like:
> >>
> >>OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
> >> OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
> >>
> >Ok thanks. I will update and send again.
>
> 4430SDP:
> http://marc.info/?l=linux-omap&m=129982347622340&w=2
>
> omap4panda:
> http://marc.info/?l=linux-omap&m=129982347722344&w=2
>
> 3430sdp:
> http://marc.info/?l=linux-omap&m=129982347822347&w=2
>
> I have reworked the patches using your MACRO.
>
> I have applied on top of the omap-for-linus branch and
> tested them on 4430sdp, 3430sdp, omap4panda.
OK thanks, applying them.
Tony
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-03-11 19:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-07 4:35 [PATCH] omap2+: mux: Remove the use of IDLE flag sricharan
2011-03-08 16:40 ` Tony Lindgren
2011-03-09 7:49 ` Sricharan R
2011-03-09 11:49 ` Sricharan R
2011-03-09 20:32 ` [PATCH] omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag) Tony Lindgren
2011-03-10 4:26 ` Sricharan R
2011-03-11 6:13 ` Sricharan R
2011-03-11 19:35 ` Tony Lindgren
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).