linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 08/15] ARM: mxs: Add iomux support
Date: Mon, 20 Dec 2010 10:44:09 +0100	[thread overview]
Message-ID: <20101220094409.GT1940@pengutronix.de> (raw)
In-Reply-To: <1292679575-2635-7-git-send-email-shawn.guo@freescale.com>

Hello Shawn

On Sat, Dec 18, 2010 at 09:39:32PM +0800, Shawn Guo wrote:
> MXS-based SoCs implements iomux functions in block PINCTRL.
> 
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
> [...]
> diff --git a/arch/arm/mach-mxs/iomux.c b/arch/arm/mach-mxs/iomux.c
> new file mode 100644
> index 0000000..8c8cbf2
> --- /dev/null
> +++ b/arch/arm/mach-mxs/iomux.c
> @@ -0,0 +1,101 @@
> +[...]
> +/*
> + * configures a single pad in the iomuxer
> + */
> +int mxs_iomux_setup_pad(iomux_cfg_t pad)
> +{
> +	u32 reg, ofs, bp, bm;
> +	void __iomem *iomux_base = MXS_IO_ADDRESS(MXS_PINCTRL_BASE_ADDR);
> +
> +	/* muxsel */
> +	ofs = 0x100;
> +	ofs += PAD_BANK(pad) * 0x20 + PAD_PIN(pad) / 16 * 0x10;
> +	bp = PAD_PIN(pad) % 16 * 2;
> +	bm = 0x3 << bp;
> +	reg = __raw_readl(iomux_base + ofs);
> +	reg &= ~bm;
> +	reg |= PAD_MUXSEL(pad) << bp;
> +	__raw_writel(reg, iomux_base + ofs);
> +
> +	/* drive */
> +	ofs = cpu_is_mx23() ? 0x200 : 0x300;
> +	ofs += PAD_BANK(pad) * 0x40 + PAD_PIN(pad) / 8 * 0x10;
> +	/* mA */
> +	if (PAD_MA_VALID(pad)) {
> +		bp = PAD_PIN(pad) % 8 * 4;
> +		bm = 0x3 << bp;
> +		reg = __raw_readl(iomux_base + ofs);
> +		reg &= ~bm;
> +		reg |= PAD_MA(pad)  << bp;
s/  / /
This wasn't here before

I'm not sure if this is worth a v8.

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2010-12-20  9:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-18 13:39 [PATCH v7 00/15] ARM: mxs: Add initial support for MX23 and MX28 Shawn Guo
2010-12-18 13:39 ` [PATCH v7 03/15] ARM: mxs: Add reset routines Shawn Guo
2010-12-18 13:39 ` [PATCH v7 04/15] ARM: mxs: Add interrupt support Shawn Guo
2010-12-18 13:39 ` [PATCH v7 05/15] ARM: mxs: Add low-level debug UART support Shawn Guo
2010-12-20 11:50   ` Wolfram Sang
2010-12-20 13:22     ` Shawn Guo
2010-12-20 13:55       ` Wolfram Sang
2010-12-20 14:25         ` Shawn Guo
2010-12-20 14:35           ` Wolfram Sang
2010-12-18 13:39 ` [PATCH v7 06/15] ARM: mxs: Add timer support Shawn Guo
2010-12-18 13:39 ` [PATCH v7 07/15] ARM: mxs: Add gpio support Shawn Guo
2010-12-18 13:39 ` [PATCH v7 08/15] ARM: mxs: Add iomux support Shawn Guo
2010-12-20  9:44   ` Uwe Kleine-König [this message]
2010-12-18 13:39 ` [PATCH v7 09/15] ARM: mxs: Add clock support Shawn Guo
2010-12-18 13:39 ` [PATCH v7 13/15] ARM: mxs: Add initial mx23evk support Shawn Guo
2010-12-20  9:48   ` Uwe Kleine-König
2010-12-20 10:17     ` Shawn Guo
2010-12-18 13:39 ` [PATCH v7 14/15] ARM: mxs: Add initial mx28evk support Shawn Guo

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=20101220094409.GT1940@pengutronix.de \
    --to=u.kleine-koenig@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).