From: Tony Lindgren <tony@atomide.com>
To: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 2/2] ARM: OMAP: Add OMAP34xx pin multiplexing into I2C bus registration helper
Date: Tue, 10 Jun 2008 14:24:15 -0700 [thread overview]
Message-ID: <20080610212415.GM23796@atomide.com> (raw)
In-Reply-To: <1213076571-21852-1-git-send-email-jarkko.nikula@nokia.com>
* Jarkko Nikula <jarkko.nikula@nokia.com> [080609 22:43]:
> - Simplify function omap_i2c_mux_pins
> - Add OMAP34xx pin multiplexing for busses 1 - 3
Pushing today.
Tony
>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
> ---
> arch/arm/plat-omap/i2c.c | 55 ++++++++++++++++++++++++++++++----------------
> 1 files changed, 36 insertions(+), 19 deletions(-)
>
> diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
> index 7990ab1..eddc24e 100644
> --- a/arch/arm/plat-omap/i2c.c
> +++ b/arch/arm/plat-omap/i2c.c
> @@ -80,26 +80,43 @@ static struct platform_device omap_i2c_devices[] = {
> #endif
> };
>
> -static void __init omap_i2c_mux_pins(int bus_id)
> +#if defined(CONFIG_ARCH_OMAP24XX)
> +static const int omap24xx_pins[][2] = {
> + { M19_24XX_I2C1_SCL, L15_24XX_I2C1_SDA },
> + { J15_24XX_I2C2_SCL, H19_24XX_I2C2_SDA },
> +};
> +#else
> +static const int omap24xx_pins[][2] = {};
> +#endif
> +#if defined(CONFIG_ARCH_OMAP34XX)
> +static const int omap34xx_pins[][2] = {
> + { K21_34XX_I2C1_SCL, J21_34XX_I2C1_SDA},
> + { AF15_34XX_I2C2_SCL, AE15_34XX_I2C2_SDA},
> + { AF14_34XX_I2C3_SCL, AG14_34XX_I2C3_SDA},
> +};
> +#else
> +static const int omap34xx_pins[][2] = {};
> +#endif
> +
> +static void __init omap_i2c_mux_pins(int bus)
> {
> - /* TODO: Muxing for OMAP3 */
> - switch (bus_id) {
> - case 1:
> - if (cpu_class_is_omap1()) {
> - omap_cfg_reg(I2C_SCL);
> - omap_cfg_reg(I2C_SDA);
> - } else if (cpu_is_omap24xx()) {
> - omap_cfg_reg(M19_24XX_I2C1_SCL);
> - omap_cfg_reg(L15_24XX_I2C1_SDA);
> - }
> - break;
> - case 2:
> - if (cpu_is_omap24xx()) {
> - omap_cfg_reg(J15_24XX_I2C2_SCL);
> - omap_cfg_reg(H19_24XX_I2C2_SDA);
> - }
> - break;
> + int scl, sda;
> +
> + if (cpu_class_is_omap1()) {
> + scl = I2C_SCL;
> + sda = I2C_SDA;
> + } else if (cpu_is_omap24xx()) {
> + scl = omap24xx_pins[bus][0];
> + sda = omap24xx_pins[bus][1];
> + } else if (cpu_is_omap34xx()) {
> + scl = omap34xx_pins[bus][0];
> + sda = omap34xx_pins[bus][1];
> + } else {
> + return;
> }
> +
> + omap_cfg_reg(sda);
> + omap_cfg_reg(scl);
> }
>
> int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
> @@ -143,6 +160,6 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
> res[1].start = irq;
> }
>
> - omap_i2c_mux_pins(bus_id);
> + omap_i2c_mux_pins(bus_id - 1);
> return platform_device_register(pdev);
> }
> --
> 1.5.5.3
>
> --
> 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
prev parent reply other threads:[~2008-06-10 21:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-09 14:46 [PATCH 1/2] ARM: OMAP2: Add pin multiplexing configuration for OMAP34xx I2C pins Jarkko Nikula
2008-06-09 14:46 ` [PATCH 2/2] ARM: OMAP: Add OMAP34xx pin muxing into I2C bus registration helper Jarkko Nikula
2008-06-10 5:19 ` Jarkko Nikula
2008-06-10 5:42 ` [PATCH 2/2] ARM: OMAP: Add OMAP34xx pin multiplexing " Jarkko Nikula
2008-06-10 21:24 ` Tony Lindgren [this message]
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=20080610212415.GM23796@atomide.com \
--to=tony@atomide.com \
--cc=jarkko.nikula@nokia.com \
--cc=linux-omap@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.