From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 02/13] omap4: Add support for i2c init
Date: Tue, 18 May 2010 17:16:12 -0700 [thread overview]
Message-ID: <20100519001612.GZ5818@atomide.com> (raw)
In-Reply-To: <20100518024246.21705.71913.stgit@baageli.muru.com>
[-- Attachment #1: Type: text/plain, Size: 162 bytes --]
* Tony Lindgren <tony@atomide.com> [100517 19:37]:
> Add support for i2c init for omap4.
Below is this one rebased to apply on current for-next.
Regards,
Tony
[-- Attachment #2: omap-i2c-omap4.patch --]
[-- Type: text/x-diff, Size: 2900 bytes --]
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 18 May 2010 16:19:16 -0700
Subject: [PATCH] omap4: Add support for i2c init
Add support for i2c init for omap4.
This patch is based on and earlier patch by
Santosh Shilimkar <santosh.shilimkar@ti.com>.
Signed-off-by: Tony Lindgren <tony@atomide.com>
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 78d1cea..eec2b49 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -38,6 +38,7 @@
#define OMAP2_I2C_BASE1 0x48070000
#define OMAP2_I2C_BASE2 0x48072000
#define OMAP2_I2C_BASE3 0x48060000
+#define OMAP4_I2C_BASE4 0x48350000
static const char name[] = "i2c_omap";
@@ -54,11 +55,14 @@ static const char name[] = "i2c_omap";
static struct resource i2c_resources[][2] = {
{ I2C_RESOURCE_BUILDER(0, 0) },
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
- { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE2, INT_24XX_I2C2_IRQ) },
+#if defined(CONFIG_ARCH_OMAP2PLUS)
+ { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE2, 0) },
#endif
-#if defined(CONFIG_ARCH_OMAP3)
- { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE3, INT_34XX_I2C3_IRQ) },
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
+ { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE3, 0) },
+#endif
+#if defined(CONFIG_ARCH_OMAP4)
+ { I2C_RESOURCE_BUILDER(OMAP4_I2C_BASE4, 0) },
#endif
};
@@ -76,12 +80,15 @@ static struct resource i2c_resources[][2] = {
static struct omap_i2c_bus_platform_data i2c_pdata[ARRAY_SIZE(i2c_resources)];
static struct platform_device omap_i2c_devices[] = {
I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]),
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+#if defined(CONFIG_ARCH_OMAP2PLUS)
I2C_DEV_BUILDER(2, i2c_resources[1], &i2c_pdata[1]),
#endif
-#if defined(CONFIG_ARCH_OMAP3)
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
I2C_DEV_BUILDER(3, i2c_resources[2], &i2c_pdata[2]),
#endif
+#if defined(CONFIG_ARCH_OMAP4)
+ I2C_DEV_BUILDER(4, i2c_resources[3], &i2c_pdata[3]),
+#endif
};
#define OMAP_I2C_CMDLINE_SETUP (BIT(31))
@@ -96,6 +103,8 @@ static int __init omap_i2c_nr_ports(void)
ports = 2;
else if (cpu_is_omap34xx())
ports = 3;
+ else if (cpu_is_omap44xx())
+ ports = 4;
return ports;
}
@@ -107,6 +116,13 @@ static resource_size_t omap2_i2c_irq[3] __initdata = {
INT_34XX_I2C3_IRQ,
};
+static resource_size_t omap4_i2c_irq[4] __initdata = {
+ OMAP44XX_IRQ_I2C1,
+ OMAP44XX_IRQ_I2C2,
+ OMAP44XX_IRQ_I2C3,
+ OMAP44XX_IRQ_I2C4,
+};
+
static inline int omap1_i2c_add_bus(struct platform_device *pdev, int bus_id)
{
struct omap_i2c_bus_platform_data *pd;
@@ -129,7 +145,10 @@ static inline int omap2_i2c_add_bus(struct platform_device *pdev, int bus_id)
res = pdev->resource;
- irq = omap2_i2c_irq;
+ if (!cpu_is_omap44xx())
+ irq = omap2_i2c_irq;
+ else
+ irq = omap4_i2c_irq;
if (bus_id == 1) {
res[0].start = OMAP2_I2C_BASE1;
next prev parent reply other threads:[~2010-05-19 0:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-18 2:42 [PATCH 00/13] More omap platform init code for 2.6.35 merge window Tony Lindgren
2010-05-18 2:42 ` [PATCH 01/13] omap: Fix i2c platform init code for omap4 Tony Lindgren
2010-05-19 0:15 ` Tony Lindgren
2010-05-18 2:42 ` [PATCH 02/13] omap4: Add support for i2c init Tony Lindgren
2010-05-19 0:16 ` Tony Lindgren [this message]
2010-05-18 2:42 ` [PATCH 03/13] omap4: Add i2c board support on omap4430 sdp platform Tony Lindgren
2010-05-18 2:42 ` [PATCH 04/13] omap4: add i2c1 peripherals data Tony Lindgren
2010-05-18 2:42 ` [PATCH 05/13] omap4: Enable RTC and regulator support Tony Lindgren
2010-05-18 2:42 ` [PATCH 06/13] omap4: Adds Dummy Interface clock's for MMC controllers Tony Lindgren
2010-05-18 2:43 ` [PATCH 07/13] omap4: Adding hsmmc support to board file Tony Lindgren
2010-05-18 2:43 ` [PATCH 08/13] omap4: Adding PBIAS Configuration for MMC1 Controller Tony Lindgren
2010-05-18 2:43 ` [PATCH 09/13] omap4: Enable HSMMC support Tony Lindgren
2010-05-18 2:43 ` [PATCH 10/13] omap3: Add support for OMAP3Stalker boards Tony Lindgren
2010-05-18 2:43 ` [PATCH 11/13] omap3: Add OMAP3 Stalker board LK-S defconfig Tony Lindgren
2010-05-18 2:43 ` [PATCH 12/13] omap3: update omap3_defconfig Tony Lindgren
2010-05-18 2:43 ` [PATCH 13/13] omap3: Add stalker board to omap3_defconfig Tony Lindgren
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=20100519001612.GZ5818@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
--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 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).