All of lore.kernel.org
 help / color / mirror / Atom feed
From: kmpark@infradead.org (Kyungmin Park)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: S5PC210: GPIO I2C devices support on universal board
Date: Tue, 03 Aug 2010 09:44:03 +0900	[thread overview]
Message-ID: <20100803004403.GA5300@july> (raw)

From: Kyungmin Park <kyungmin.park@samsung.com>

Universal board has several GPIO i2c devices.

Note that this patch depends on previous patch "ARM: S5PC210: Define more GPIOs to use the MP pins".

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 arch/arm/mach-s5pv310/mach-universal.c |   92 ++++++++++++++++++++++++++++++++
 1 files changed, 92 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv310/mach-universal.c b/arch/arm/mach-s5pv310/mach-universal.c
index d584028..29a2516 100644
--- a/arch/arm/mach-s5pv310/mach-universal.c
+++ b/arch/arm/mach-s5pv310/mach-universal.c
@@ -12,6 +12,7 @@
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
 #include <linux/gpio.h>
+#include <linux/i2c-gpio.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -115,8 +116,99 @@ static struct platform_device universal_gpio_keys = {
 	},
 };
 
+/* GPIO I2C devices */
+#define I2C_GPIO_BUS_9		9
+static struct i2c_gpio_platform_data universal_i2c_gpio_fuelgauge_data = {
+	.sda_pin		= S5PV310_MP04(0),	/* XM0ADDR_8 */
+	.scl_pin		= S5PV310_MP04(1),	/* XM0ADDR_9 */
+};
+
+static struct platform_device universal_i2c_gpio_fuelgauge = {
+	.name			= "i2c-gpio",
+	.id			= I2C_GPIO_BUS_9,
+	.dev			= {
+		.platform_data	= &universal_i2c_gpio_fuelgauge_data,
+	},
+};
+
+#define I2C_GPIO_BUS_10		10
+static struct i2c_gpio_platform_data universal_i2c_gpio_microusb_data = {
+	.sda_pin		= S5PV310_GPE1(0),	/* XMDMADDR_0 */
+	.scl_pin		= S5PV310_GPE1(1),	/* XMDMADDR_1 */
+};
+
+static struct platform_device universal_i2c_gpio_microusb = {
+	.name			= "i2c-gpio",
+	.id			= I2C_GPIO_BUS_10,
+	.dev			= {
+		.platform_data	= &universal_i2c_gpio_microusb_data,
+	},
+};
+
+#define I2C_GPIO_BUS_11		11
+static struct i2c_gpio_platform_data universal_i2c_gpio_fm_data = {
+	.sda_pin		= S5PV310_GPE1(2),	/* XMDMADDR_2 */
+	.scl_pin		= S5PV310_GPE1(3),	/* XMDMADDR_3 */
+};
+
+static struct platform_device universal_i2c_gpio_fm = {
+	.name			= "i2c-gpio",
+	.id			= I2C_GPIO_BUS_11,
+	.dev			= {
+		.platform_data	= &universal_i2c_gpio_fm_data,
+	},
+};
+
+#define I2C_GPIO_BUS_12		12
+static struct i2c_gpio_platform_data universal_i2c_gpio_3touch_data = {
+	.sda_pin		= S5PV310_GPE4(0),	/* XMDMDATA_8 */
+	.scl_pin		= S5PV310_GPE4(1),	/* XMDMDATA_9 */
+};
+
+static struct platform_device universal_i2c_gpio_3touch = {
+	.name			= "i2c-gpio",
+	.id			= I2C_GPIO_BUS_12,
+	.dev			= {
+		.platform_data	= &universal_i2c_gpio_3touch_data,
+	},
+};
+
+#define I2C_GPIO_BUS_13		13
+static struct i2c_gpio_platform_data universal_i2c_gpio_hdmiddc_data = {
+	.sda_pin		= S5PV310_GPE4(2),	/* XMDMDATA_10 */
+	.scl_pin		= S5PV310_GPE4(3),	/* XMDMDATA_11 */
+};
+
+static struct platform_device universal_i2c_gpio_hdmiddc = {
+	.name			= "i2c-gpio",
+	.id			= I2C_GPIO_BUS_13,
+	.dev			= {
+		.platform_data	= &universal_i2c_gpio_hdmiddc_data,
+	},
+};
+
+#define I2C_GPIO_BUS_14		14
+static struct i2c_gpio_platform_data universal_i2c_gpio_light_data = {
+	.sda_pin		= S5PV310_GPK2(2),	/* XMMC2CDN */
+	.scl_pin		= S5PV310_GPK0(2),	/* XMMC0CDN */
+};
+
+static struct platform_device universal_i2c_gpio_light = {
+	.name			= "i2c-gpio",
+	.id			= I2C_GPIO_BUS_14,
+	.dev			= {
+		.platform_data	= &universal_i2c_gpio_light_data,
+	},
+};
+
 static struct platform_device *universal_devices[] __initdata = {
 	&universal_gpio_keys,
+	&universal_i2c_gpio_fuelgauge,
+	&universal_i2c_gpio_microusb,
+	&universal_i2c_gpio_fm,
+	&universal_i2c_gpio_3touch,
+	&universal_i2c_gpio_hdmiddc,
+	&universal_i2c_gpio_light,
 };
 
 static void __init universal_map_io(void)
-- 
1.5.3.3

                 reply	other threads:[~2010-08-03  0:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100803004403.GA5300@july \
    --to=kmpark@infradead.org \
    --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 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.