From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] MXC IOMUX-V3 replace struct pad_desc with bitmapped cookie (step 2)
Date: Wed, 24 Nov 2010 11:59:03 +0100 [thread overview]
Message-ID: <20101124105903.GK6017@pengutronix.de> (raw)
In-Reply-To: <19690.11351.308680.365060@ipc1.ka-ro>
Hi Lothar,
On Mon, Nov 22, 2010 at 09:39:51AM +0100, Lothar Wa?mann wrote:
> This patch actually replaces the 'struct pad_desc' with a u64 cookie
> to facilitate adding platform specific pad_ctrl settings to an
> existing pad definition.
>
> So, instead of:
> iomux_v3_cfg_t power_key = MX51_PAD_EIM_A27__GPIO_2_21;
> power_key.pad_ctrl = MX51_GPIO_PAD_CTRL_2;
> mxc_iomux_v3_setup_pad(&power_key);
> one can write:
> mxc_iomux_v3_setup_pad((MX51_PAD_EIM_A27__GPIO_2_21 & ~MUX_PAD_CTRL_MASK) | MX51_GPIO_PAD_CTRL_2);
>
> Patch applies to branch 'imx-for-2.6.38' of git://git.pengutronix.de/git/imx/linux-2.6
>
> Signed-Off-By: Lothar Wa?mann <LW@KARO-electronics.de>
> ---
> mach-mx3/mach-pcm043.c | 14 +++---
> mach-mx5/board-mx51_babbage.c | 11 ++---
> plat-mxc/include/mach/iomux-v3.h | 84 ++++++++++++++++++++++-----------------
> plat-mxc/iomux-v3.c | 4 -
> 4 files changed, 63 insertions(+), 50 deletions(-)
>
> diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
> index 66b07d8..35b8f61 100644
> --- a/arch/arm/mach-mx5/board-mx51_babbage.c
> +++ b/arch/arm/mach-mx5/board-mx51_babbage.c
> @@ -348,7 +348,8 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
> static void __init mxc_board_init(void)
> {
> iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
> - iomux_v3_cfg_t power_key = MX51_PAD_EIM_A27__GPIO_2_21;
> + iomux_v3_cfg_t power_key = (MX51_PAD_EIM_A27__GPIO_2_21 &
> + ~MUX_PAD_CTRL_MASK) | MX51_GPIO_PAD_CTRL_2;
>
This does not work. MX51_GPIO_PAD_CTRL_2 is defined as:
#define MX51_GPIO_PAD_CTRL_2 (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \
PAD_CTL_PUS_100K_UP)
It has to be shifted to the correct location in the bit field. The
following fixes this, but it does not look particularly nice:
+ iomux_v3_cfg_t power_key = (MX51_PAD_EIM_A27__GPIO_2_21 &
+ ~MUX_PAD_CTRL_MASK) | ((iomux_v3_cfg_t)(MX51_GPIO_PAD_CTRL_2) << MUX_PAD_CTRL_SHIFT);
How do we proceed from here?
Some
#define MUX_PAD_CTRL(mode) ((iomux_v3_cfg_t)(mode) << MUX_PAD_CTRL_SHIFT)
Macro would be nice. Unfortunately the name is already used for a
function doing the opposite.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2010-11-24 10:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-22 16:56 [PATCHv5 1/3] ARM: mx5: Add gpio-keys to mx51 babbage board Dinh.Nguyen at freescale.com
2010-10-22 16:56 ` [PATCHv5 2/3] ARM: imx: Add gpio-keys to plat-mxc Dinh.Nguyen at freescale.com
2010-10-22 16:56 ` [PATCHv5 3/3] ARM: imx: Add wake functionality to GPIO Dinh.Nguyen at freescale.com
2010-10-22 18:28 ` [PATCHv5 2/3] ARM: imx: Add gpio-keys to plat-mxc Uwe Kleine-König
2010-10-22 18:58 ` Nguyen Dinh-R00091
2010-10-22 19:42 ` Uwe Kleine-König
2010-10-23 2:43 ` Nguyen Dinh-R00091
2010-10-24 8:37 ` Lothar Waßmann
2010-10-24 19:20 ` Uwe Kleine-König
2010-10-25 7:02 ` Lothar Waßmann
2010-10-25 7:21 ` Uwe Kleine-König
2010-10-26 9:07 ` [PATCH RFC] MXC IOMUX-V3 replace struct pad_desc with bitmapped cookie Lothar Wa�mann
2010-10-26 9:07 ` Lothar Wa�mann
2010-10-26 9:23 ` Uwe Kleine-König
2010-10-26 12:28 ` Lothar Waßmann
2010-10-26 14:16 ` Sascha Hauer
2010-11-22 8:39 ` [PATCH] MXC IOMUX-V3 replace struct pad_desc with bitmapped cookie (step 2) Lothar Waßmann
2010-11-22 9:16 ` Uwe Kleine-König
2010-11-24 10:59 ` Sascha Hauer [this message]
2010-10-22 17:51 ` [PATCHv5 1/3] ARM: mx5: Add gpio-keys to mx51 babbage board Amit Kucheria
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=20101124105903.GK6017@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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).