From: "Daniel Glöckner" <dg@emlix.com>
To: Chris Zankel <chris@zankel.net>, Ben Dooks <ben-linux@fluff.org>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
"Daniel Glöckner" <dg@emlix.com>, "Oskar Schirmer" <os@emlix.com>
Subject: [patch 2/5] xtensa: s6105 specific configuration for the s6000 i2c host
Date: Mon, 23 Mar 2009 16:05:15 +0100 [thread overview]
Message-ID: <1237820718-30607-2-git-send-email-dg@emlix.com> (raw)
In-Reply-To: <1237820718-30607-1-git-send-email-dg@emlix.com>
Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Oskar Schirmer <os@emlix.com>
---
arch/xtensa/platforms/s6105/device.c | 51 ++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/arch/xtensa/platforms/s6105/device.c b/arch/xtensa/platforms/s6105/device.c
index 963634a..00f52ee 100644
--- a/arch/xtensa/platforms/s6105/device.c
+++ b/arch/xtensa/platforms/s6105/device.c
@@ -6,6 +6,8 @@
#include <linux/kernel.h>
#include <linux/gpio.h>
+#include <linux/i2c.h>
+#include <linux/i2c/s6000.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/phy.h>
@@ -21,6 +23,7 @@
#define GPIO3_INTNUM 3
#define UART_INTNUM 4
#define GMAC_INTNUM 5
+#define I2C_INTNUM 6
static const signed char gpio3_irq_mappings[] = {
S6_INTC_GPIO(3),
@@ -41,10 +44,16 @@ static const signed char gmac_irq_mappings[] = {
-1
};
+static const signed char i2c_irq_mappings[] = {
+ S6_INTC_I2C,
+ -1
+};
+
const signed char *platform_irq_mappings[NR_IRQS] = {
[GPIO3_INTNUM] = gpio3_irq_mappings,
[UART_INTNUM] = uart_irq_mappings,
[GMAC_INTNUM] = gmac_irq_mappings,
+ [I2C_INTNUM] = i2c_irq_mappings,
};
static struct plat_serial8250_port serial_platform_data[] = {
@@ -129,6 +138,38 @@ fail:
return PHY_POLL;
}
+#define S6_I2C_BUS_NUM 0
+
+static __devinitdata struct s6_i2c_platform_data s6_i2c_pdata = {
+ .bus_num = S6_I2C_BUS_NUM,
+ .clock = "PCLK",
+};
+
+static struct resource s6_i2c_resource[] = {
+ {
+ .name = "mem",
+ .start = (resource_size_t)S6_REG_I2C,
+ .end = (resource_size_t)S6_REG_I2C + 0x1000 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "irq",
+ .start = (resource_size_t)I2C_INTNUM,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+#define S6I2C_ADDR_TLV320AIC31 0x18
+#define S6I2C_ADDR_SAA7121 0x44
+#define S6I2C_ADDR_MT9D131 0x48
+#define S6I2C_ADDR_AT24HC02B 0x57
+#define S6I2C_ADDR_M41T62 0x68
+#define S6I2C_ADDR_CDCE906 0x69
+#define S6I2C_ADDR_PCA9543 0x73
+
+static struct i2c_board_info __initdata s6_i2c_devices[] = {
+};
+
static struct platform_device platform_devices[] = {
{
.name = "serial8250",
@@ -143,12 +184,22 @@ static struct platform_device platform_devices[] = {
.resource = s6_gmac_resource,
.num_resources = ARRAY_SIZE(s6_gmac_resource),
},
+ {
+ .name = "i2c-s6000",
+ .resource = s6_i2c_resource,
+ .num_resources = ARRAY_SIZE(s6_i2c_resource),
+ .dev = {
+ .platform_data = &s6_i2c_pdata,
+ },
+ },
};
static int __init device_init(void)
{
int i;
+ i2c_register_board_info(S6_I2C_BUS_NUM, s6_i2c_devices,
+ ARRAY_SIZE(s6_i2c_devices));
s6_gmac_resource[5].start = prepare_phy_irq(GPIO_PHY_IRQ);
for (i = 0; i < ARRAY_SIZE(platform_devices); i++)
--
1.6.2.107.ge47ee
next prev parent reply other threads:[~2009-03-23 15:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 15:05 [patch 1/5] i2c: xtensa s6000 i2c driver Daniel Glöckner
2009-03-23 15:05 ` Daniel Glöckner [this message]
2009-03-23 15:05 ` [patch 3/5] xtensa: add at24hc02b to s6105 platform Daniel Glöckner
2009-03-23 15:05 ` [patch 4/5] xtensa: enable s6000 i2c host driver in s6105_defconfig Daniel Glöckner
2009-03-23 15:05 ` [patch 5/5] xtensa: enable at24 " Daniel Glöckner
2009-03-31 22:52 ` [patch 1/5] i2c: xtensa s6000 i2c driver Ben Dooks
2009-03-31 23:01 ` Ben Dooks
2009-04-02 11:19 ` [patch v2] " Oskar Schirmer
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=1237820718-30607-2-git-send-email-dg@emlix.com \
--to=dg@emlix.com \
--cc=ben-linux@fluff.org \
--cc=chris@zankel.net \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=os@emlix.com \
/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
Powered by JetHome