* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
@ 2010-09-30 4:48 Kyungmin Park
2010-09-30 6:20 ` Jeongbae Seo
2010-10-07 1:54 ` Kukjin Kim
0 siblings, 2 replies; 17+ messages in thread
From: Kyungmin Park @ 2010-09-30 4:48 UTC (permalink / raw)
To: linux-arm-kernel
From: Kyungmin Park <kyungmin.park@samsung.com>
S5PC210 support more I2C devices than previous SoCs.
And to prevent the wrong usage use the s5p prefix instead of s3c.
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pv310/Kconfig | 15 +++++++
arch/arm/mach-s5pv310/Makefile | 5 ++
arch/arm/mach-s5pv310/setup-i2c3.c | 25 +++++++++++
arch/arm/mach-s5pv310/setup-i2c4.c | 25 +++++++++++
arch/arm/mach-s5pv310/setup-i2c5.c | 25 +++++++++++
arch/arm/mach-s5pv310/setup-i2c6.c | 25 +++++++++++
arch/arm/mach-s5pv310/setup-i2c7.c | 25 +++++++++++
arch/arm/plat-s5p/Kconfig | 25 +++++++++++
arch/arm/plat-s5p/Makefile | 5 ++
arch/arm/plat-s5p/dev-i2c3.c | 67 ++++++++++++++++++++++++++++++
arch/arm/plat-s5p/dev-i2c4.c | 67 ++++++++++++++++++++++++++++++
arch/arm/plat-s5p/dev-i2c5.c | 67 ++++++++++++++++++++++++++++++
arch/arm/plat-s5p/dev-i2c6.c | 67 ++++++++++++++++++++++++++++++
arch/arm/plat-s5p/dev-i2c7.c | 67 ++++++++++++++++++++++++++++++
arch/arm/plat-samsung/include/plat/iic.h | 5 ++
15 files changed, 515 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig
index c207426..cd5e8a6 100644
--- a/arch/arm/mach-s5pv310/Kconfig
+++ b/arch/arm/mach-s5pv310/Kconfig
@@ -24,6 +24,21 @@ config S5PV310_SETUP_I2C2
help
Common setup code for i2c bus 2.
+config S5PV310_SETUP_I2C3
+ bool
+
+config S5PV310_SETUP_I2C4
+ bool
+
+config S5PV310_SETUP_I2C5
+ bool
+
+config S5PV310_SETUP_I2C6
+ bool
+
+config S5PV310_SETUP_I2C7
+ bool
+
# machine support
menu "S5PC210 Machines"
diff --git a/arch/arm/mach-s5pv310/Makefile b/arch/arm/mach-s5pv310/Makefile
index d17c8c7..d18febf 100644
--- a/arch/arm/mach-s5pv310/Makefile
+++ b/arch/arm/mach-s5pv310/Makefile
@@ -30,3 +30,8 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o
obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o
obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o
+obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
+obj-$(CONFIG_S5PV310_SETUP_I2C4) += setup-i2c4.o
+obj-$(CONFIG_S5PV310_SETUP_I2C5) += setup-i2c5.o
+obj-$(CONFIG_S5PV310_SETUP_I2C6) += setup-i2c6.o
+obj-$(CONFIG_S5PV310_SETUP_I2C7) += setup-i2c7.o
diff --git a/arch/arm/mach-s5pv310/setup-i2c3.c b/arch/arm/mach-s5pv310/setup-i2c3.c
new file mode 100644
index 0000000..25e75b6
--- /dev/null
+++ b/arch/arm/mach-s5pv310/setup-i2c3.c
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/arm/mach-s5pv310/setup-i2c3.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *
+ * I2C3 GPIO configuration.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+struct platform_device; /* don't need the contents */
+
+#include <linux/gpio.h>
+#include <plat/iic.h>
+#include <plat/gpio-cfg.h>
+
+void s5p_i2c3_cfg_gpio(struct platform_device *dev)
+{
+ s3c_gpio_cfgpin(S5PV310_GPA1(2), S3C_GPIO_SFN(3));
+ s3c_gpio_setpull(S5PV310_GPA1(2), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PV310_GPA1(3), S3C_GPIO_SFN(3));
+ s3c_gpio_setpull(S5PV310_GPA1(3), S3C_GPIO_PULL_UP);
+}
diff --git a/arch/arm/mach-s5pv310/setup-i2c4.c b/arch/arm/mach-s5pv310/setup-i2c4.c
new file mode 100644
index 0000000..72b3f68
--- /dev/null
+++ b/arch/arm/mach-s5pv310/setup-i2c4.c
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/arm/mach-s5pv310/setup-i2c4.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *
+ * I2C4 GPIO configuration.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+struct platform_device; /* don't need the contents */
+
+#include <linux/gpio.h>
+#include <plat/iic.h>
+#include <plat/gpio-cfg.h>
+
+void s5p_i2c4_cfg_gpio(struct platform_device *dev)
+{
+ s3c_gpio_cfgpin(S5PV310_GPB(0), S3C_GPIO_SFN(3));
+ s3c_gpio_setpull(S5PV310_GPB(0), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PV310_GPB(1), S3C_GPIO_SFN(3));
+ s3c_gpio_setpull(S5PV310_GPB(1), S3C_GPIO_PULL_UP);
+}
diff --git a/arch/arm/mach-s5pv310/setup-i2c5.c b/arch/arm/mach-s5pv310/setup-i2c5.c
new file mode 100644
index 0000000..8fb4710
--- /dev/null
+++ b/arch/arm/mach-s5pv310/setup-i2c5.c
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/arm/mach-s5pv310/setup-i2c5.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *
+ * I2C5 GPIO configuration.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+struct platform_device; /* don't need the contents */
+
+#include <linux/gpio.h>
+#include <plat/iic.h>
+#include <plat/gpio-cfg.h>
+
+void s5p_i2c5_cfg_gpio(struct platform_device *dev)
+{
+ s3c_gpio_cfgpin(S5PV310_GPB(6), S3C_GPIO_SFN(3));
+ s3c_gpio_setpull(S5PV310_GPB(6), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PV310_GPB(7), S3C_GPIO_SFN(3));
+ s3c_gpio_setpull(S5PV310_GPB(7), S3C_GPIO_PULL_UP);
+}
diff --git a/arch/arm/mach-s5pv310/setup-i2c6.c b/arch/arm/mach-s5pv310/setup-i2c6.c
new file mode 100644
index 0000000..a358071
--- /dev/null
+++ b/arch/arm/mach-s5pv310/setup-i2c6.c
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/arm/mach-s5pv310/setup-i2c6.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *
+ * I2C6 GPIO configuration.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+struct platform_device; /* don't need the contents */
+
+#include <linux/gpio.h>
+#include <plat/iic.h>
+#include <plat/gpio-cfg.h>
+
+void s5p_i2c6_cfg_gpio(struct platform_device *dev)
+{
+ s3c_gpio_cfgpin(S5PV310_GPC1(3), S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(S5PV310_GPC1(3), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PV310_GPC1(4), S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(S5PV310_GPC1(4), S3C_GPIO_PULL_UP);
+}
diff --git a/arch/arm/mach-s5pv310/setup-i2c7.c b/arch/arm/mach-s5pv310/setup-i2c7.c
new file mode 100644
index 0000000..d0bc17c
--- /dev/null
+++ b/arch/arm/mach-s5pv310/setup-i2c7.c
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/arm/mach-s5pv310/setup-i2c7.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *
+ * I2C7 GPIO configuration.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+struct platform_device; /* don't need the contents */
+
+#include <linux/gpio.h>
+#include <plat/iic.h>
+#include <plat/gpio-cfg.h>
+
+void s5p_i2c7_cfg_gpio(struct platform_device *dev)
+{
+ s3c_gpio_cfgpin(S5PV310_GPD0(2), S3C_GPIO_SFN(3));
+ s3c_gpio_setpull(S5PV310_GPD0(2), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PV310_GPD0(3), S3C_GPIO_SFN(3));
+ s3c_gpio_setpull(S5PV310_GPD0(3), S3C_GPIO_PULL_UP);
+}
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index 2596096..a6e8e65 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -51,3 +51,28 @@ config S5P_DEV_ONENAND
bool
help
Compile in platform device definition for OneNAND controller
+
+config S5P_DEV_I2C3
+ bool
+ help
+ Compile in platform device definition for I2C controller 3
+
+config S5P_DEV_I2C4
+ bool
+ help
+ Compile in platform device definition for I2C controller 4
+
+config S5P_DEV_I2C5
+ bool
+ help
+ Compile in platform device definition for I2C controller 5
+
+config S5P_DEV_I2C6
+ bool
+ help
+ Compile in platform device definition for I2C controller 6
+
+config S5P_DEV_I2C7
+ bool
+ help
+ Compile in platform device definition for I2C controller 7
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index f3e917e..f57fab8 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -25,3 +25,8 @@ obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o
obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o
obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o
obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o
+obj-$(CONFIG_S5P_DEV_I2C3) += dev-i2c3.o
+obj-$(CONFIG_S5P_DEV_I2C4) += dev-i2c4.o
+obj-$(CONFIG_S5P_DEV_I2C5) += dev-i2c5.o
+obj-$(CONFIG_S5P_DEV_I2C6) += dev-i2c6.o
+obj-$(CONFIG_S5P_DEV_I2C7) += dev-i2c7.o
diff --git a/arch/arm/plat-s5p/dev-i2c3.c b/arch/arm/plat-s5p/dev-i2c3.c
new file mode 100644
index 0000000..f92c4ea
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-i2c3.c
@@ -0,0 +1,67 @@
+/* linux/arch/arm/plat-s5p/dev-i2c3.c
+ *
+ * Copyright(C) 2010 Samsung Electronics
+ *
+ * S5P series device definition for i2c device 3
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/gfp.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+
+#include <mach/irqs.h>
+#include <mach/map.h>
+
+#include <plat/regs-iic.h>
+#include <plat/iic.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+static struct resource s3c_i2c_resource[] = {
+ [0] = {
+ .start = S3C_PA_I2C3,
+ .end = S3C_PA_I2C3 + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_I2C3,
+ .end = IRQ_I2C3,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device s3c_device_i2c3 = {
+ .name = "s3c2440-i2c",
+ .id = 3,
+ .num_resources = ARRAY_SIZE(s3c_i2c_resource),
+ .resource = s3c_i2c_resource,
+};
+
+static struct s3c2410_platform_i2c default_i2c_data3 __initdata = {
+ .flags = 0,
+ .bus_num = 3,
+ .slave_addr = 0x10,
+ .frequency = 100*1000,
+ .sda_delay = 100,
+};
+
+void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
+{
+ struct s3c2410_platform_i2c *npd;
+
+ if (!pd)
+ pd = &default_i2c_data3;
+
+ npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
+ if (!npd)
+ printk(KERN_ERR "%s: no memory for platform data\n", __func__);
+ else if (!npd->cfg_gpio)
+ npd->cfg_gpio = s5p_i2c3_cfg_gpio;
+
+ s3c_device_i2c3.dev.platform_data = npd;
+}
diff --git a/arch/arm/plat-s5p/dev-i2c4.c b/arch/arm/plat-s5p/dev-i2c4.c
new file mode 100644
index 0000000..10b5bd1
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-i2c4.c
@@ -0,0 +1,67 @@
+/* linux/arch/arm/plat-s5p/dev-i2c4.c
+ *
+ * Copyright(C) 2010 Samsung Electronics
+ *
+ * S5P series device definition for i2c device 3
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/gfp.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+
+#include <mach/irqs.h>
+#include <mach/map.h>
+
+#include <plat/regs-iic.h>
+#include <plat/iic.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+static struct resource s3c_i2c_resource[] = {
+ [0] = {
+ .start = S3C_PA_I2C4,
+ .end = S3C_PA_I2C4 + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_I2C4,
+ .end = IRQ_I2C4,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device s3c_device_i2c4 = {
+ .name = "s3c2440-i2c",
+ .id = 4,
+ .num_resources = ARRAY_SIZE(s3c_i2c_resource),
+ .resource = s3c_i2c_resource,
+};
+
+static struct s3c2410_platform_i2c default_i2c_data4 __initdata = {
+ .flags = 0,
+ .bus_num = 4,
+ .slave_addr = 0x10,
+ .frequency = 100*1000,
+ .sda_delay = 100,
+};
+
+void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
+{
+ struct s3c2410_platform_i2c *npd;
+
+ if (!pd)
+ pd = &default_i2c_data4;
+
+ npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
+ if (!npd)
+ printk(KERN_ERR "%s: no memory for platform data\n", __func__);
+ else if (!npd->cfg_gpio)
+ npd->cfg_gpio = s5p_i2c4_cfg_gpio;
+
+ s3c_device_i2c4.dev.platform_data = npd;
+}
diff --git a/arch/arm/plat-s5p/dev-i2c5.c b/arch/arm/plat-s5p/dev-i2c5.c
new file mode 100644
index 0000000..a5ab875
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-i2c5.c
@@ -0,0 +1,67 @@
+/* linux/arch/arm/plat-s5p/dev-i2c3.c
+ *
+ * Copyright(C) 2010 Samsung Electronics
+ *
+ * S5P series device definition for i2c device 3
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/gfp.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+
+#include <mach/irqs.h>
+#include <mach/map.h>
+
+#include <plat/regs-iic.h>
+#include <plat/iic.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+static struct resource s3c_i2c_resource[] = {
+ [0] = {
+ .start = S3C_PA_I2C5,
+ .end = S3C_PA_I2C5 + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_I2C5,
+ .end = IRQ_I2C5,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device s3c_device_i2c5 = {
+ .name = "s3c2440-i2c",
+ .id = 5,
+ .num_resources = ARRAY_SIZE(s3c_i2c_resource),
+ .resource = s3c_i2c_resource,
+};
+
+static struct s3c2410_platform_i2c default_i2c_data5 __initdata = {
+ .flags = 0,
+ .bus_num = 5,
+ .slave_addr = 0x10,
+ .frequency = 100*1000,
+ .sda_delay = 100,
+};
+
+void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
+{
+ struct s3c2410_platform_i2c *npd;
+
+ if (!pd)
+ pd = &default_i2c_data5;
+
+ npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
+ if (!npd)
+ printk(KERN_ERR "%s: no memory for platform data\n", __func__);
+ else if (!npd->cfg_gpio)
+ npd->cfg_gpio = s5p_i2c5_cfg_gpio;
+
+ s3c_device_i2c5.dev.platform_data = npd;
+}
diff --git a/arch/arm/plat-s5p/dev-i2c6.c b/arch/arm/plat-s5p/dev-i2c6.c
new file mode 100644
index 0000000..3c29a9b
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-i2c6.c
@@ -0,0 +1,67 @@
+/* linux/arch/arm/plat-s5p/dev-i2c6.c
+ *
+ * Copyright(C) 2010 Samsung Electronics
+ *
+ * S5P series device definition for i2c device 6
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/gfp.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+
+#include <mach/irqs.h>
+#include <mach/map.h>
+
+#include <plat/regs-iic.h>
+#include <plat/iic.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+static struct resource s3c_i2c_resource[] = {
+ [0] = {
+ .start = S3C_PA_I2C6,
+ .end = S3C_PA_I2C6 + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_I2C6,
+ .end = IRQ_I2C6,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device s3c_device_i2c6 = {
+ .name = "s3c2440-i2c",
+ .id = 6,
+ .num_resources = ARRAY_SIZE(s3c_i2c_resource),
+ .resource = s3c_i2c_resource,
+};
+
+static struct s3c2410_platform_i2c default_i2c_data6 __initdata = {
+ .flags = 0,
+ .bus_num = 6,
+ .slave_addr = 0x10,
+ .frequency = 100*1000,
+ .sda_delay = 100,
+};
+
+void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
+{
+ struct s3c2410_platform_i2c *npd;
+
+ if (!pd)
+ pd = &default_i2c_data6;
+
+ npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
+ if (!npd)
+ printk(KERN_ERR "%s: no memory for platform data\n", __func__);
+ else if (!npd->cfg_gpio)
+ npd->cfg_gpio = s5p_i2c6_cfg_gpio;
+
+ s3c_device_i2c6.dev.platform_data = npd;
+}
diff --git a/arch/arm/plat-s5p/dev-i2c7.c b/arch/arm/plat-s5p/dev-i2c7.c
new file mode 100644
index 0000000..98139a5
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-i2c7.c
@@ -0,0 +1,67 @@
+/* linux/arch/arm/plat-s5p/dev-i2c7.c
+ *
+ * Copyright(C) 2010 Samsung Electronics
+ *
+ * S5P series device definition for i2c device 7
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/gfp.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+
+#include <mach/irqs.h>
+#include <mach/map.h>
+
+#include <plat/regs-iic.h>
+#include <plat/iic.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+static struct resource s3c_i2c_resource[] = {
+ [0] = {
+ .start = S3C_PA_I2C7,
+ .end = S3C_PA_I2C7 + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_I2C7,
+ .end = IRQ_I2C7,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device s3c_device_i2c7 = {
+ .name = "s3c2440-i2c",
+ .id = 7,
+ .num_resources = ARRAY_SIZE(s3c_i2c_resource),
+ .resource = s3c_i2c_resource,
+};
+
+static struct s3c2410_platform_i2c default_i2c_data7 __initdata = {
+ .flags = 0,
+ .bus_num = 7,
+ .slave_addr = 0x10,
+ .frequency = 100*1000,
+ .sda_delay = 100,
+};
+
+void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
+{
+ struct s3c2410_platform_i2c *npd;
+
+ if (!pd)
+ pd = &default_i2c_data7;
+
+ npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
+ if (!npd)
+ printk(KERN_ERR "%s: no memory for platform data\n", __func__);
+ else if (!npd->cfg_gpio)
+ npd->cfg_gpio = s5p_i2c7_cfg_gpio;
+
+ s3c_device_i2c7.dev.platform_data = npd;
+}
diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-samsung/include/plat/iic.h
index 133308b..893f6a1 100644
--- a/arch/arm/plat-samsung/include/plat/iic.h
+++ b/arch/arm/plat-samsung/include/plat/iic.h
@@ -60,5 +60,10 @@ extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c);
extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
+extern void s5p_i2c3_cfg_gpio(struct platform_device *dev);
+extern void s5p_i2c4_cfg_gpio(struct platform_device *dev);
+extern void s5p_i2c5_cfg_gpio(struct platform_device *dev);
+extern void s5p_i2c6_cfg_gpio(struct platform_device *dev);
+extern void s5p_i2c7_cfg_gpio(struct platform_device *dev);
#endif /* __ASM_ARCH_IIC_H */
--
1.5.3.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 4:48 [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support Kyungmin Park
@ 2010-09-30 6:20 ` Jeongbae Seo
2010-09-30 6:27 ` Kyungmin Park
2010-10-07 1:54 ` Kukjin Kim
1 sibling, 1 reply; 17+ messages in thread
From: Jeongbae Seo @ 2010-09-30 6:20 UTC (permalink / raw)
To: linux-arm-kernel
Kyungmin wrote:
> From: Kyungmin Park <kyungmin.park@samsung.com>
>
> S5PC210 support more I2C devices than previous SoCs.
> And to prevent the wrong usage use the s5p prefix instead of s3c.
>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> arch/arm/mach-s5pv310/Kconfig | 15 +++++++
> arch/arm/mach-s5pv310/Makefile | 5 ++
> arch/arm/mach-s5pv310/setup-i2c3.c | 25 +++++++++++
> arch/arm/mach-s5pv310/setup-i2c4.c | 25 +++++++++++
> arch/arm/mach-s5pv310/setup-i2c5.c | 25 +++++++++++
> arch/arm/mach-s5pv310/setup-i2c6.c | 25 +++++++++++
> arch/arm/mach-s5pv310/setup-i2c7.c | 25 +++++++++++
> arch/arm/plat-s5p/Kconfig | 25 +++++++++++
> arch/arm/plat-s5p/Makefile | 5 ++
> arch/arm/plat-s5p/dev-i2c3.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-s5p/dev-i2c4.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-s5p/dev-i2c5.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-s5p/dev-i2c6.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-s5p/dev-i2c7.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-samsung/include/plat/iic.h | 5 ++
> 15 files changed, 515 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
>
Hi Kyungmin,
We are considering another way not to make additional new i2c dev files.
In my opinion, this patch looks not bad but we'd better make an effort to
avoid having the more similar file.
Jongsun, can you give us your opinion ?
Thanks,
Best Regards
Jeongbae Seo
> diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig
> index c207426..cd5e8a6 100644
> --- a/arch/arm/mach-s5pv310/Kconfig
> +++ b/arch/arm/mach-s5pv310/Kconfig
> @@ -24,6 +24,21 @@ config S5PV310_SETUP_I2C2
> help
> Common setup code for i2c bus 2.
>
> +config S5PV310_SETUP_I2C3
> + bool
> +
> +config S5PV310_SETUP_I2C4
> + bool
> +
> +config S5PV310_SETUP_I2C5
> + bool
> +
> +config S5PV310_SETUP_I2C6
> + bool
> +
> +config S5PV310_SETUP_I2C7
> + bool
> +
> # machine support
>
> menu "S5PC210 Machines"
> diff --git a/arch/arm/mach-s5pv310/Makefile b/arch/arm/mach-
> s5pv310/Makefile
> index d17c8c7..d18febf 100644
> --- a/arch/arm/mach-s5pv310/Makefile
> +++ b/arch/arm/mach-s5pv310/Makefile
> @@ -30,3 +30,8 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-
> universal_c210.o
>
> obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o
> obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C4) += setup-i2c4.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C5) += setup-i2c5.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C6) += setup-i2c6.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C7) += setup-i2c7.o
> diff --git a/arch/arm/mach-s5pv310/setup-i2c3.c b/arch/arm/mach-
> s5pv310/setup-i2c3.c
> new file mode 100644
> index 0000000..25e75b6
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c3.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c3.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C3 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c3_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPA1(2), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPA1(2), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPA1(3), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPA1(3), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/mach-s5pv310/setup-i2c4.c b/arch/arm/mach-
> s5pv310/setup-i2c4.c
> new file mode 100644
> index 0000000..72b3f68
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c4.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c4.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C4 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c4_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPB(0), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPB(0), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPB(1), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPB(1), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/mach-s5pv310/setup-i2c5.c b/arch/arm/mach-
> s5pv310/setup-i2c5.c
> new file mode 100644
> index 0000000..8fb4710
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c5.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c5.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C5 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c5_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPB(6), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPB(6), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPB(7), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPB(7), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/mach-s5pv310/setup-i2c6.c b/arch/arm/mach-
> s5pv310/setup-i2c6.c
> new file mode 100644
> index 0000000..a358071
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c6.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c6.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C6 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c6_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPC1(3), S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(S5PV310_GPC1(3), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPC1(4), S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(S5PV310_GPC1(4), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/mach-s5pv310/setup-i2c7.c b/arch/arm/mach-
> s5pv310/setup-i2c7.c
> new file mode 100644
> index 0000000..d0bc17c
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c7.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c7.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C7 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c7_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPD0(2), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPD0(2), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPD0(3), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPD0(3), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
> index 2596096..a6e8e65 100644
> --- a/arch/arm/plat-s5p/Kconfig
> +++ b/arch/arm/plat-s5p/Kconfig
> @@ -51,3 +51,28 @@ config S5P_DEV_ONENAND
> bool
> help
> Compile in platform device definition for OneNAND controller
> +
> +config S5P_DEV_I2C3
> + bool
> + help
> + Compile in platform device definition for I2C controller 3
> +
> +config S5P_DEV_I2C4
> + bool
> + help
> + Compile in platform device definition for I2C controller 4
> +
> +config S5P_DEV_I2C5
> + bool
> + help
> + Compile in platform device definition for I2C controller 5
> +
> +config S5P_DEV_I2C6
> + bool
> + help
> + Compile in platform device definition for I2C controller 6
> +
> +config S5P_DEV_I2C7
> + bool
> + help
> + Compile in platform device definition for I2C controller 7
> diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
> index f3e917e..f57fab8 100644
> --- a/arch/arm/plat-s5p/Makefile
> +++ b/arch/arm/plat-s5p/Makefile
> @@ -25,3 +25,8 @@ obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o
> obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o
> obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o
> obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o
> +obj-$(CONFIG_S5P_DEV_I2C3) += dev-i2c3.o
> +obj-$(CONFIG_S5P_DEV_I2C4) += dev-i2c4.o
> +obj-$(CONFIG_S5P_DEV_I2C5) += dev-i2c5.o
> +obj-$(CONFIG_S5P_DEV_I2C6) += dev-i2c6.o
> +obj-$(CONFIG_S5P_DEV_I2C7) += dev-i2c7.o
> diff --git a/arch/arm/plat-s5p/dev-i2c3.c b/arch/arm/plat-s5p/dev-i2c3.c
> new file mode 100644
> index 0000000..f92c4ea
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c3.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c3.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 3
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C3,
> + .end = S3C_PA_I2C3 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C3,
> + .end = IRQ_I2C3,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c3 = {
> + .name = "s3c2440-i2c",
> + .id = 3,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data3 __initdata = {
> + .flags = 0,
> + .bus_num = 3,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data3;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c3_cfg_gpio;
> +
> + s3c_device_i2c3.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-s5p/dev-i2c4.c b/arch/arm/plat-s5p/dev-i2c4.c
> new file mode 100644
> index 0000000..10b5bd1
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c4.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c4.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 3
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C4,
> + .end = S3C_PA_I2C4 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C4,
> + .end = IRQ_I2C4,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c4 = {
> + .name = "s3c2440-i2c",
> + .id = 4,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data4 __initdata = {
> + .flags = 0,
> + .bus_num = 4,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data4;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c4_cfg_gpio;
> +
> + s3c_device_i2c4.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-s5p/dev-i2c5.c b/arch/arm/plat-s5p/dev-i2c5.c
> new file mode 100644
> index 0000000..a5ab875
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c5.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c3.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 3
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C5,
> + .end = S3C_PA_I2C5 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C5,
> + .end = IRQ_I2C5,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c5 = {
> + .name = "s3c2440-i2c",
> + .id = 5,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data5 __initdata = {
> + .flags = 0,
> + .bus_num = 5,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data5;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c5_cfg_gpio;
> +
> + s3c_device_i2c5.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-s5p/dev-i2c6.c b/arch/arm/plat-s5p/dev-i2c6.c
> new file mode 100644
> index 0000000..3c29a9b
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c6.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c6.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 6
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C6,
> + .end = S3C_PA_I2C6 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C6,
> + .end = IRQ_I2C6,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c6 = {
> + .name = "s3c2440-i2c",
> + .id = 6,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data6 __initdata = {
> + .flags = 0,
> + .bus_num = 6,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data6;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c6_cfg_gpio;
> +
> + s3c_device_i2c6.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-s5p/dev-i2c7.c b/arch/arm/plat-s5p/dev-i2c7.c
> new file mode 100644
> index 0000000..98139a5
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c7.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c7.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 7
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C7,
> + .end = S3C_PA_I2C7 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C7,
> + .end = IRQ_I2C7,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c7 = {
> + .name = "s3c2440-i2c",
> + .id = 7,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data7 __initdata = {
> + .flags = 0,
> + .bus_num = 7,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data7;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c7_cfg_gpio;
> +
> + s3c_device_i2c7.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-
> samsung/include/plat/iic.h
> index 133308b..893f6a1 100644
> --- a/arch/arm/plat-samsung/include/plat/iic.h
> +++ b/arch/arm/plat-samsung/include/plat/iic.h
> @@ -60,5 +60,10 @@ extern void s3c_i2c2_set_platdata(struct
> s3c2410_platform_i2c *i2c);
> extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
> extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
> extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c3_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c4_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c5_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c6_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c7_cfg_gpio(struct platform_device *dev);
>
> #endif /* __ASM_ARCH_IIC_H */
> --
> 1.5.3.3
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 6:20 ` Jeongbae Seo
@ 2010-09-30 6:27 ` Kyungmin Park
2010-09-30 6:50 ` Jassi Brar
0 siblings, 1 reply; 17+ messages in thread
From: Kyungmin Park @ 2010-09-30 6:27 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo <jeongbae.seo@samsung.com> wrote:
> Kyungmin wrote:
>> From: Kyungmin Park <kyungmin.park@samsung.com>
>>
>> S5PC210 support more I2C devices than previous SoCs.
>> And to prevent the wrong usage use the s5p prefix instead of s3c.
>>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>> ?arch/arm/mach-s5pv310/Kconfig ? ? ? ? ? ?| ? 15 +++++++
>> ?arch/arm/mach-s5pv310/Makefile ? ? ? ? ? | ? ?5 ++
>> ?arch/arm/mach-s5pv310/setup-i2c3.c ? ? ? | ? 25 +++++++++++
>> ?arch/arm/mach-s5pv310/setup-i2c4.c ? ? ? | ? 25 +++++++++++
>> ?arch/arm/mach-s5pv310/setup-i2c5.c ? ? ? | ? 25 +++++++++++
>> ?arch/arm/mach-s5pv310/setup-i2c6.c ? ? ? | ? 25 +++++++++++
>> ?arch/arm/mach-s5pv310/setup-i2c7.c ? ? ? | ? 25 +++++++++++
>> ?arch/arm/plat-s5p/Kconfig ? ? ? ? ? ? ? ?| ? 25 +++++++++++
>> ?arch/arm/plat-s5p/Makefile ? ? ? ? ? ? ? | ? ?5 ++
>> ?arch/arm/plat-s5p/dev-i2c3.c ? ? ? ? ? ? | ? 67
>> ++++++++++++++++++++++++++++++
>> ?arch/arm/plat-s5p/dev-i2c4.c ? ? ? ? ? ? | ? 67
>> ++++++++++++++++++++++++++++++
>> ?arch/arm/plat-s5p/dev-i2c5.c ? ? ? ? ? ? | ? 67
>> ++++++++++++++++++++++++++++++
>> ?arch/arm/plat-s5p/dev-i2c6.c ? ? ? ? ? ? | ? 67
>> ++++++++++++++++++++++++++++++
>> ?arch/arm/plat-s5p/dev-i2c7.c ? ? ? ? ? ? | ? 67
>> ++++++++++++++++++++++++++++++
>> ?arch/arm/plat-samsung/include/plat/iic.h | ? ?5 ++
>> ?15 files changed, 515 insertions(+), 0 deletions(-)
>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
>>
>
> Hi Kyungmin,
>
> We are considering another way not to make additional new i2c dev files.
> In my opinion, this patch looks not bad but we'd better make an effort to
> avoid having the more similar file.
Actually I also it's not good approach, but as there's no comment or
discuss about this I send the patches.
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/022615.html
If you have good method or approaches, I'm welcome.
Thank you,
Kyungmin Park
>
> Jongsun, can you give us your opinion ?
>
> Thanks,
> Best Regards
> Jeongbae Seo
>
>> diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig
>> index c207426..cd5e8a6 100644
>> --- a/arch/arm/mach-s5pv310/Kconfig
>> +++ b/arch/arm/mach-s5pv310/Kconfig
>> @@ -24,6 +24,21 @@ config S5PV310_SETUP_I2C2
>> ? ? ? help
>> ? ? ? ? Common setup code for i2c bus 2.
>>
>> +config S5PV310_SETUP_I2C3
>> + ? ? bool
>> +
>> +config S5PV310_SETUP_I2C4
>> + ? ? bool
>> +
>> +config S5PV310_SETUP_I2C5
>> + ? ? bool
>> +
>> +config S5PV310_SETUP_I2C6
>> + ? ? bool
>> +
>> +config S5PV310_SETUP_I2C7
>> + ? ? bool
>> +
>> ?# machine support
>>
>> ?menu "S5PC210 Machines"
>> diff --git a/arch/arm/mach-s5pv310/Makefile b/arch/arm/mach-
>> s5pv310/Makefile
>> index d17c8c7..d18febf 100644
>> --- a/arch/arm/mach-s5pv310/Makefile
>> +++ b/arch/arm/mach-s5pv310/Makefile
>> @@ -30,3 +30,8 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) ? += mach-
>> universal_c210.o
>>
>> ?obj-$(CONFIG_S5PV310_SETUP_I2C1) ? ? += setup-i2c1.o
>> ?obj-$(CONFIG_S5PV310_SETUP_I2C2) ? ? += setup-i2c2.o
>> +obj-$(CONFIG_S5PV310_SETUP_I2C3) ? ? += setup-i2c3.o
>> +obj-$(CONFIG_S5PV310_SETUP_I2C4) ? ? += setup-i2c4.o
>> +obj-$(CONFIG_S5PV310_SETUP_I2C5) ? ? += setup-i2c5.o
>> +obj-$(CONFIG_S5PV310_SETUP_I2C6) ? ? += setup-i2c6.o
>> +obj-$(CONFIG_S5PV310_SETUP_I2C7) ? ? += setup-i2c7.o
>> diff --git a/arch/arm/mach-s5pv310/setup-i2c3.c b/arch/arm/mach-
>> s5pv310/setup-i2c3.c
>> new file mode 100644
>> index 0000000..25e75b6
>> --- /dev/null
>> +++ b/arch/arm/mach-s5pv310/setup-i2c3.c
>> @@ -0,0 +1,25 @@
>> +/*
>> + * linux/arch/arm/mach-s5pv310/setup-i2c3.c
>> + *
>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
>> + *
>> + * I2C3 GPIO configuration.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> +*/
>> +
>> +struct platform_device; /* don't need the contents */
>> +
>> +#include <linux/gpio.h>
>> +#include <plat/iic.h>
>> +#include <plat/gpio-cfg.h>
>> +
>> +void s5p_i2c3_cfg_gpio(struct platform_device *dev)
>> +{
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPA1(2), S3C_GPIO_SFN(3));
>> + ? ? s3c_gpio_setpull(S5PV310_GPA1(2), S3C_GPIO_PULL_UP);
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPA1(3), S3C_GPIO_SFN(3));
>> + ? ? s3c_gpio_setpull(S5PV310_GPA1(3), S3C_GPIO_PULL_UP);
>> +}
>> diff --git a/arch/arm/mach-s5pv310/setup-i2c4.c b/arch/arm/mach-
>> s5pv310/setup-i2c4.c
>> new file mode 100644
>> index 0000000..72b3f68
>> --- /dev/null
>> +++ b/arch/arm/mach-s5pv310/setup-i2c4.c
>> @@ -0,0 +1,25 @@
>> +/*
>> + * linux/arch/arm/mach-s5pv310/setup-i2c4.c
>> + *
>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
>> + *
>> + * I2C4 GPIO configuration.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> +*/
>> +
>> +struct platform_device; /* don't need the contents */
>> +
>> +#include <linux/gpio.h>
>> +#include <plat/iic.h>
>> +#include <plat/gpio-cfg.h>
>> +
>> +void s5p_i2c4_cfg_gpio(struct platform_device *dev)
>> +{
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPB(0), S3C_GPIO_SFN(3));
>> + ? ? s3c_gpio_setpull(S5PV310_GPB(0), S3C_GPIO_PULL_UP);
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPB(1), S3C_GPIO_SFN(3));
>> + ? ? s3c_gpio_setpull(S5PV310_GPB(1), S3C_GPIO_PULL_UP);
>> +}
>> diff --git a/arch/arm/mach-s5pv310/setup-i2c5.c b/arch/arm/mach-
>> s5pv310/setup-i2c5.c
>> new file mode 100644
>> index 0000000..8fb4710
>> --- /dev/null
>> +++ b/arch/arm/mach-s5pv310/setup-i2c5.c
>> @@ -0,0 +1,25 @@
>> +/*
>> + * linux/arch/arm/mach-s5pv310/setup-i2c5.c
>> + *
>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
>> + *
>> + * I2C5 GPIO configuration.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> +*/
>> +
>> +struct platform_device; /* don't need the contents */
>> +
>> +#include <linux/gpio.h>
>> +#include <plat/iic.h>
>> +#include <plat/gpio-cfg.h>
>> +
>> +void s5p_i2c5_cfg_gpio(struct platform_device *dev)
>> +{
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPB(6), S3C_GPIO_SFN(3));
>> + ? ? s3c_gpio_setpull(S5PV310_GPB(6), S3C_GPIO_PULL_UP);
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPB(7), S3C_GPIO_SFN(3));
>> + ? ? s3c_gpio_setpull(S5PV310_GPB(7), S3C_GPIO_PULL_UP);
>> +}
>> diff --git a/arch/arm/mach-s5pv310/setup-i2c6.c b/arch/arm/mach-
>> s5pv310/setup-i2c6.c
>> new file mode 100644
>> index 0000000..a358071
>> --- /dev/null
>> +++ b/arch/arm/mach-s5pv310/setup-i2c6.c
>> @@ -0,0 +1,25 @@
>> +/*
>> + * linux/arch/arm/mach-s5pv310/setup-i2c6.c
>> + *
>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
>> + *
>> + * I2C6 GPIO configuration.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> +*/
>> +
>> +struct platform_device; /* don't need the contents */
>> +
>> +#include <linux/gpio.h>
>> +#include <plat/iic.h>
>> +#include <plat/gpio-cfg.h>
>> +
>> +void s5p_i2c6_cfg_gpio(struct platform_device *dev)
>> +{
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPC1(3), S3C_GPIO_SFN(2));
>> + ? ? s3c_gpio_setpull(S5PV310_GPC1(3), S3C_GPIO_PULL_UP);
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPC1(4), S3C_GPIO_SFN(2));
>> + ? ? s3c_gpio_setpull(S5PV310_GPC1(4), S3C_GPIO_PULL_UP);
>> +}
>> diff --git a/arch/arm/mach-s5pv310/setup-i2c7.c b/arch/arm/mach-
>> s5pv310/setup-i2c7.c
>> new file mode 100644
>> index 0000000..d0bc17c
>> --- /dev/null
>> +++ b/arch/arm/mach-s5pv310/setup-i2c7.c
>> @@ -0,0 +1,25 @@
>> +/*
>> + * linux/arch/arm/mach-s5pv310/setup-i2c7.c
>> + *
>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
>> + *
>> + * I2C7 GPIO configuration.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> +*/
>> +
>> +struct platform_device; /* don't need the contents */
>> +
>> +#include <linux/gpio.h>
>> +#include <plat/iic.h>
>> +#include <plat/gpio-cfg.h>
>> +
>> +void s5p_i2c7_cfg_gpio(struct platform_device *dev)
>> +{
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPD0(2), S3C_GPIO_SFN(3));
>> + ? ? s3c_gpio_setpull(S5PV310_GPD0(2), S3C_GPIO_PULL_UP);
>> + ? ? s3c_gpio_cfgpin(S5PV310_GPD0(3), S3C_GPIO_SFN(3));
>> + ? ? s3c_gpio_setpull(S5PV310_GPD0(3), S3C_GPIO_PULL_UP);
>> +}
>> diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
>> index 2596096..a6e8e65 100644
>> --- a/arch/arm/plat-s5p/Kconfig
>> +++ b/arch/arm/plat-s5p/Kconfig
>> @@ -51,3 +51,28 @@ config S5P_DEV_ONENAND
>> ? ? ? bool
>> ? ? ? help
>> ? ? ? ? Compile in platform device definition for OneNAND controller
>> +
>> +config S5P_DEV_I2C3
>> + ? ? bool
>> + ? ? help
>> + ? ? ? Compile in platform device definition for I2C controller 3
>> +
>> +config S5P_DEV_I2C4
>> + ? ? bool
>> + ? ? help
>> + ? ? ? Compile in platform device definition for I2C controller 4
>> +
>> +config S5P_DEV_I2C5
>> + ? ? bool
>> + ? ? help
>> + ? ? ? Compile in platform device definition for I2C controller 5
>> +
>> +config S5P_DEV_I2C6
>> + ? ? bool
>> + ? ? help
>> + ? ? ? Compile in platform device definition for I2C controller 6
>> +
>> +config S5P_DEV_I2C7
>> + ? ? bool
>> + ? ? help
>> + ? ? ? Compile in platform device definition for I2C controller 7
>> diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
>> index f3e917e..f57fab8 100644
>> --- a/arch/arm/plat-s5p/Makefile
>> +++ b/arch/arm/plat-s5p/Makefile
>> @@ -25,3 +25,8 @@ obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o
>> ?obj-$(CONFIG_S5P_DEV_FIMC1) ?+= dev-fimc1.o
>> ?obj-$(CONFIG_S5P_DEV_FIMC2) ?+= dev-fimc2.o
>> ?obj-$(CONFIG_S5P_DEV_ONENAND) ? ? ? ?+= dev-onenand.o
>> +obj-$(CONFIG_S5P_DEV_I2C3) ? += dev-i2c3.o
>> +obj-$(CONFIG_S5P_DEV_I2C4) ? += dev-i2c4.o
>> +obj-$(CONFIG_S5P_DEV_I2C5) ? += dev-i2c5.o
>> +obj-$(CONFIG_S5P_DEV_I2C6) ? += dev-i2c6.o
>> +obj-$(CONFIG_S5P_DEV_I2C7) ? += dev-i2c7.o
>> diff --git a/arch/arm/plat-s5p/dev-i2c3.c b/arch/arm/plat-s5p/dev-i2c3.c
>> new file mode 100644
>> index 0000000..f92c4ea
>> --- /dev/null
>> +++ b/arch/arm/plat-s5p/dev-i2c3.c
>> @@ -0,0 +1,67 @@
>> +/* linux/arch/arm/plat-s5p/dev-i2c3.c
>> + *
>> + * Copyright(C) 2010 Samsung Electronics
>> + *
>> + * S5P series device definition for i2c device 3
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + */
>> +
>> +#include <linux/gfp.h>
>> +#include <linux/kernel.h>
>> +#include <linux/string.h>
>> +#include <linux/platform_device.h>
>> +
>> +#include <mach/irqs.h>
>> +#include <mach/map.h>
>> +
>> +#include <plat/regs-iic.h>
>> +#include <plat/iic.h>
>> +#include <plat/devs.h>
>> +#include <plat/cpu.h>
>> +
>> +static struct resource s3c_i2c_resource[] = {
>> + ? ? [0] = {
>> + ? ? ? ? ? ? .start = S3C_PA_I2C3,
>> + ? ? ? ? ? ? .end ? = S3C_PA_I2C3 + SZ_4K - 1,
>> + ? ? ? ? ? ? .flags = IORESOURCE_MEM,
>> + ? ? },
>> + ? ? [1] = {
>> + ? ? ? ? ? ? .start = IRQ_I2C3,
>> + ? ? ? ? ? ? .end ? = IRQ_I2C3,
>> + ? ? ? ? ? ? .flags = IORESOURCE_IRQ,
>> + ? ? },
>> +};
>> +
>> +struct platform_device s3c_device_i2c3 = {
>> + ? ? .name ? ? ? ? ? ? = "s3c2440-i2c",
>> + ? ? .id ? ? ? ? ? ? ? = 3,
>> + ? ? .num_resources ? ?= ARRAY_SIZE(s3c_i2c_resource),
>> + ? ? .resource ? ? ? ? = s3c_i2c_resource,
>> +};
>> +
>> +static struct s3c2410_platform_i2c default_i2c_data3 __initdata = {
>> + ? ? .flags ? ? ? ? ?= 0,
>> + ? ? .bus_num ? ? ? ?= 3,
>> + ? ? .slave_addr ? ? = 0x10,
>> + ? ? .frequency ? ? ?= 100*1000,
>> + ? ? .sda_delay ? ? ?= 100,
>> +};
>> +
>> +void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
>> +{
>> + ? ? struct s3c2410_platform_i2c *npd;
>> +
>> + ? ? if (!pd)
>> + ? ? ? ? ? ? pd = &default_i2c_data3;
>> +
>> + ? ? npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
>> + ? ? if (!npd)
>> + ? ? ? ? ? ? printk(KERN_ERR "%s: no memory for platform data\n",
>> __func__);
>> + ? ? else if (!npd->cfg_gpio)
>> + ? ? ? ? ? ? npd->cfg_gpio = s5p_i2c3_cfg_gpio;
>> +
>> + ? ? s3c_device_i2c3.dev.platform_data = npd;
>> +}
>> diff --git a/arch/arm/plat-s5p/dev-i2c4.c b/arch/arm/plat-s5p/dev-i2c4.c
>> new file mode 100644
>> index 0000000..10b5bd1
>> --- /dev/null
>> +++ b/arch/arm/plat-s5p/dev-i2c4.c
>> @@ -0,0 +1,67 @@
>> +/* linux/arch/arm/plat-s5p/dev-i2c4.c
>> + *
>> + * Copyright(C) 2010 Samsung Electronics
>> + *
>> + * S5P series device definition for i2c device 3
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + */
>> +
>> +#include <linux/gfp.h>
>> +#include <linux/kernel.h>
>> +#include <linux/string.h>
>> +#include <linux/platform_device.h>
>> +
>> +#include <mach/irqs.h>
>> +#include <mach/map.h>
>> +
>> +#include <plat/regs-iic.h>
>> +#include <plat/iic.h>
>> +#include <plat/devs.h>
>> +#include <plat/cpu.h>
>> +
>> +static struct resource s3c_i2c_resource[] = {
>> + ? ? [0] = {
>> + ? ? ? ? ? ? .start = S3C_PA_I2C4,
>> + ? ? ? ? ? ? .end ? = S3C_PA_I2C4 + SZ_4K - 1,
>> + ? ? ? ? ? ? .flags = IORESOURCE_MEM,
>> + ? ? },
>> + ? ? [1] = {
>> + ? ? ? ? ? ? .start = IRQ_I2C4,
>> + ? ? ? ? ? ? .end ? = IRQ_I2C4,
>> + ? ? ? ? ? ? .flags = IORESOURCE_IRQ,
>> + ? ? },
>> +};
>> +
>> +struct platform_device s3c_device_i2c4 = {
>> + ? ? .name ? ? ? ? ? ? = "s3c2440-i2c",
>> + ? ? .id ? ? ? ? ? ? ? = 4,
>> + ? ? .num_resources ? ?= ARRAY_SIZE(s3c_i2c_resource),
>> + ? ? .resource ? ? ? ? = s3c_i2c_resource,
>> +};
>> +
>> +static struct s3c2410_platform_i2c default_i2c_data4 __initdata = {
>> + ? ? .flags ? ? ? ? ?= 0,
>> + ? ? .bus_num ? ? ? ?= 4,
>> + ? ? .slave_addr ? ? = 0x10,
>> + ? ? .frequency ? ? ?= 100*1000,
>> + ? ? .sda_delay ? ? ?= 100,
>> +};
>> +
>> +void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
>> +{
>> + ? ? struct s3c2410_platform_i2c *npd;
>> +
>> + ? ? if (!pd)
>> + ? ? ? ? ? ? pd = &default_i2c_data4;
>> +
>> + ? ? npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
>> + ? ? if (!npd)
>> + ? ? ? ? ? ? printk(KERN_ERR "%s: no memory for platform data\n",
>> __func__);
>> + ? ? else if (!npd->cfg_gpio)
>> + ? ? ? ? ? ? npd->cfg_gpio = s5p_i2c4_cfg_gpio;
>> +
>> + ? ? s3c_device_i2c4.dev.platform_data = npd;
>> +}
>> diff --git a/arch/arm/plat-s5p/dev-i2c5.c b/arch/arm/plat-s5p/dev-i2c5.c
>> new file mode 100644
>> index 0000000..a5ab875
>> --- /dev/null
>> +++ b/arch/arm/plat-s5p/dev-i2c5.c
>> @@ -0,0 +1,67 @@
>> +/* linux/arch/arm/plat-s5p/dev-i2c3.c
>> + *
>> + * Copyright(C) 2010 Samsung Electronics
>> + *
>> + * S5P series device definition for i2c device 3
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + */
>> +
>> +#include <linux/gfp.h>
>> +#include <linux/kernel.h>
>> +#include <linux/string.h>
>> +#include <linux/platform_device.h>
>> +
>> +#include <mach/irqs.h>
>> +#include <mach/map.h>
>> +
>> +#include <plat/regs-iic.h>
>> +#include <plat/iic.h>
>> +#include <plat/devs.h>
>> +#include <plat/cpu.h>
>> +
>> +static struct resource s3c_i2c_resource[] = {
>> + ? ? [0] = {
>> + ? ? ? ? ? ? .start = S3C_PA_I2C5,
>> + ? ? ? ? ? ? .end ? = S3C_PA_I2C5 + SZ_4K - 1,
>> + ? ? ? ? ? ? .flags = IORESOURCE_MEM,
>> + ? ? },
>> + ? ? [1] = {
>> + ? ? ? ? ? ? .start = IRQ_I2C5,
>> + ? ? ? ? ? ? .end ? = IRQ_I2C5,
>> + ? ? ? ? ? ? .flags = IORESOURCE_IRQ,
>> + ? ? },
>> +};
>> +
>> +struct platform_device s3c_device_i2c5 = {
>> + ? ? .name ? ? ? ? ? ? = "s3c2440-i2c",
>> + ? ? .id ? ? ? ? ? ? ? = 5,
>> + ? ? .num_resources ? ?= ARRAY_SIZE(s3c_i2c_resource),
>> + ? ? .resource ? ? ? ? = s3c_i2c_resource,
>> +};
>> +
>> +static struct s3c2410_platform_i2c default_i2c_data5 __initdata = {
>> + ? ? .flags ? ? ? ? ?= 0,
>> + ? ? .bus_num ? ? ? ?= 5,
>> + ? ? .slave_addr ? ? = 0x10,
>> + ? ? .frequency ? ? ?= 100*1000,
>> + ? ? .sda_delay ? ? ?= 100,
>> +};
>> +
>> +void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
>> +{
>> + ? ? struct s3c2410_platform_i2c *npd;
>> +
>> + ? ? if (!pd)
>> + ? ? ? ? ? ? pd = &default_i2c_data5;
>> +
>> + ? ? npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
>> + ? ? if (!npd)
>> + ? ? ? ? ? ? printk(KERN_ERR "%s: no memory for platform data\n",
>> __func__);
>> + ? ? else if (!npd->cfg_gpio)
>> + ? ? ? ? ? ? npd->cfg_gpio = s5p_i2c5_cfg_gpio;
>> +
>> + ? ? s3c_device_i2c5.dev.platform_data = npd;
>> +}
>> diff --git a/arch/arm/plat-s5p/dev-i2c6.c b/arch/arm/plat-s5p/dev-i2c6.c
>> new file mode 100644
>> index 0000000..3c29a9b
>> --- /dev/null
>> +++ b/arch/arm/plat-s5p/dev-i2c6.c
>> @@ -0,0 +1,67 @@
>> +/* linux/arch/arm/plat-s5p/dev-i2c6.c
>> + *
>> + * Copyright(C) 2010 Samsung Electronics
>> + *
>> + * S5P series device definition for i2c device 6
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + */
>> +
>> +#include <linux/gfp.h>
>> +#include <linux/kernel.h>
>> +#include <linux/string.h>
>> +#include <linux/platform_device.h>
>> +
>> +#include <mach/irqs.h>
>> +#include <mach/map.h>
>> +
>> +#include <plat/regs-iic.h>
>> +#include <plat/iic.h>
>> +#include <plat/devs.h>
>> +#include <plat/cpu.h>
>> +
>> +static struct resource s3c_i2c_resource[] = {
>> + ? ? [0] = {
>> + ? ? ? ? ? ? .start = S3C_PA_I2C6,
>> + ? ? ? ? ? ? .end ? = S3C_PA_I2C6 + SZ_4K - 1,
>> + ? ? ? ? ? ? .flags = IORESOURCE_MEM,
>> + ? ? },
>> + ? ? [1] = {
>> + ? ? ? ? ? ? .start = IRQ_I2C6,
>> + ? ? ? ? ? ? .end ? = IRQ_I2C6,
>> + ? ? ? ? ? ? .flags = IORESOURCE_IRQ,
>> + ? ? },
>> +};
>> +
>> +struct platform_device s3c_device_i2c6 = {
>> + ? ? .name ? ? ? ? ? ? = "s3c2440-i2c",
>> + ? ? .id ? ? ? ? ? ? ? = 6,
>> + ? ? .num_resources ? ?= ARRAY_SIZE(s3c_i2c_resource),
>> + ? ? .resource ? ? ? ? = s3c_i2c_resource,
>> +};
>> +
>> +static struct s3c2410_platform_i2c default_i2c_data6 __initdata = {
>> + ? ? .flags ? ? ? ? ?= 0,
>> + ? ? .bus_num ? ? ? ?= 6,
>> + ? ? .slave_addr ? ? = 0x10,
>> + ? ? .frequency ? ? ?= 100*1000,
>> + ? ? .sda_delay ? ? ?= 100,
>> +};
>> +
>> +void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
>> +{
>> + ? ? struct s3c2410_platform_i2c *npd;
>> +
>> + ? ? if (!pd)
>> + ? ? ? ? ? ? pd = &default_i2c_data6;
>> +
>> + ? ? npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
>> + ? ? if (!npd)
>> + ? ? ? ? ? ? printk(KERN_ERR "%s: no memory for platform data\n",
>> __func__);
>> + ? ? else if (!npd->cfg_gpio)
>> + ? ? ? ? ? ? npd->cfg_gpio = s5p_i2c6_cfg_gpio;
>> +
>> + ? ? s3c_device_i2c6.dev.platform_data = npd;
>> +}
>> diff --git a/arch/arm/plat-s5p/dev-i2c7.c b/arch/arm/plat-s5p/dev-i2c7.c
>> new file mode 100644
>> index 0000000..98139a5
>> --- /dev/null
>> +++ b/arch/arm/plat-s5p/dev-i2c7.c
>> @@ -0,0 +1,67 @@
>> +/* linux/arch/arm/plat-s5p/dev-i2c7.c
>> + *
>> + * Copyright(C) 2010 Samsung Electronics
>> + *
>> + * S5P series device definition for i2c device 7
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + */
>> +
>> +#include <linux/gfp.h>
>> +#include <linux/kernel.h>
>> +#include <linux/string.h>
>> +#include <linux/platform_device.h>
>> +
>> +#include <mach/irqs.h>
>> +#include <mach/map.h>
>> +
>> +#include <plat/regs-iic.h>
>> +#include <plat/iic.h>
>> +#include <plat/devs.h>
>> +#include <plat/cpu.h>
>> +
>> +static struct resource s3c_i2c_resource[] = {
>> + ? ? [0] = {
>> + ? ? ? ? ? ? .start = S3C_PA_I2C7,
>> + ? ? ? ? ? ? .end ? = S3C_PA_I2C7 + SZ_4K - 1,
>> + ? ? ? ? ? ? .flags = IORESOURCE_MEM,
>> + ? ? },
>> + ? ? [1] = {
>> + ? ? ? ? ? ? .start = IRQ_I2C7,
>> + ? ? ? ? ? ? .end ? = IRQ_I2C7,
>> + ? ? ? ? ? ? .flags = IORESOURCE_IRQ,
>> + ? ? },
>> +};
>> +
>> +struct platform_device s3c_device_i2c7 = {
>> + ? ? .name ? ? ? ? ? ? = "s3c2440-i2c",
>> + ? ? .id ? ? ? ? ? ? ? = 7,
>> + ? ? .num_resources ? ?= ARRAY_SIZE(s3c_i2c_resource),
>> + ? ? .resource ? ? ? ? = s3c_i2c_resource,
>> +};
>> +
>> +static struct s3c2410_platform_i2c default_i2c_data7 __initdata = {
>> + ? ? .flags ? ? ? ? ?= 0,
>> + ? ? .bus_num ? ? ? ?= 7,
>> + ? ? .slave_addr ? ? = 0x10,
>> + ? ? .frequency ? ? ?= 100*1000,
>> + ? ? .sda_delay ? ? ?= 100,
>> +};
>> +
>> +void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
>> +{
>> + ? ? struct s3c2410_platform_i2c *npd;
>> +
>> + ? ? if (!pd)
>> + ? ? ? ? ? ? pd = &default_i2c_data7;
>> +
>> + ? ? npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
>> + ? ? if (!npd)
>> + ? ? ? ? ? ? printk(KERN_ERR "%s: no memory for platform data\n",
>> __func__);
>> + ? ? else if (!npd->cfg_gpio)
>> + ? ? ? ? ? ? npd->cfg_gpio = s5p_i2c7_cfg_gpio;
>> +
>> + ? ? s3c_device_i2c7.dev.platform_data = npd;
>> +}
>> diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-
>> samsung/include/plat/iic.h
>> index 133308b..893f6a1 100644
>> --- a/arch/arm/plat-samsung/include/plat/iic.h
>> +++ b/arch/arm/plat-samsung/include/plat/iic.h
>> @@ -60,5 +60,10 @@ extern void s3c_i2c2_set_platdata(struct
>> s3c2410_platform_i2c *i2c);
>> ?extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
>> ?extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
>> ?extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
>> +extern void s5p_i2c3_cfg_gpio(struct platform_device *dev);
>> +extern void s5p_i2c4_cfg_gpio(struct platform_device *dev);
>> +extern void s5p_i2c5_cfg_gpio(struct platform_device *dev);
>> +extern void s5p_i2c6_cfg_gpio(struct platform_device *dev);
>> +extern void s5p_i2c7_cfg_gpio(struct platform_device *dev);
>>
>> ?#endif /* __ASM_ARCH_IIC_H */
>> --
>> 1.5.3.3
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 6:27 ` Kyungmin Park
@ 2010-09-30 6:50 ` Jassi Brar
2010-09-30 7:38 ` Kyungmin Park
2010-09-30 11:43 ` Marek Szyprowski
0 siblings, 2 replies; 17+ messages in thread
From: Jassi Brar @ 2010-09-30 6:50 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <kmpark@infradead.org> wrote:
> On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo <jeongbae.seo@samsung.com> wrote:
>> Kyungmin wrote:
>>> From: Kyungmin Park <kyungmin.park@samsung.com>
>>>
>>> S5PC210 support more I2C devices than previous SoCs.
>>> And to prevent the wrong usage use the s5p prefix instead of s3c.
>>>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>> ?arch/arm/mach-s5pv310/Kconfig ? ? ? ? ? ?| ? 15 +++++++
>>> ?arch/arm/mach-s5pv310/Makefile ? ? ? ? ? | ? ?5 ++
>>> ?arch/arm/mach-s5pv310/setup-i2c3.c ? ? ? | ? 25 +++++++++++
>>> ?arch/arm/mach-s5pv310/setup-i2c4.c ? ? ? | ? 25 +++++++++++
>>> ?arch/arm/mach-s5pv310/setup-i2c5.c ? ? ? | ? 25 +++++++++++
>>> ?arch/arm/mach-s5pv310/setup-i2c6.c ? ? ? | ? 25 +++++++++++
>>> ?arch/arm/mach-s5pv310/setup-i2c7.c ? ? ? | ? 25 +++++++++++
>>> ?arch/arm/plat-s5p/Kconfig ? ? ? ? ? ? ? ?| ? 25 +++++++++++
>>> ?arch/arm/plat-s5p/Makefile ? ? ? ? ? ? ? | ? ?5 ++
>>> ?arch/arm/plat-s5p/dev-i2c3.c ? ? ? ? ? ? | ? 67
>>> ++++++++++++++++++++++++++++++
>>> ?arch/arm/plat-s5p/dev-i2c4.c ? ? ? ? ? ? | ? 67
>>> ++++++++++++++++++++++++++++++
>>> ?arch/arm/plat-s5p/dev-i2c5.c ? ? ? ? ? ? | ? 67
>>> ++++++++++++++++++++++++++++++
>>> ?arch/arm/plat-s5p/dev-i2c6.c ? ? ? ? ? ? | ? 67
>>> ++++++++++++++++++++++++++++++
>>> ?arch/arm/plat-s5p/dev-i2c7.c ? ? ? ? ? ? | ? 67
>>> ++++++++++++++++++++++++++++++
>>> ?arch/arm/plat-samsung/include/plat/iic.h | ? ?5 ++
>>> ?15 files changed, 515 insertions(+), 0 deletions(-)
>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
>>>
>>
>> Hi Kyungmin,
>>
>> We are considering another way not to make additional new i2c dev files.
>> In my opinion, this patch looks not bad but we'd better make an effort to
>> avoid having the more similar file.
>
> Actually I also it's not good approach, but as there's no comment or
> discuss about this I send the patches.
> http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/022615.html
>
> If you have good method or approaches, I'm welcome.
First, these are device definitions and gpio set callbacks and
shouldn't take much
of space. So, perhaps these all could be built upon single I2C support
selection.
Second, if we must build them conditionally, how about having all in
one file with
each device's definition and callback surrounded by corresponding ifdef ?
That would alteast save us file-count.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 6:50 ` Jassi Brar
@ 2010-09-30 7:38 ` Kyungmin Park
2010-09-30 9:27 ` Jongsun Han
2010-09-30 11:43 ` Marek Szyprowski
1 sibling, 1 reply; 17+ messages in thread
From: Kyungmin Park @ 2010-09-30 7:38 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <kmpark@infradead.org> wrote:
>> On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo <jeongbae.seo@samsung.com> wrote:
>>> Kyungmin wrote:
>>>> From: Kyungmin Park <kyungmin.park@samsung.com>
>>>>
>>>> S5PC210 support more I2C devices than previous SoCs.
>>>> And to prevent the wrong usage use the s5p prefix instead of s3c.
>>>>
>>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>>> ---
>>>> ?arch/arm/mach-s5pv310/Kconfig ? ? ? ? ? ?| ? 15 +++++++
>>>> ?arch/arm/mach-s5pv310/Makefile ? ? ? ? ? | ? ?5 ++
>>>> ?arch/arm/mach-s5pv310/setup-i2c3.c ? ? ? | ? 25 +++++++++++
>>>> ?arch/arm/mach-s5pv310/setup-i2c4.c ? ? ? | ? 25 +++++++++++
>>>> ?arch/arm/mach-s5pv310/setup-i2c5.c ? ? ? | ? 25 +++++++++++
>>>> ?arch/arm/mach-s5pv310/setup-i2c6.c ? ? ? | ? 25 +++++++++++
>>>> ?arch/arm/mach-s5pv310/setup-i2c7.c ? ? ? | ? 25 +++++++++++
>>>> ?arch/arm/plat-s5p/Kconfig ? ? ? ? ? ? ? ?| ? 25 +++++++++++
>>>> ?arch/arm/plat-s5p/Makefile ? ? ? ? ? ? ? | ? ?5 ++
>>>> ?arch/arm/plat-s5p/dev-i2c3.c ? ? ? ? ? ? | ? 67
>>>> ++++++++++++++++++++++++++++++
>>>> ?arch/arm/plat-s5p/dev-i2c4.c ? ? ? ? ? ? | ? 67
>>>> ++++++++++++++++++++++++++++++
>>>> ?arch/arm/plat-s5p/dev-i2c5.c ? ? ? ? ? ? | ? 67
>>>> ++++++++++++++++++++++++++++++
>>>> ?arch/arm/plat-s5p/dev-i2c6.c ? ? ? ? ? ? | ? 67
>>>> ++++++++++++++++++++++++++++++
>>>> ?arch/arm/plat-s5p/dev-i2c7.c ? ? ? ? ? ? | ? 67
>>>> ++++++++++++++++++++++++++++++
>>>> ?arch/arm/plat-samsung/include/plat/iic.h | ? ?5 ++
>>>> ?15 files changed, 515 insertions(+), 0 deletions(-)
>>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
>>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
>>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
>>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
>>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
>>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
>>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
>>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
>>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
>>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
>>>>
>>>
>>> Hi Kyungmin,
>>>
>>> We are considering another way not to make additional new i2c dev files.
>>> In my opinion, this patch looks not bad but we'd better make an effort to
>>> avoid having the more similar file.
>>
>> Actually I also it's not good approach, but as there's no comment or
>> discuss about this I send the patches.
>> http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/022615.html
>>
>> If you have good method or approaches, I'm welcome.
>
> First, these are device definitions and gpio set callbacks and
> shouldn't take much
> of space. So, perhaps these all could be built upon single I2C support
> selection.
That's my first propose.
>
> Second, if we must build them conditionally, how about having all in
> one file with
> each device's definition and callback surrounded by corresponding ifdef ?
> That would alteast save us file-count.
This method is also no problem if all of person are agreed.
So just choose it and make a conclusion.
Thank you,
Kyungmin Park
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 7:38 ` Kyungmin Park
@ 2010-09-30 9:27 ` Jongsun Han
2010-09-30 9:48 ` Kyungmin Park
0 siblings, 1 reply; 17+ messages in thread
From: Jongsun Han @ 2010-09-30 9:27 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> > On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <kmpark@infradead.org> wrote:
> >> On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo <jeongbae.seo@samsung.com>
> wrote:
> >>> Kyungmin wrote:
> >>>> From: Kyungmin Park <kyungmin.park@samsung.com>
> >>>>
> >>>> S5PC210 support more I2C devices than previous SoCs.
> >>>> And to prevent the wrong usage use the s5p prefix instead of s3c.
> >>>>
> >>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >>>> ---
> >>>> ?arch/arm/mach-s5pv310/Kconfig ? ? ? ? ? ?| ? 15 +++++++
> >>>> ?arch/arm/mach-s5pv310/Makefile ? ? ? ? ? | ? ?5 ++
> >>>> ?arch/arm/mach-s5pv310/setup-i2c3.c ? ? ? | ? 25 +++++++++++
> >>>> ?arch/arm/mach-s5pv310/setup-i2c4.c ? ? ? | ? 25 +++++++++++
> >>>> ?arch/arm/mach-s5pv310/setup-i2c5.c ? ? ? | ? 25 +++++++++++
> >>>> ?arch/arm/mach-s5pv310/setup-i2c6.c ? ? ? | ? 25 +++++++++++
> >>>> ?arch/arm/mach-s5pv310/setup-i2c7.c ? ? ? | ? 25 +++++++++++
> >>>> ?arch/arm/plat-s5p/Kconfig ? ? ? ? ? ? ? ?| ? 25 +++++++++++
> >>>> ?arch/arm/plat-s5p/Makefile ? ? ? ? ? ? ? | ? ?5 ++
> >>>> ?arch/arm/plat-s5p/dev-i2c3.c ? ? ? ? ? ? | ? 67
> >>>> ++++++++++++++++++++++++++++++
> >>>> ?arch/arm/plat-s5p/dev-i2c4.c ? ? ? ? ? ? | ? 67
> >>>> ++++++++++++++++++++++++++++++
> >>>> ?arch/arm/plat-s5p/dev-i2c5.c ? ? ? ? ? ? | ? 67
> >>>> ++++++++++++++++++++++++++++++
> >>>> ?arch/arm/plat-s5p/dev-i2c6.c ? ? ? ? ? ? | ? 67
> >>>> ++++++++++++++++++++++++++++++
> >>>> ?arch/arm/plat-s5p/dev-i2c7.c ? ? ? ? ? ? | ? 67
> >>>> ++++++++++++++++++++++++++++++
> >>>> ?arch/arm/plat-samsung/include/plat/iic.h | ? ?5 ++
> >>>> ?15 files changed, 515 insertions(+), 0 deletions(-)
> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
> >>>>
> >>>
> >>> Hi Kyungmin,
> >>>
> >>> We are considering another way not to make additional new i2c dev files.
> >>> In my opinion, this patch looks not bad but we'd better make an effort to
> >>> avoid having the more similar file.
> >>
> >> Actually I also it's not good approach, but as there's no comment or
> >> discuss about this I send the patches.
> >> http://lists.infradead.org/pipermail/linux-arm-kernel/2010-
> August/022615.html
> >>
> >> If you have good method or approaches, I'm welcome.
> >
> > First, these are device definitions and gpio set callbacks and
> > shouldn't take much
> > of space. So, perhaps these all could be built upon single I2C support
> > selection.
>
> That's my first propose.
Hi, Kyungmin and Jassi
I think that parts of i2c in S5PV310 aren't used depending on the usage of
S5PV310.
It's better define the number of i2c devs being used instead of using single I2C
support selection.
> >
> > Second, if we must build them conditionally, how about having all in
> > one file with
> > each device's definition and callback surrounded by corresponding ifdef ?
> > That would alteast save us file-count.
>
> This method is also no problem if all of person are agreed.
>
> So just choose it and make a conclusion.
>
> Thank you,
> Kyungmin Park
> >
I agree with Jassi's opinion keeping setup-i2c(0..2) and dev-i2c(0..2) for
backward
compatibility and adding a file which handles i2c(0..7) for S5PV310 and coming
Samsung
soc.
Best Regards
Jongsun Han
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 9:27 ` Jongsun Han
@ 2010-09-30 9:48 ` Kyungmin Park
2010-09-30 10:19 ` Jongsun Han
0 siblings, 1 reply; 17+ messages in thread
From: Kyungmin Park @ 2010-09-30 9:48 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <jongsun.han@samsung.com> wrote:
> On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>> > On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <kmpark@infradead.org> wrote:
>> >> On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo <jeongbae.seo@samsung.com>
>> wrote:
>> >>> Kyungmin wrote:
>> >>>> From: Kyungmin Park <kyungmin.park@samsung.com>
>> >>>>
>> >>>> S5PC210 support more I2C devices than previous SoCs.
>> >>>> And to prevent the wrong usage use the s5p prefix instead of s3c.
>> >>>>
>> >>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> >>>> ---
>> >>>> ?arch/arm/mach-s5pv310/Kconfig ? ? ? ? ? ?| ? 15 +++++++
>> >>>> ?arch/arm/mach-s5pv310/Makefile ? ? ? ? ? | ? ?5 ++
>> >>>> ?arch/arm/mach-s5pv310/setup-i2c3.c ? ? ? | ? 25 +++++++++++
>> >>>> ?arch/arm/mach-s5pv310/setup-i2c4.c ? ? ? | ? 25 +++++++++++
>> >>>> ?arch/arm/mach-s5pv310/setup-i2c5.c ? ? ? | ? 25 +++++++++++
>> >>>> ?arch/arm/mach-s5pv310/setup-i2c6.c ? ? ? | ? 25 +++++++++++
>> >>>> ?arch/arm/mach-s5pv310/setup-i2c7.c ? ? ? | ? 25 +++++++++++
>> >>>> ?arch/arm/plat-s5p/Kconfig ? ? ? ? ? ? ? ?| ? 25 +++++++++++
>> >>>> ?arch/arm/plat-s5p/Makefile ? ? ? ? ? ? ? | ? ?5 ++
>> >>>> ?arch/arm/plat-s5p/dev-i2c3.c ? ? ? ? ? ? | ? 67
>> >>>> ++++++++++++++++++++++++++++++
>> >>>> ?arch/arm/plat-s5p/dev-i2c4.c ? ? ? ? ? ? | ? 67
>> >>>> ++++++++++++++++++++++++++++++
>> >>>> ?arch/arm/plat-s5p/dev-i2c5.c ? ? ? ? ? ? | ? 67
>> >>>> ++++++++++++++++++++++++++++++
>> >>>> ?arch/arm/plat-s5p/dev-i2c6.c ? ? ? ? ? ? | ? 67
>> >>>> ++++++++++++++++++++++++++++++
>> >>>> ?arch/arm/plat-s5p/dev-i2c7.c ? ? ? ? ? ? | ? 67
>> >>>> ++++++++++++++++++++++++++++++
>> >>>> ?arch/arm/plat-samsung/include/plat/iic.h | ? ?5 ++
>> >>>> ?15 files changed, 515 insertions(+), 0 deletions(-)
>> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
>> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
>> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
>> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
>> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
>> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
>> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
>> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
>> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
>> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
>> >>>>
>> >>>
>> >>> Hi Kyungmin,
>> >>>
>> >>> We are considering another way not to make additional new i2c dev files.
>> >>> In my opinion, this patch looks not bad but we'd better make an effort to
>> >>> avoid having the more similar file.
>> >>
>> >> Actually I also it's not good approach, but as there's no comment or
>> >> discuss about this I send the patches.
>> >> http://lists.infradead.org/pipermail/linux-arm-kernel/2010-
>> August/022615.html
>> >>
>> >> If you have good method or approaches, I'm welcome.
>> >
>> > First, these are device definitions and gpio set callbacks and
>> > shouldn't take much
>> > of space. So, perhaps these all could be built upon single I2C support
>> > selection.
>>
>> That's my first propose.
>
> Hi, Kyungmin and Jassi
>
> I think that parts of i2c in S5PV310 aren't used depending on the usage of
> S5PV310.
> It's better define the number of i2c devs being used instead of using single I2C
> support selection.
Can you tell me in detail? I don't know what do you mean?
and FYI, universal board uses all I2Cs except I2C2.
>
>> >
>> > Second, if we must build them conditionally, how about having all in
>> > one file with
>> > each device's definition and callback surrounded by corresponding ifdef ?
>> > That would alteast save us file-count.
>>
>> This method is also no problem if all of person are agreed.
>>
>> So just choose it and make a conclusion.
>>
>> Thank you,
>> Kyungmin Park
>> >
>
> I agree with Jassi's opinion keeping setup-i2c(0..2) and dev-i2c(0..2) for
> backward compatibility and
Of course it should be. and there's no code to brake the existing codes.
> adding a file which handles i2c(0..7) for S5PV310 and coming
> Samsung
> soc.
Do you mean create the new i2c[0-7] for s5pv310?
I think it's better to give some example how to implement as your word.
>
> Best Regards
> Jongsun Han
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 9:48 ` Kyungmin Park
@ 2010-09-30 10:19 ` Jongsun Han
2010-09-30 10:40 ` Kyungmin Park
0 siblings, 1 reply; 17+ messages in thread
From: Jongsun Han @ 2010-09-30 10:19 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <jongsun.han@samsung.com>
> wrote:
> > On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar <jassisinghbrar@gmail.com>
> wrote:
> >> > On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <kmpark@infradead.org>
> wrote:
> >> >> On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo
> <jeongbae.seo@samsung.com>
> >> wrote:
> >> >>> Kyungmin wrote:
> >> >>>> From: Kyungmin Park <kyungmin.park@samsung.com>
> >> >>>>
> >> >>>> S5PC210 support more I2C devices than previous SoCs.
> >> >>>> And to prevent the wrong usage use the s5p prefix instead of s3c.
> >> >>>>
> >> >>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >> >>>> ---
> >> >>>> ?arch/arm/mach-s5pv310/Kconfig ? ? ? ? ? ?| ? 15 +++++++
> >> >>>> ?arch/arm/mach-s5pv310/Makefile ? ? ? ? ? | ? ?5 ++
> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c3.c ? ? ? | ? 25 +++++++++++
> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c4.c ? ? ? | ? 25 +++++++++++
> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c5.c ? ? ? | ? 25 +++++++++++
> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c6.c ? ? ? | ? 25 +++++++++++
> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c7.c ? ? ? | ? 25 +++++++++++
> >> >>>> ?arch/arm/plat-s5p/Kconfig ? ? ? ? ? ? ? ?| ? 25 +++++++++++
> >> >>>> ?arch/arm/plat-s5p/Makefile ? ? ? ? ? ? ? | ? ?5 ++
> >> >>>> ?arch/arm/plat-s5p/dev-i2c3.c ? ? ? ? ? ? | ? 67
> >> >>>> ++++++++++++++++++++++++++++++
> >> >>>> ?arch/arm/plat-s5p/dev-i2c4.c ? ? ? ? ? ? | ? 67
> >> >>>> ++++++++++++++++++++++++++++++
> >> >>>> ?arch/arm/plat-s5p/dev-i2c5.c ? ? ? ? ? ? | ? 67
> >> >>>> ++++++++++++++++++++++++++++++
> >> >>>> ?arch/arm/plat-s5p/dev-i2c6.c ? ? ? ? ? ? | ? 67
> >> >>>> ++++++++++++++++++++++++++++++
> >> >>>> ?arch/arm/plat-s5p/dev-i2c7.c ? ? ? ? ? ? | ? 67
> >> >>>> ++++++++++++++++++++++++++++++
> >> >>>> ?arch/arm/plat-samsung/include/plat/iic.h | ? ?5 ++
> >> >>>> ?15 files changed, 515 insertions(+), 0 deletions(-)
> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
> >> >>>>
> >> >>>
> >> >>> Hi Kyungmin,
> >> >>>
> >> >>> We are considering another way not to make additional new i2c dev
> files.
> >> >>> In my opinion, this patch looks not bad but we'd better make an
> effort to
> >> >>> avoid having the more similar file.
> >> >>
> >> >> Actually I also it's not good approach, but as there's no comment or
> >> >> discuss about this I send the patches.
> >> >> http://lists.infradead.org/pipermail/linux-arm-kernel/2010-
> >> August/022615.html
> >> >>
> >> >> If you have good method or approaches, I'm welcome.
> >> >
> >> > First, these are device definitions and gpio set callbacks and
> >> > shouldn't take much
> >> > of space. So, perhaps these all could be built upon single I2C
> support
> >> > selection.
> >>
> >> That's my first propose.
> >
> > Hi, Kyungmin and Jassi
> >
> > I think that parts of i2c in S5PV310 aren't used depending on the usage
> of
> > S5PV310.
> > It's better define the number of i2c devs being used instead of using
> single I2C
> > support selection.
>
> Can you tell me in detail? I don't know what do you mean?
> and FYI, universal board uses all I2Cs except I2C2.
>
For example,
If i2c(0..4) except 2 are used in S5PV310, set the number of i2c dev as 5.
Then only i2c(0..4) are built without building i2c(5..7).
> >
> >> >
> >> > Second, if we must build them conditionally, how about having all in
> >> > one file with
> >> > each device's definition and callback surrounded by corresponding
> ifdef ?
> >> > That would alteast save us file-count.
> >>
> >> This method is also no problem if all of person are agreed.
> >>
> >> So just choose it and make a conclusion.
> >>
> >> Thank you,
> >> Kyungmin Park
> >> >
> >
> > I agree with Jassi's opinion keeping setup-i2c(0..2) and dev-i2c(0..2)
> for
> > backward compatibility and
>
> Of course it should be. and there's no code to brake the existing codes.
>
> > adding a file which handles i2c(0..7) for S5PV310 and coming
> > Samsung
> > soc.
>
> Do you mean create the new i2c[0-7] for s5pv310?
> I think it's better to give some example how to implement as your word.
>
set-i2c.c in S5PV310 machine directory sets all i2c related gpio.
dev-i2c.c which is created in plat directory sets all i2c devs plat data.
> >
> > Best Regards
> > Jongsun Han
> >
> >
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 10:19 ` Jongsun Han
@ 2010-09-30 10:40 ` Kyungmin Park
2010-09-30 10:48 ` Kukjin Kim
0 siblings, 1 reply; 17+ messages in thread
From: Kyungmin Park @ 2010-09-30 10:40 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 7:19 PM, Jongsun Han <jongsun.han@samsung.com> wrote:
> On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <jongsun.han@samsung.com>
>> wrote:
>> > On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar <jassisinghbrar@gmail.com>
>> wrote:
>> >> > On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <kmpark@infradead.org>
>> wrote:
>> >> >> On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo
>> <jeongbae.seo@samsung.com>
>> >> wrote:
>> >> >>> Kyungmin wrote:
>> >> >>>> From: Kyungmin Park <kyungmin.park@samsung.com>
>> >> >>>>
>> >> >>>> S5PC210 support more I2C devices than previous SoCs.
>> >> >>>> And to prevent the wrong usage use the s5p prefix instead of s3c.
>> >> >>>>
>> >> >>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> >> >>>> ---
>> >> >>>> ?arch/arm/mach-s5pv310/Kconfig ? ? ? ? ? ?| ? 15 +++++++
>> >> >>>> ?arch/arm/mach-s5pv310/Makefile ? ? ? ? ? | ? ?5 ++
>> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c3.c ? ? ? | ? 25 +++++++++++
>> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c4.c ? ? ? | ? 25 +++++++++++
>> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c5.c ? ? ? | ? 25 +++++++++++
>> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c6.c ? ? ? | ? 25 +++++++++++
>> >> >>>> ?arch/arm/mach-s5pv310/setup-i2c7.c ? ? ? | ? 25 +++++++++++
>> >> >>>> ?arch/arm/plat-s5p/Kconfig ? ? ? ? ? ? ? ?| ? 25 +++++++++++
>> >> >>>> ?arch/arm/plat-s5p/Makefile ? ? ? ? ? ? ? | ? ?5 ++
>> >> >>>> ?arch/arm/plat-s5p/dev-i2c3.c ? ? ? ? ? ? | ? 67
>> >> >>>> ++++++++++++++++++++++++++++++
>> >> >>>> ?arch/arm/plat-s5p/dev-i2c4.c ? ? ? ? ? ? | ? 67
>> >> >>>> ++++++++++++++++++++++++++++++
>> >> >>>> ?arch/arm/plat-s5p/dev-i2c5.c ? ? ? ? ? ? | ? 67
>> >> >>>> ++++++++++++++++++++++++++++++
>> >> >>>> ?arch/arm/plat-s5p/dev-i2c6.c ? ? ? ? ? ? | ? 67
>> >> >>>> ++++++++++++++++++++++++++++++
>> >> >>>> ?arch/arm/plat-s5p/dev-i2c7.c ? ? ? ? ? ? | ? 67
>> >> >>>> ++++++++++++++++++++++++++++++
>> >> >>>> ?arch/arm/plat-samsung/include/plat/iic.h | ? ?5 ++
>> >> >>>> ?15 files changed, 515 insertions(+), 0 deletions(-)
>> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
>> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
>> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
>> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
>> >> >>>> ?create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
>> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
>> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
>> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
>> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
>> >> >>>> ?create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
>> >> >>>>
>> >> >>>
>> >> >>> Hi Kyungmin,
>> >> >>>
>> >> >>> We are considering another way not to make additional new i2c dev
>> files.
>> >> >>> In my opinion, this patch looks not bad but we'd better make an
>> effort to
>> >> >>> avoid having the more similar file.
>> >> >>
>> >> >> Actually I also it's not good approach, but as there's no comment or
>> >> >> discuss about this I send the patches.
>> >> >> http://lists.infradead.org/pipermail/linux-arm-kernel/2010-
>> >> August/022615.html
>> >> >>
>> >> >> If you have good method or approaches, I'm welcome.
>> >> >
>> >> > First, these are device definitions and gpio set callbacks and
>> >> > shouldn't take much
>> >> > of space. So, perhaps these all could be built upon single I2C
>> support
>> >> > selection.
>> >>
>> >> That's my first propose.
>> >
>> > Hi, Kyungmin and Jassi
>> >
>> > I think that parts of i2c in S5PV310 aren't used depending on the usage
>> of
>> > S5PV310.
>> > It's better define the number of i2c devs being used instead of using
>> single I2C
>> > support selection.
>>
>> Can you tell me in detail? I don't know what do you mean?
>> and FYI, universal board uses all I2Cs except I2C2.
>>
>
> For example,
> If i2c(0..4) except 2 are used in S5PV310, set the number of i2c dev as 5.
> Then only i2c(0..4) are built without building i2c(5..7).
then what's the condition of I2C2?
If it don't use i2c2 and i2c3, then how to configure it?
>
>> >
>> >> >
>> >> > Second, if we must build them conditionally, how about having all in
>> >> > one file with
>> >> > each device's definition and callback surrounded by corresponding
>> ifdef ?
>> >> > That would alteast save us file-count.
>> >>
>> >> This method is also no problem if all of person are agreed.
>> >>
>> >> So just choose it and make a conclusion.
>> >>
>> >> Thank you,
>> >> Kyungmin Park
>> >> >
>> >
>> > I agree with Jassi's opinion keeping setup-i2c(0..2) and dev-i2c(0..2)
>> for
>> > backward compatibility and
>>
>> Of course it should be. and there's no code to brake the existing codes.
>>
>> > adding a file which handles i2c(0..7) for S5PV310 and coming
>> > Samsung
>> > soc.
>>
>> Do you mean create the new i2c[0-7] for s5pv310?
>> I think it's better to give some example how to implement as your word.
>>
>
> set-i2c.c in S5PV310 machine directory sets all i2c related gpio.
> dev-i2c.c which is created in plat directory sets all i2c devs plat data.
You mean use the #ifdef ~ #endif for each I2Cs.
To Kgene,
Any comments? I think you already mentioned that don't use #ifdef ~
#endif at c files if possible.
In this case are you okay?
Thank you,
Kyungmin Park
>
>> >
>> > Best Regards
>> > Jongsun Han
>> >
>> >
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 10:40 ` Kyungmin Park
@ 2010-09-30 10:48 ` Kukjin Kim
2010-09-30 10:50 ` Kyungmin Park
0 siblings, 1 reply; 17+ messages in thread
From: Kukjin Kim @ 2010-09-30 10:48 UTC (permalink / raw)
To: linux-arm-kernel
Kyungmin Park wrote:
>
> On Thu, Sep 30, 2010 at 7:19 PM, Jongsun Han <jongsun.han@samsung.com>
> wrote:
> > On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <jongsun.han@samsung.com>
> >> wrote:
> >> > On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar
<jassisinghbrar@gmail.com>
> >> wrote:
> >> >> > On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park
> <kmpark@infradead.org>
> >> wrote:
> >> >> >> On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo
> >> <jeongbae.seo@samsung.com>
> >> >> wrote:
> >> >> >>> Kyungmin wrote:
> >> >> >>>> From: Kyungmin Park <kyungmin.park@samsung.com>
> >> >> >>>>
> >> >> >>>> S5PC210 support more I2C devices than previous SoCs.
> >> >> >>>> And to prevent the wrong usage use the s5p prefix instead of
s3c.
> >> >> >>>>
> >> >> >>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >> >> >>>> ---
(snip)
> To Kgene,
> Any comments? I think you already mentioned that don't use #ifdef ~
> #endif at c files if possible.
> In this case are you okay?
>
Hi :-)
I know his patch will be submitted soon...maybe tomorrow?
So how about talking about that tomorrow?
And...we should support it with any method...
Let's make good output together.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 10:48 ` Kukjin Kim
@ 2010-09-30 10:50 ` Kyungmin Park
0 siblings, 0 replies; 17+ messages in thread
From: Kyungmin Park @ 2010-09-30 10:50 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 7:48 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Kyungmin Park wrote:
>>
>> On Thu, Sep 30, 2010 at 7:19 PM, Jongsun Han <jongsun.han@samsung.com>
>> wrote:
>> > On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <jongsun.han@samsung.com>
>> >> wrote:
>> >> > On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar
> <jassisinghbrar@gmail.com>
>> >> wrote:
>> >> >> > On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park
>> <kmpark@infradead.org>
>> >> wrote:
>> >> >> >> On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo
>> >> <jeongbae.seo@samsung.com>
>> >> >> wrote:
>> >> >> >>> Kyungmin wrote:
>> >> >> >>>> From: Kyungmin Park <kyungmin.park@samsung.com>
>> >> >> >>>>
>> >> >> >>>> S5PC210 support more I2C devices than previous SoCs.
>> >> >> >>>> And to prevent the wrong usage use the s5p prefix instead of
> s3c.
>> >> >> >>>>
>> >> >> >>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> >> >> >>>> ---
>
> (snip)
>
>> To Kgene,
>> Any comments? I think you already mentioned that don't use #ifdef ~
>> #endif at c files if possible.
>> In this case are you okay?
>>
> Hi :-)
>
> I know his patch will be submitted soon...maybe tomorrow?
> So how about talking about that tomorrow?
>
> And...we should support it with any method...
> Let's make good output together.
Another one, except the drivers/mmc/host/sdhci-s3c.c since it's now discussing.
Please update the sdhci codes also under arch/arm/mach-s5p*/
Thank you,
Kyungmin Park
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 6:50 ` Jassi Brar
2010-09-30 7:38 ` Kyungmin Park
@ 2010-09-30 11:43 ` Marek Szyprowski
2010-09-30 23:52 ` Jassi Brar
1 sibling, 1 reply; 17+ messages in thread
From: Marek Szyprowski @ 2010-09-30 11:43 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Thursday, September 30, 2010 8:50 AM Jassi Brar wrote:
> On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <kmpark@infradead.org> wrote:
> > On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo <jeongbae.seo@samsung.com> wrote:
> >> Kyungmin wrote:
> >>> From: Kyungmin Park <kyungmin.park@samsung.com>
> >>>
> >>> S5PC210 support more I2C devices than previous SoCs.
> >>> And to prevent the wrong usage use the s5p prefix instead of s3c.
> >>>
> >>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >>> ---
> >>> arch/arm/mach-s5pv310/Kconfig | 15 +++++++
> >>> arch/arm/mach-s5pv310/Makefile | 5 ++
> >>> arch/arm/mach-s5pv310/setup-i2c3.c | 25 +++++++++++
> >>> arch/arm/mach-s5pv310/setup-i2c4.c | 25 +++++++++++
> >>> arch/arm/mach-s5pv310/setup-i2c5.c | 25 +++++++++++
> >>> arch/arm/mach-s5pv310/setup-i2c6.c | 25 +++++++++++
> >>> arch/arm/mach-s5pv310/setup-i2c7.c | 25 +++++++++++
> >>> arch/arm/plat-s5p/Kconfig | 25 +++++++++++
> >>> arch/arm/plat-s5p/Makefile | 5 ++
> >>> arch/arm/plat-s5p/dev-i2c3.c | 67
> >>> ++++++++++++++++++++++++++++++
> >>> arch/arm/plat-s5p/dev-i2c4.c | 67
> >>> ++++++++++++++++++++++++++++++
> >>> arch/arm/plat-s5p/dev-i2c5.c | 67
> >>> ++++++++++++++++++++++++++++++
> >>> arch/arm/plat-s5p/dev-i2c6.c | 67
> >>> ++++++++++++++++++++++++++++++
> >>> arch/arm/plat-s5p/dev-i2c7.c | 67
> >>> ++++++++++++++++++++++++++++++
> >>> arch/arm/plat-samsung/include/plat/iic.h | 5 ++
> >>> 15 files changed, 515 insertions(+), 0 deletions(-)
> >>> create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
> >>> create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
> >>> create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
> >>> create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
> >>> create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
> >>> create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
> >>> create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
> >>> create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
> >>> create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
> >>> create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
> >>>
> >>
> >> Hi Kyungmin,
> >>
> >> We are considering another way not to make additional new i2c dev files.
> >> In my opinion, this patch looks not bad but we'd better make an effort to
> >> avoid having the more similar file.
> >
> > Actually I also it's not good approach, but as there's no comment or
> > discuss about this I send the patches.
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/022615.html
> >
> > If you have good method or approaches, I'm welcome.
>
> First, these are device definitions and gpio set callbacks and
> shouldn't take much
> of space. So, perhaps these all could be built upon single I2C support
> selection.
>
> Second, if we must build them conditionally, how about having all in
> one file with
> each device's definition and callback surrounded by corresponding ifdef ?
> That would alteast save us file-count.
I don't think this is a good idea. IMHO we should now follow the current style
of defining platform devices and the convert all at once. Mixing style always
causes a lot of confusion.
We should however agree on the new way of creating devices asap, as everyone
can notice that the current style is not the best for advanced socs like
C210/V310. This would save the time later when we would need to merge patches
for different styles of devices.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 11:43 ` Marek Szyprowski
@ 2010-09-30 23:52 ` Jassi Brar
2010-10-01 5:28 ` Marek Szyprowski
0 siblings, 1 reply; 17+ messages in thread
From: Jassi Brar @ 2010-09-30 23:52 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 30, 2010 at 8:43 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>> >> We are considering another way not to make additional new i2c dev files.
>> >> In my opinion, this patch looks not bad but we'd better make an effort to
>> >> avoid having the more similar file.
>> >
>> > Actually I also it's not good approach, but as there's no comment or
>> > discuss about this I send the patches.
>> > http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/022615.html
>> >
>> > If you have good method or approaches, I'm welcome.
>>
>> First, these are device definitions and gpio set callbacks and
>> shouldn't take much
>> of space. So, perhaps these all could be built upon single I2C support
>> selection.
>>
>> Second, if we must build them conditionally, how about having all in
>> one file with
>> each device's definition and callback surrounded by corresponding ifdef ?
>> That would alteast save us file-count.
>
> I don't think this is a good idea. IMHO we should now follow the current style
> of defining platform devices and the convert all at once. Mixing style always
> causes a lot of confusion.
You mean to keep defining every controller in in a dedicated file ?
If yes, my second option is still better, IMO.
If no, please explain what do you mean by current style.
> We should however agree on the new way of creating devices asap, as everyone
> can notice that the current style is not the best for advanced socs like
> C210/V310. This would save the time later when we would need to merge patches
> for different styles of devices.
I would prefer my first option out of all discussed in this thread.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 23:52 ` Jassi Brar
@ 2010-10-01 5:28 ` Marek Szyprowski
2010-10-01 6:16 ` Jassi Brar
0 siblings, 1 reply; 17+ messages in thread
From: Marek Szyprowski @ 2010-10-01 5:28 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Friday, October 01, 2010 1:52 AM Jassi Brar wrote:
> On Thu, Sep 30, 2010 at 8:43 PM, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> >> >> We are considering another way not to make additional new i2c dev files.
> >> >> In my opinion, this patch looks not bad but we'd better make an effort to
> >> >> avoid having the more similar file.
> >> >
> >> > Actually I also it's not good approach, but as there's no comment or
> >> > discuss about this I send the patches.
> >> > http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/022615.html
> >> >
> >> > If you have good method or approaches, I'm welcome.
> >>
> >> First, these are device definitions and gpio set callbacks and
> >> shouldn't take much
> >> of space. So, perhaps these all could be built upon single I2C support
> >> selection.
> >>
> >> Second, if we must build them conditionally, how about having all in
> >> one file with
> >> each device's definition and callback surrounded by corresponding ifdef ?
> >> That would alteast save us file-count.
> >
> > I don't think this is a good idea. IMHO we should now follow the current style
> > of defining platform devices and the convert all at once. Mixing style always
> > causes a lot of confusion.
>
> You mean to keep defining every controller in in a dedicated file ?
Yes, what's the problem with many files? The i2c patches are ready, they match the
way the other Samsung devices are defined in mainline kernel. It imho really important
to have a common style across the same chip family to make the code easier to understand
for someone new.
> If yes, my second option is still better, IMO.
> If no, please explain what do you mean by current style.
Well, postponing a merge of such simple code as i2c device definition is imho the
worst solution. Especially because the new style / framework still has not been agreed
yet, although a few proposals have been made a long time ago.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-10-01 5:28 ` Marek Szyprowski
@ 2010-10-01 6:16 ` Jassi Brar
2010-10-01 8:12 ` Kyungmin Park
0 siblings, 1 reply; 17+ messages in thread
From: Jassi Brar @ 2010-10-01 6:16 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Oct 1, 2010 at 2:28 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> On Friday, October 01, 2010 1:52 AM Jassi Brar wrote:
>
>> On Thu, Sep 30, 2010 at 8:43 PM, Marek Szyprowski
>> <m.szyprowski@samsung.com> wrote:
>> >> >> We are considering another way not to make additional new i2c dev files.
>> >> >> In my opinion, this patch looks not bad but we'd better make an effort to
>> >> >> avoid having the more similar file.
>> >> >
>> >> > Actually I also it's not good approach, but as there's no comment or
>> >> > discuss about this I send the patches.
>> >> > http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/022615.html
>> >> >
>> >> > If you have good method or approaches, I'm welcome.
>> >>
>> >> First, these are device definitions and gpio set callbacks and
>> >> shouldn't take much
>> >> of space. So, perhaps these all could be built upon single I2C support
>> >> selection.
>> >>
>> >> Second, if we must build them conditionally, how about having all in
>> >> one file with
>> >> each device's definition and callback surrounded by corresponding ifdef ?
>> >> That would alteast save us file-count.
>> >
>> > I don't think this is a good idea. IMHO we should now follow the current style
>> > of defining platform devices and the convert all at once. Mixing style always
>> > causes a lot of confusion.
>>
>> You mean to keep defining every controller in in a dedicated file ?
>
> Yes, what's the problem with many files? The i2c patches are ready, they match the
> way the other Samsung devices are defined in mainline kernel. It imho really important
> to have a common style across the same chip family to make the code easier to understand
> for someone new.
Talking about common style, dev-audio.c and dev-spi.c defines all
controllers in same file.
Also, the decision was made while Ben was here. Unfortunately he
didn't mandate all devices
do that.
Now, that we don't really have a 'common style', IMHO we'd better take
the better path if not the best.
>> If yes, my second option is still better, IMO.
>> If no, please explain what do you mean by current style.
>
> Well, postponing a merge of such simple code as i2c device definition is imho the
> worst solution. Especially because the new style / framework still has not been agreed
> yet, although a few proposals have been made a long time ago.
I don't think merging 7 files in 1 and adding ifdefs should take more
than a few hours including
testing. But of course, I can't assume the speed of the developer.
Thanks.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-10-01 6:16 ` Jassi Brar
@ 2010-10-01 8:12 ` Kyungmin Park
0 siblings, 0 replies; 17+ messages in thread
From: Kyungmin Park @ 2010-10-01 8:12 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Oct 1, 2010 at 3:16 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Fri, Oct 1, 2010 at 2:28 PM, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>> Hello,
>>
>> On Friday, October 01, 2010 1:52 AM Jassi Brar wrote:
>>
>>> On Thu, Sep 30, 2010 at 8:43 PM, Marek Szyprowski
>>> <m.szyprowski@samsung.com> wrote:
>>> >> >> We are considering another way not to make additional new i2c dev files.
>>> >> >> In my opinion, this patch looks not bad but we'd better make an effort to
>>> >> >> avoid having the more similar file.
>>> >> >
>>> >> > Actually I also it's not good approach, but as there's no comment or
>>> >> > discuss about this I send the patches.
>>> >> > http://lists.infradead.org/pipermail/linux-arm-kernel/2010-August/022615.html
>>> >> >
>>> >> > If you have good method or approaches, I'm welcome.
>>> >>
>>> >> First, these are device definitions and gpio set callbacks and
>>> >> shouldn't take much
>>> >> of space. So, perhaps these all could be built upon single I2C support
>>> >> selection.
>>> >>
>>> >> Second, if we must build them conditionally, how about having all in
>>> >> one file with
>>> >> each device's definition and callback surrounded by corresponding ifdef ?
>>> >> That would alteast save us file-count.
>>> >
>>> > I don't think this is a good idea. IMHO we should now follow the current style
>>> > of defining platform devices and the convert all at once. Mixing style always
>>> > causes a lot of confusion.
>>>
>>> You mean to keep defining every controller in in a dedicated file ?
>>
>> Yes, what's the problem with many files? The i2c patches are ready, they match the
>> way the other Samsung devices are defined in mainline kernel. It imho really important
>> to have a common style across the same chip family to make the code easier to understand
>> for someone new.
> Talking about common style, dev-audio.c and dev-spi.c defines all
> controllers in same file.
> Also, the decision was made while Ben was here. Unfortunately he
> didn't mandate all devices
> do that.
> Now, that we don't really have a 'common style', IMHO we'd better take
> the better path if not the best.
It does not mean defer until that time.
I don't like to say delay it until something is decide or made.
So first implement it as current style and then find the 'better' way
at that time.
>
>>> If yes, my second option is still better, IMO.
>>> If no, please explain what do you mean by current style.
>>
>> Well, postponing a merge of such simple code as i2c device definition is imho the
>> worst solution. Especially because the new style / framework still has not been agreed
>> yet, although a few proposals have been made a long time ago.
> I don't think merging 7 files in 1 and adding ifdefs should take more
> than a few hours including
> testing. But of course, I can't assume the speed of the developer.
Right, but no need to make an effort for that since it's not much
different this patch.
So I suggest first apply current scheme and then find a better way to
all people are agree.
Thank you,
Kyungmin Park
>
> Thanks.
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support
2010-09-30 4:48 [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support Kyungmin Park
2010-09-30 6:20 ` Jeongbae Seo
@ 2010-10-07 1:54 ` Kukjin Kim
1 sibling, 0 replies; 17+ messages in thread
From: Kukjin Kim @ 2010-10-07 1:54 UTC (permalink / raw)
To: linux-arm-kernel
Kyungmin Park wrote:
>
> From: Kyungmin Park <kyungmin.park@samsung.com>
>
> S5PC210 support more I2C devices than previous SoCs.
> And to prevent the wrong usage use the s5p prefix instead of s3c.
>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> arch/arm/mach-s5pv310/Kconfig | 15 +++++++
> arch/arm/mach-s5pv310/Makefile | 5 ++
> arch/arm/mach-s5pv310/setup-i2c3.c | 25 +++++++++++
> arch/arm/mach-s5pv310/setup-i2c4.c | 25 +++++++++++
> arch/arm/mach-s5pv310/setup-i2c5.c | 25 +++++++++++
> arch/arm/mach-s5pv310/setup-i2c6.c | 25 +++++++++++
> arch/arm/mach-s5pv310/setup-i2c7.c | 25 +++++++++++
> arch/arm/plat-s5p/Kconfig | 25 +++++++++++
> arch/arm/plat-s5p/Makefile | 5 ++
> arch/arm/plat-s5p/dev-i2c3.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-s5p/dev-i2c4.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-s5p/dev-i2c5.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-s5p/dev-i2c6.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-s5p/dev-i2c7.c | 67
> ++++++++++++++++++++++++++++++
> arch/arm/plat-samsung/include/plat/iic.h | 5 ++
> 15 files changed, 515 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c3.c
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c4.c
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c5.c
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c6.c
> create mode 100644 arch/arm/mach-s5pv310/setup-i2c7.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c3.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c4.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c5.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c6.c
> create mode 100644 arch/arm/plat-s5p/dev-i2c7.c
>
> diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig
> index c207426..cd5e8a6 100644
> --- a/arch/arm/mach-s5pv310/Kconfig
> +++ b/arch/arm/mach-s5pv310/Kconfig
> @@ -24,6 +24,21 @@ config S5PV310_SETUP_I2C2
> help
> Common setup code for i2c bus 2.
>
> +config S5PV310_SETUP_I2C3
> + bool
> +
> +config S5PV310_SETUP_I2C4
> + bool
> +
> +config S5PV310_SETUP_I2C5
> + bool
> +
> +config S5PV310_SETUP_I2C6
> + bool
> +
> +config S5PV310_SETUP_I2C7
> + bool
> +
> # machine support
>
> menu "S5PC210 Machines"
> diff --git a/arch/arm/mach-s5pv310/Makefile
b/arch/arm/mach-s5pv310/Makefile
> index d17c8c7..d18febf 100644
> --- a/arch/arm/mach-s5pv310/Makefile
> +++ b/arch/arm/mach-s5pv310/Makefile
> @@ -30,3 +30,8 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-
> universal_c210.o
>
> obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o
> obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C4) += setup-i2c4.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C5) += setup-i2c5.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C6) += setup-i2c6.o
> +obj-$(CONFIG_S5PV310_SETUP_I2C7) += setup-i2c7.o
> diff --git a/arch/arm/mach-s5pv310/setup-i2c3.c
b/arch/arm/mach-s5pv310/setup-
> i2c3.c
> new file mode 100644
> index 0000000..25e75b6
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c3.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c3.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C3 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c3_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPA1(2), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPA1(2), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPA1(3), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPA1(3), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/mach-s5pv310/setup-i2c4.c
b/arch/arm/mach-s5pv310/setup-
> i2c4.c
> new file mode 100644
> index 0000000..72b3f68
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c4.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c4.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C4 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c4_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPB(0), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPB(0), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPB(1), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPB(1), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/mach-s5pv310/setup-i2c5.c
b/arch/arm/mach-s5pv310/setup-
> i2c5.c
> new file mode 100644
> index 0000000..8fb4710
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c5.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c5.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C5 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c5_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPB(6), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPB(6), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPB(7), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPB(7), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/mach-s5pv310/setup-i2c6.c
b/arch/arm/mach-s5pv310/setup-
> i2c6.c
> new file mode 100644
> index 0000000..a358071
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c6.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c6.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C6 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c6_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPC1(3), S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(S5PV310_GPC1(3), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPC1(4), S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(S5PV310_GPC1(4), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/mach-s5pv310/setup-i2c7.c
b/arch/arm/mach-s5pv310/setup-
> i2c7.c
> new file mode 100644
> index 0000000..d0bc17c
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-i2c7.c
> @@ -0,0 +1,25 @@
> +/*
> + * linux/arch/arm/mach-s5pv310/setup-i2c7.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
> + *
> + * I2C7 GPIO configuration.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +struct platform_device; /* don't need the contents */
> +
> +#include <linux/gpio.h>
> +#include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s5p_i2c7_cfg_gpio(struct platform_device *dev)
> +{
> + s3c_gpio_cfgpin(S5PV310_GPD0(2), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPD0(2), S3C_GPIO_PULL_UP);
> + s3c_gpio_cfgpin(S5PV310_GPD0(3), S3C_GPIO_SFN(3));
> + s3c_gpio_setpull(S5PV310_GPD0(3), S3C_GPIO_PULL_UP);
> +}
> diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
> index 2596096..a6e8e65 100644
> --- a/arch/arm/plat-s5p/Kconfig
> +++ b/arch/arm/plat-s5p/Kconfig
> @@ -51,3 +51,28 @@ config S5P_DEV_ONENAND
> bool
> help
> Compile in platform device definition for OneNAND controller
> +
> +config S5P_DEV_I2C3
> + bool
> + help
> + Compile in platform device definition for I2C controller 3
> +
> +config S5P_DEV_I2C4
> + bool
> + help
> + Compile in platform device definition for I2C controller 4
> +
> +config S5P_DEV_I2C5
> + bool
> + help
> + Compile in platform device definition for I2C controller 5
> +
> +config S5P_DEV_I2C6
> + bool
> + help
> + Compile in platform device definition for I2C controller 6
> +
> +config S5P_DEV_I2C7
> + bool
> + help
> + Compile in platform device definition for I2C controller 7
> diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
> index f3e917e..f57fab8 100644
> --- a/arch/arm/plat-s5p/Makefile
> +++ b/arch/arm/plat-s5p/Makefile
> @@ -25,3 +25,8 @@ obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o
> obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o
> obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o
> obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o
> +obj-$(CONFIG_S5P_DEV_I2C3) += dev-i2c3.o
> +obj-$(CONFIG_S5P_DEV_I2C4) += dev-i2c4.o
> +obj-$(CONFIG_S5P_DEV_I2C5) += dev-i2c5.o
> +obj-$(CONFIG_S5P_DEV_I2C6) += dev-i2c6.o
> +obj-$(CONFIG_S5P_DEV_I2C7) += dev-i2c7.o
> diff --git a/arch/arm/plat-s5p/dev-i2c3.c b/arch/arm/plat-s5p/dev-i2c3.c
> new file mode 100644
> index 0000000..f92c4ea
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c3.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c3.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 3
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C3,
> + .end = S3C_PA_I2C3 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C3,
> + .end = IRQ_I2C3,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c3 = {
> + .name = "s3c2440-i2c",
> + .id = 3,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data3 __initdata = {
> + .flags = 0,
> + .bus_num = 3,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data3;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c3_cfg_gpio;
> +
> + s3c_device_i2c3.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-s5p/dev-i2c4.c b/arch/arm/plat-s5p/dev-i2c4.c
> new file mode 100644
> index 0000000..10b5bd1
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c4.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c4.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 3
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C4,
> + .end = S3C_PA_I2C4 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C4,
> + .end = IRQ_I2C4,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c4 = {
> + .name = "s3c2440-i2c",
> + .id = 4,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data4 __initdata = {
> + .flags = 0,
> + .bus_num = 4,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data4;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c4_cfg_gpio;
> +
> + s3c_device_i2c4.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-s5p/dev-i2c5.c b/arch/arm/plat-s5p/dev-i2c5.c
> new file mode 100644
> index 0000000..a5ab875
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c5.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c3.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 3
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C5,
> + .end = S3C_PA_I2C5 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C5,
> + .end = IRQ_I2C5,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c5 = {
> + .name = "s3c2440-i2c",
> + .id = 5,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data5 __initdata = {
> + .flags = 0,
> + .bus_num = 5,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data5;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c5_cfg_gpio;
> +
> + s3c_device_i2c5.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-s5p/dev-i2c6.c b/arch/arm/plat-s5p/dev-i2c6.c
> new file mode 100644
> index 0000000..3c29a9b
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c6.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c6.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 6
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C6,
> + .end = S3C_PA_I2C6 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C6,
> + .end = IRQ_I2C6,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c6 = {
> + .name = "s3c2440-i2c",
> + .id = 6,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data6 __initdata = {
> + .flags = 0,
> + .bus_num = 6,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data6;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c6_cfg_gpio;
> +
> + s3c_device_i2c6.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-s5p/dev-i2c7.c b/arch/arm/plat-s5p/dev-i2c7.c
> new file mode 100644
> index 0000000..98139a5
> --- /dev/null
> +++ b/arch/arm/plat-s5p/dev-i2c7.c
> @@ -0,0 +1,67 @@
> +/* linux/arch/arm/plat-s5p/dev-i2c7.c
> + *
> + * Copyright(C) 2010 Samsung Electronics
> + *
> + * S5P series device definition for i2c device 7
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/gfp.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/regs-iic.h>
> +#include <plat/iic.h>
> +#include <plat/devs.h>
> +#include <plat/cpu.h>
> +
> +static struct resource s3c_i2c_resource[] = {
> + [0] = {
> + .start = S3C_PA_I2C7,
> + .end = S3C_PA_I2C7 + SZ_4K - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_I2C7,
> + .end = IRQ_I2C7,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device s3c_device_i2c7 = {
> + .name = "s3c2440-i2c",
> + .id = 7,
> + .num_resources = ARRAY_SIZE(s3c_i2c_resource),
> + .resource = s3c_i2c_resource,
> +};
> +
> +static struct s3c2410_platform_i2c default_i2c_data7 __initdata = {
> + .flags = 0,
> + .bus_num = 7,
> + .slave_addr = 0x10,
> + .frequency = 100*1000,
> + .sda_delay = 100,
> +};
> +
> +void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
> +{
> + struct s3c2410_platform_i2c *npd;
> +
> + if (!pd)
> + pd = &default_i2c_data7;
> +
> + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
> + if (!npd)
> + printk(KERN_ERR "%s: no memory for platform data\n",
> __func__);
> + else if (!npd->cfg_gpio)
> + npd->cfg_gpio = s5p_i2c7_cfg_gpio;
> +
> + s3c_device_i2c7.dev.platform_data = npd;
> +}
> diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-
> samsung/include/plat/iic.h
> index 133308b..893f6a1 100644
> --- a/arch/arm/plat-samsung/include/plat/iic.h
> +++ b/arch/arm/plat-samsung/include/plat/iic.h
> @@ -60,5 +60,10 @@ extern void s3c_i2c2_set_platdata(struct
> s3c2410_platform_i2c *i2c);
> extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
> extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
> extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c3_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c4_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c5_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c6_cfg_gpio(struct platform_device *dev);
> +extern void s5p_i2c7_cfg_gpio(struct platform_device *dev);
>
> #endif /* __ASM_ARCH_IIC_H */
> --
Hi,
If required, it's more appropriate that the dev-i2cX.c is in the
plat-samsung
like other dev-i2c[0-2].c even though I2C3~I2C7 are not used on S3C SoCs.
Because they which are separated in two places can cause confusion and the
same reason, it is better to keep the s3c_i2cX_cfg_gpio than s5p_i2cX...
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2010-10-07 1:54 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-30 4:48 [PATCH 7/7] ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support Kyungmin Park
2010-09-30 6:20 ` Jeongbae Seo
2010-09-30 6:27 ` Kyungmin Park
2010-09-30 6:50 ` Jassi Brar
2010-09-30 7:38 ` Kyungmin Park
2010-09-30 9:27 ` Jongsun Han
2010-09-30 9:48 ` Kyungmin Park
2010-09-30 10:19 ` Jongsun Han
2010-09-30 10:40 ` Kyungmin Park
2010-09-30 10:48 ` Kukjin Kim
2010-09-30 10:50 ` Kyungmin Park
2010-09-30 11:43 ` Marek Szyprowski
2010-09-30 23:52 ` Jassi Brar
2010-10-01 5:28 ` Marek Szyprowski
2010-10-01 6:16 ` Jassi Brar
2010-10-01 8:12 ` Kyungmin Park
2010-10-07 1:54 ` Kukjin Kim
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).