Re: [PATCH 3/7] pinctrl: imx1 core driver

Alexander Shiyan shc_work at mail.ru
Fri Aug 2 06:51:24 EDT 2013


> Signed-off-by: Markus Pargmann <mpa at pengutronix.de>
> ---
[...]
> +++ b/drivers/pinctrl/pinctrl-imx1-core.c
> @@ -0,0 +1,667 @@
> +/*
> + * Core driver for the imx pin controller in imx1/21/27
[...]
> +static void imx1_write_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id,
> +		u32 value, u32 reg_offset)
> +{
> +	void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset;
> +	int shift = (pin_id % 16) * 2;
> +	int mask = ~(0x3 << shift);

0x3.

> +	u32 old_value;
> +
> +	dev_dbg(ipctl->dev, "write: register 0x%p shift %d value 0x%x\n",
> +			reg, shift, value);
> +
> +	if (pin_id % 32 >= 16)
> +		reg += 0x04;
> +
> +	value = (value & 0x11) << shift;

0x11. Is this correct?

[...]

---


More information about the linux-arm-kernel mailing list