Skip to contentSkip to conversation

ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

PATCH New Kyungmin Park 6 participants 17 messages Sep 30, 2010 – Oct 7, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---
 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
arch/arm/mach-s5pv310/Kconfig +15 -0
index c207426..cd5e8a6 100644
@@ -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"
arch/arm/mach-s5pv310/Makefile +5 -0
index d17c8c7..d18febf 100644
@@ -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
arch/arm/mach-s5pv310/setup-i2c3.c new file +25 -0
new file mode 100644
index 0000000..25e75b6
@@ -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);
+}
arch/arm/mach-s5pv310/setup-i2c4.c new file +25 -0
new file mode 100644
index 0000000..72b3f68
@@ -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);
+}
arch/arm/mach-s5pv310/setup-i2c5.c new file +25 -0
new file mode 100644
index 0000000..8fb4710
@@ -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);
+}
arch/arm/mach-s5pv310/setup-i2c6.c new file +25 -0
new file mode 100644
index 0000000..a358071
@@ -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);
+}
arch/arm/mach-s5pv310/setup-i2c7.c new file +25 -0
new file mode 100644
index 0000000..d0bc17c
@@ -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);
+}
arch/arm/plat-s5p/Kconfig +25 -0
index 2596096..a6e8e65 100644
@@ -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
arch/arm/plat-s5p/Makefile +5 -0
index f3e917e..f57fab8 100644
@@ -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
arch/arm/plat-s5p/dev-i2c3.c new file +67 -0

67 lines not on this page · raw message

arch/arm/plat-s5p/dev-i2c4.c new file +67 -0

67 lines not on this page · raw message

arch/arm/plat-s5p/dev-i2c5.c new file +67 -0

67 lines not on this page · raw message

arch/arm/plat-s5p/dev-i2c6.c new file +67 -0

67 lines not on this page · raw message

arch/arm/plat-s5p/dev-i2c7.c new file +67 -0

67 lines not on this page · raw message

arch/arm/plat-samsung/include/plat/iic.h +5 -0
index 133308b..893f6a1 100644
@@ -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 */
Signature · 1 line
1.5.3.3
#1 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 30 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---
 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
Quoted 9 lines
 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

Quoted 642 lines
arch/arm/mach-s5pv310/Kconfig +15 -0
index c207426..cd5e8a6 100644
@@ -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"
arch/arm/mach- renamed from arch/arm/mach-s5pv310/Makefile +0 -0

s5pv310/Makefile
index d17c8c7..d18febf 100644

arch/arm/mach-s5pv310/Makefile +0 -0
@@ -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

arch/arm/mach-s5pv310/Makefile +5 -0
+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
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c3.c +0 -0

s5pv310/setup-i2c3.c
new file mode 100644
index 0000000..25e75b6

arch/arm/mach-s5pv310/setup-i2c3.c new file +25 -0
@@ -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);
+}
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c4.c +0 -0

s5pv310/setup-i2c4.c
new file mode 100644
index 0000000..72b3f68

arch/arm/mach-s5pv310/setup-i2c4.c new file +25 -0
@@ -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);
+}
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c5.c +0 -0

s5pv310/setup-i2c5.c
new file mode 100644
index 0000000..8fb4710

arch/arm/mach-s5pv310/setup-i2c5.c new file +25 -0
@@ -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);
+}
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c6.c +0 -0

s5pv310/setup-i2c6.c
new file mode 100644
index 0000000..a358071

arch/arm/mach-s5pv310/setup-i2c6.c new file +25 -0
@@ -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);
+}
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c7.c +0 -0

s5pv310/setup-i2c7.c
new file mode 100644
index 0000000..d0bc17c

arch/arm/mach-s5pv310/setup-i2c7.c new file +25 -0
@@ -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);
+}
arch/arm/plat-s5p/Kconfig +25 -0
index 2596096..a6e8e65 100644
@@ -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
arch/arm/plat-s5p/Makefile +5 -0
index f3e917e..f57fab8 100644
@@ -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
arch/arm/plat-s5p/dev-i2c3.c new file +62 -0
new file mode 100644
index 0000000..f92c4ea
@@ -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__);

arch/arm/plat-s5p/dev-i2c3.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c3_cfg_gpio;
+
+	s3c_device_i2c3.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c4.c new file +62 -0
new file mode 100644
index 0000000..10b5bd1
@@ -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__);

arch/arm/plat-s5p/dev-i2c4.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c4_cfg_gpio;
+
+	s3c_device_i2c4.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c5.c new file +62 -0
new file mode 100644
index 0000000..a5ab875
@@ -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__);

arch/arm/plat-s5p/dev-i2c5.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c5_cfg_gpio;
+
+	s3c_device_i2c5.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c6.c new file +62 -0
new file mode 100644
index 0000000..3c29a9b
@@ -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__);

arch/arm/plat-s5p/dev-i2c6.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c6_cfg_gpio;
+
+	s3c_device_i2c6.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c7.c new file +62 -0
new file mode 100644
index 0000000..98139a5
@@ -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__);

arch/arm/plat-s5p/dev-i2c7.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c7_cfg_gpio;
+
+	s3c_device_i2c7.dev.platform_data = npd;
+}
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/iic.h +0 -0

samsung/include/plat/iic.h
index 133308b..893f6a1 100644

arch/arm/plat-samsung/include/plat/iic.h +5 -0
@@ -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

#2 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 41 lines · Jeongbae Seo
Quoted 30 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---

?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

Quoted 9 lines

?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

Quoted 5 lines

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

Quoted 651 lines

Jongsun, can you give us your opinion ?

Thanks,
Best Regards
Jeongbae Seo

Quoted 642 lines
arch/arm/mach-s5pv310/Kconfig +0 -0
index c207426..cd5e8a6 100644
@@ -24,6 +24,21 @@ config S5PV310_SETUP_I2C2

? ? ? help
? ? ? ? Common setup code for i2c bus 2.

arch/arm/mach-s5pv310/Kconfig +15 -0
+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"

arch/arm/mach- renamed from arch/arm/mach-s5pv310/Makefile +0 -0

s5pv310/Makefile
index d17c8c7..d18febf 100644

arch/arm/mach-s5pv310/Makefile +0 -0
@@ -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

arch/arm/mach-s5pv310/Makefile +5 -0
+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
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c3.c +0 -0

s5pv310/setup-i2c3.c
new file mode 100644
index 0000000..25e75b6

arch/arm/mach-s5pv310/setup-i2c3.c new file +25 -0
@@ -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);
+}
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c4.c +0 -0

s5pv310/setup-i2c4.c
new file mode 100644
index 0000000..72b3f68

arch/arm/mach-s5pv310/setup-i2c4.c new file +25 -0
@@ -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);
+}
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c5.c +0 -0

s5pv310/setup-i2c5.c
new file mode 100644
index 0000000..8fb4710

arch/arm/mach-s5pv310/setup-i2c5.c new file +25 -0
@@ -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);
+}
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c6.c +0 -0

s5pv310/setup-i2c6.c
new file mode 100644
index 0000000..a358071

arch/arm/mach-s5pv310/setup-i2c6.c new file +25 -0
@@ -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);
+}
arch/arm/mach- renamed from arch/arm/mach-s5pv310/setup-i2c7.c +0 -0

s5pv310/setup-i2c7.c
new file mode 100644
index 0000000..d0bc17c

arch/arm/mach-s5pv310/setup-i2c7.c new file +25 -0
@@ -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);
+}
arch/arm/plat-s5p/Kconfig +0 -0
index 2596096..a6e8e65 100644
@@ -51,3 +51,28 @@ config S5P_DEV_ONENAND

? ? ? bool
? ? ? help
? ? ? ? Compile in platform device definition for OneNAND controller

arch/arm/plat-s5p/Kconfig +25 -0
+
+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
arch/arm/plat-s5p/Makefile +0 -0
index f3e917e..f57fab8 100644
@@ -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

arch/arm/plat-s5p/Makefile +5 -0
+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
arch/arm/plat-s5p/dev-i2c3.c new file +62 -0
new file mode 100644
index 0000000..f92c4ea
@@ -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;

arch/arm/plat-s5p/dev-i2c3.c new file +3 -0
+
+ ? ? s3c_device_i2c3.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c4.c new file +62 -0
new file mode 100644
index 0000000..10b5bd1
@@ -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;

arch/arm/plat-s5p/dev-i2c4.c new file +3 -0
+
+ ? ? s3c_device_i2c4.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c5.c new file +62 -0
new file mode 100644
index 0000000..a5ab875
@@ -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;

arch/arm/plat-s5p/dev-i2c5.c new file +3 -0
+
+ ? ? s3c_device_i2c5.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c6.c new file +62 -0
new file mode 100644
index 0000000..3c29a9b
@@ -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;

arch/arm/plat-s5p/dev-i2c6.c new file +3 -0
+
+ ? ? s3c_device_i2c6.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c7.c new file +62 -0
new file mode 100644
index 0000000..98139a5
@@ -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;

arch/arm/plat-s5p/dev-i2c7.c new file +3 -0
+
+ ? ? s3c_device_i2c7.dev.platform_data = npd;
+}
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/iic.h +0 -0

samsung/include/plat/iic.h
index 133308b..893f6a1 100644

arch/arm/plat-samsung/include/plat/iic.h +5 -0
@@ -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

#3 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 48 lines · Kyungmin Park
Quoted 41 lines · Jeongbae Seo
Quoted 30 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---

?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

Quoted 9 lines

?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

Quoted 5 lines

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.

Quoted 5 lines

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.

#4 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 53 lines · Jassi Brar
Quoted 52 lines · Kyungmin Park
Quoted 41 lines · Jeongbae Seo
Quoted 30 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---

?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

Quoted 9 lines

?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

Quoted 5 lines

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

Quoted 6 lines
Quoted 1 line

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.

Quoted 5 lines

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

Quoted 1 line
#5 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 55 lines · Jassi Brar
Quoted 2 lines · Kyungmin Park
Quoted 1 line

On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo <[email protected]>

Quoted 43 lines · wrote:
Quoted 43 lines
Quoted 43 lines
Quoted 30 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---

?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

Quoted 9 lines

?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,

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

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

Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

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.

Quoted 6 lines
Quoted 5 lines

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.

Quoted 7 lines

This method is also no problem if all of person are agreed.

So just choose it and make a conclusion.

Thank you,
Kyungmin Park

Quoted 1 line

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

#6 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 63 lines · Jongsun Han
Quoted 62 lines · Jassi Brar
Quoted 2 lines · Kyungmin Park
Quoted 1 line

On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo <[email protected]>

Quoted 43 lines · wrote:
Quoted 43 lines
Quoted 43 lines
Quoted 30 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---

?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

Quoted 9 lines

?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,

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

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

Quoted 7 lines
Quoted 2 lines

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.

Quoted 8 lines
Quoted 1 line

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.

Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

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.

Quoted 8 lines
Quoted 5 lines

So just choose it and make a conclusion.

Thank you,
Kyungmin Park

Quoted 1 line

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.

Quoted 3 lines

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.

Quoted 5 lines

Best Regards
Jongsun Han

#7 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <[email protected]>

Quoted 75 lines
Quoted 1 line · wrote:

On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line

On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo

<[email protected]>

Quoted 42 lines
Quoted 42 lines
Quoted 41 lines · wrote:
Quoted 41 lines
Quoted 41 lines
Quoted 39 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---

?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

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Kyungmin,

We are considering another way not to make additional new i2c dev

files.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

In my opinion, this patch looks not bad but we'd better make an

effort to

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

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-

Quoted 7 lines
Quoted 7 lines

August/022615.html

Quoted 6 lines
Quoted 2 lines

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

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

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

Quoted 9 lines

of

Quoted 2 lines

S5PV310.
It's better define the number of i2c devs being used instead of using

single I2C

Quoted 1 line

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).

Quoted 20 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

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 ?

Quoted 11 lines
Quoted 9 lines
Quoted 1 line

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

Quoted 1 line

I agree with Jassi's opinion keeping setup-i2c(0..2) and dev-i2c(0..2)

for

Quoted 1 line

backward compatibility and

Quoted 9 lines

Of course it should be. and there's no code to brake the existing codes.

Quoted 3 lines

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.

Quoted 10 lines
Quoted 5 lines

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

#8 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 82 lines · Jongsun Han

On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <[email protected]>

Quoted 81 lines
Quoted 1 line · wrote:

On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line

On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo

<[email protected]>

Quoted 42 lines
Quoted 42 lines
Quoted 41 lines · wrote:
Quoted 41 lines
Quoted 41 lines
Quoted 39 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---

?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

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Kyungmin,

We are considering another way not to make additional new i2c dev

files.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

In my opinion, this patch looks not bad but we'd better make an

effort to

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

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-

Quoted 7 lines
Quoted 7 lines

August/022615.html

Quoted 6 lines
Quoted 2 lines

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

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

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

Quoted 2 lines

S5PV310.
It's better define the number of i2c devs being used instead of using

single I2C

Quoted 1 line

support selection.

Quoted 7 lines
Quoted 3 lines

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?

Quoted 27 lines
Quoted 27 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

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 ?

Quoted 11 lines
Quoted 9 lines
Quoted 1 line

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

Quoted 1 line

I agree with Jassi's opinion keeping setup-i2c(0..2) and dev-i2c(0..2)

for

Quoted 1 line

backward compatibility and

Of course it should be. and there's no code to brake the existing codes.

Quoted 3 lines

adding a file which handles i2c(0..7) for S5PV310 and coming Samsung
soc.

Quoted 6 lines
Quoted 3 lines

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

Quoted 13 lines
Quoted 11 lines
Quoted 6 lines

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

#9 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 6 lines · Kyungmin Park
Quoted 3 lines · Jongsun Han

On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <[email protected]>

Quoted 2 lines
Quoted 1 line · wrote:

On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar

<[email protected]>

Quoted 12 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line

On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park

<[email protected]>

Quoted 9 lines
Quoted 9 lines
Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo

<[email protected]>

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of

s3c.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

---

(snip)

Quoted 5 lines

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 <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#10 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 32 lines · Kukjin Kim
Quoted 6 lines · Kyungmin Park
Quoted 3 lines · Jongsun Han

On Thu, Sep 30, 2010 at 6:27 PM, Jongsun Han <[email protected]>

Quoted 2 lines
Quoted 1 line · wrote:

On Thu, Sep 30, 2010 at 3:50 PM, Jassi Brar

<[email protected]>

Quoted 12 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line

On Thu, Sep 30, 2010 at 3:27 PM, Kyungmin Park

<[email protected]>

Quoted 9 lines
Quoted 9 lines
Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Thu, Sep 30, 2010 at 3:20 PM, Jeongbae Seo

<[email protected]>

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of

s3c.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

---

(snip)

Quoted 5 lines

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?

Quoted 7 lines

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

Quoted 15 lines

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, 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

#11 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

In reply to Jassi Brar

Hello,

Quoted 60 lines · Jassi Brar
Quoted 48 lines · Kyungmin Park
Quoted 41 lines · Jeongbae Seo
Quoted 30 lines · Kyungmin

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---
 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
Quoted 9 lines
 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
Quoted 5 lines

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.

Quoted 5 lines

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.

Quoted 4 lines

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

#12 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 15 lines · Marek Szyprowski
Quoted 15 lines
Quoted 9 lines
Quoted 3 lines

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.

Quoted 8 lines
Quoted 4 lines

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.

Quoted 4 lines

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.

#13 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Hello,

Quoted 22 lines · Jassi Brar
Quoted 20 lines · Marek Szyprowski
Quoted 19 lines
Quoted 9 lines
Quoted 3 lines

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.

Quoted 5 lines
Quoted 3 lines

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.

Quoted 2 lines

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

#14 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 30 lines · Marek Szyprowski

Hello,

Quoted 26 lines · Jassi Brar
Quoted 23 lines · Marek Szyprowski
Quoted 15 lines
Quoted 9 lines
Quoted 3 lines

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.

Quoted 4 lines

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.

Quoted 6 lines
Quoted 1 line

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.

Quoted 6 lines
Quoted 2 lines

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.

#15 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

Quoted 38 lines · Jassi Brar
Quoted 30 lines · Marek Szyprowski

Hello,

Quoted 26 lines · Jassi Brar
Quoted 23 lines · Marek Szyprowski
Quoted 15 lines
Quoted 9 lines
Quoted 3 lines

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.

Quoted 4 lines

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.

Quoted 6 lines
Quoted 1 line

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.

Quoted 7 lines

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.

Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

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

Quoted 3 lines

Thanks.

#16 lore raw

PATCH 7/7 ARM: S5PC210: I2C{3, 4, 5, 6, 7} device support

In reply to Kyungmin Park

Review

Quoted 67 lines · Kyungmin Park

From: Kyungmin Park <[email protected]>

S5PC210 support more I2C devices than previous SoCs. And to prevent the wrong usage use the s5p prefix instead of s3c.

---
 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
arch/arm/mach-s5pv310/Kconfig +15 -0
index c207426..cd5e8a6 100644
@@ -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"
(quoted diff) +0 -0

b/arch/arm/mach-s5pv310/Makefile

Review

Quoted 14 lines

index d17c8c7..d18febf 100644

arch/arm/mach-s5pv310/Makefile +0 -0
@@ -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

arch/arm/mach-s5pv310/Makefile +5 -0
+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
(quoted diff) +0 -0

b/arch/arm/mach-s5pv310/setup-

Review

Quoted 32 lines

i2c3.c
new file mode 100644
index 0000000..25e75b6

arch/arm/mach-s5pv310/setup-i2c3.c new file +25 -0
@@ -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);
+}
(quoted diff) +0 -0

b/arch/arm/mach-s5pv310/setup-

Review

Quoted 32 lines

i2c4.c
new file mode 100644
index 0000000..72b3f68

arch/arm/mach-s5pv310/setup-i2c4.c new file +25 -0
@@ -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);
+}
(quoted diff) +0 -0

b/arch/arm/mach-s5pv310/setup-

Review

Quoted 32 lines

i2c5.c
new file mode 100644
index 0000000..8fb4710

arch/arm/mach-s5pv310/setup-i2c5.c new file +25 -0
@@ -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);
+}
(quoted diff) +0 -0

b/arch/arm/mach-s5pv310/setup-

Review

Quoted 32 lines

i2c6.c
new file mode 100644
index 0000000..a358071

arch/arm/mach-s5pv310/setup-i2c6.c new file +25 -0
@@ -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);
+}
(quoted diff) +0 -0

b/arch/arm/mach-s5pv310/setup-

Quoted 463 lines

i2c7.c
new file mode 100644
index 0000000..d0bc17c

arch/arm/mach-s5pv310/setup-i2c7.c new file +25 -0
@@ -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);
+}
arch/arm/plat-s5p/Kconfig +25 -0
index 2596096..a6e8e65 100644
@@ -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
arch/arm/plat-s5p/Makefile +5 -0
index f3e917e..f57fab8 100644
@@ -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
arch/arm/plat-s5p/dev-i2c3.c new file +62 -0
new file mode 100644
index 0000000..f92c4ea
@@ -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__);

arch/arm/plat-s5p/dev-i2c3.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c3_cfg_gpio;
+
+	s3c_device_i2c3.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c4.c new file +62 -0
new file mode 100644
index 0000000..10b5bd1
@@ -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__);

arch/arm/plat-s5p/dev-i2c4.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c4_cfg_gpio;
+
+	s3c_device_i2c4.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c5.c new file +62 -0
new file mode 100644
index 0000000..a5ab875
@@ -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__);

arch/arm/plat-s5p/dev-i2c5.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c5_cfg_gpio;
+
+	s3c_device_i2c5.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c6.c new file +62 -0
new file mode 100644
index 0000000..3c29a9b
@@ -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__);

arch/arm/plat-s5p/dev-i2c6.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c6_cfg_gpio;
+
+	s3c_device_i2c6.dev.platform_data = npd;
+}
arch/arm/plat-s5p/dev-i2c7.c new file +62 -0
new file mode 100644
index 0000000..98139a5
@@ -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__);

arch/arm/plat-s5p/dev-i2c7.c new file +5 -0
+	else if (!npd->cfg_gpio)
+		npd->cfg_gpio = s5p_i2c7_cfg_gpio;
+
+	s3c_device_i2c7.dev.platform_data = npd;
+}
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/iic.h +0 -0

samsung/include/plat/iic.h
index 133308b..893f6a1 100644

arch/arm/plat-samsung/include/plat/iic.h +5 -0
@@ -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);
 
Quoted 2 lines

#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 <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.