omap2+: mux: Remove the use of IDLE flag.
Subsystems (3)
PATCH 1/1 omap2+: mux: Remove the use of IDLE flag.
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.
--- arch/arm/mach-omap2/mux.c | 19 +++++++------------ arch/arm/mach-omap2/mux.h | 1 - 2 files changed, 7 insertions(+), 13 deletions(-)
arch/arm/mach-omap2/mux.c +7 -12
@@ -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 ) {
arch/arm/mach-omap2/mux.h +0 -1
@@ -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 */
Signature · 1 line
1.7.0.4
Tony Lindgren
maintainerQuoted 5 lines · sricharan
Currently
OMAP_DEVICE_PAD_IDLEflag 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
PATCH 1/1 omap2+: mux: Remove the use of IDLE flag.
Tony,
Quoted 1 line
-----Original Message-----
From: [email protected] [mailto:linux-omap-
Quoted 4 lines
owner at vger.kernel.org] On Behalf Of Tony Lindgren
Sent: Tuesday, March 08, 2011 10:11 PM
To: sricharan
Cc: linux-omap at vger.kernel.org; b-cousson at ti.com;
santosh.shilimkar at ti.com;
Quoted 4 lines
paul at pswan.com
Subject: Re: [PATCH] omap2+: mux: Remove the use of IDLE flag.* sricharan <[email protected]> [110306 20:33]:
Quoted 9 lines
Quoted 5 lines
Currently
OMAP_DEVICE_PAD_IDLEflag 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.
Quoted 7 lines
Thanks,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 omap2+: mux: Remove the use of IDLE flag.
Tony,
Quoted 8 lines
-----Original Message-----
From: Sricharan R [mailto:r.sricharan at ti.com]
Sent: Wednesday, March 09, 2011 1:19 PM
To: 'Tony Lindgren'
Cc: 'linux-omap at vger.kernel.org'; Benoit Cousson; Santosh Shilimkar; 'paul at pswan.com'; 'linux-arm-kernel at lists.infradead.org'
Subject: RE: [PATCH] omap2+: mux: Remove the use of IDLE flag.
[....]
Quoted 11 lines
Quoted 10 lines · sricharan
Quoted 5 lines
Currently
OMAP_DEVICE_PAD_IDLEflag 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
Tony Lindgren
maintainerPATCH 1/1 omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag)
Quoted 7 lines · Sricharan R
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
Quoted 7 lines
omap4panda:
http://marc.info/?l=linux-omap&m=129900338520082&w=23430sdp:
http://marc.info/?l=linux-omap&m=129619117726479&w=2Can 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 <[email protected]>
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.
arch/arm/mach-omap2/mux.h +6 -0
@@ -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 )/**
PATCH 1/1 omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag)
Tony,
Quoted 8 lines
-----Original Message-----
From: Tony Lindgren [mailto:tony at atomide.com]
Sent: Thursday, March 10, 2011 2:02 AM
To: Sricharan R
Cc: linux-omap at vger.kernel.org; Benoit Cousson; Santosh Shilimkar; paul at pswan.com; linux-arm-kernel at lists.infradead.org
Subject: [PATCH] omap2+: mux: Add macro for configuring static withomap_hwmod_mux_init(Re: [PATCH] omap2+: mux: Remove the use of IDLE
flag)
Quoted 17 lines · Sricharan R
Quoted 7 lines
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=2Quoted 7 lines
omap4panda:
http://marc.info/?l=linux-omap&m=129900338520082&w=23430sdp:
http://marc.info/?l=linux-omap&m=129619117726479&w=2Can you please check if they are ok?
Quoted 9 lines
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.
Quoted 33 lines
Regards,
Tony
From: Tony Lindgren <[email protected]>
Date: Wed, 9 Mar 2011 12:14:04 -0800
Subject: [PATCH] omap2+: mux: Add macro for configuring static withomap_hwmod_mux_initAdd 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 forserial.c.Signed-off-by Tony Lindgren <[email protected]>arch/arm/mach-omap2/mux.h +6
-0@@ -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 )/**
PATCH 1/1 omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag)
Tony,
Quoted 10 lines
Quoted 9 lines
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'
Tony Lindgren
maintainerPATCH 1/1 omap2+: mux: Add macro for configuring static with omap_hwmod_mux_init (Re: [PATCH] omap2+: mux: Remove the use of IDLE flag)
Quoted 18 lines · Sricharan R
Tony,
Quoted 10 lines
Quoted 9 lines
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=2omap4panda:
http://marc.info/?l=linux-omap&m=129982347722344&w=2
Quoted 7 lines
3430sdp:
http://marc.info/?l=linux-omap&m=129982347822347&w=2I 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