Re: [PATCH 2/2] ARM: EXYNOS4: Add more registers to be saved and restored for PM

2011-07-19 Thread MyungJoo Ham
On Mon, Jul 18, 2011 at 5:00 PM, Kukjin Kim kgene@samsung.com wrote:
 MyungJoo Ham wrote:

 We need more registers to be saved and restored for PM of Exynos4210.
 Otherwise, with additional drivers running, suspend-to-RAM fails to wake
 up properly. This patch adds registers omitted in the initial PM
 patches.

 Signed-off-by: MyungJoo Ham myungjoo@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  arch/arm/mach-exynos4/pm.c |   77
 +++-
  1 files changed, 76 insertions(+), 1 deletions(-)

 diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
 index a103c13..24c9265 100644
 --- a/arch/arm/mach-exynos4/pm.c
 +++ b/arch/arm/mach-exynos4/pm.c
 @@ -27,6 +27,8 @@
  #include plat/cpu.h
  #include plat/pm.h
  #include plat/pll.h
 +#include plat/regs-srom.h
 +#include plat/regs-timer.h

  #include mach/regs-irq.h
  #include mach/regs-gpio.h
 @@ -60,14 +62,20 @@ static struct sleep_save exynos4_vpll_save[] = {

  static struct sleep_save exynos4_core_save[] = {
       /* CMU side */
 +     SAVE_ITEM(S5P_CLKSRC_LEFTBUS),

 I think, the reset/default value(0x0, SCLKMPLL) has no problem.

 +     SAVE_ITEM(S5P_CLKOUT_CMU_LEFTBUS),

 This is for debugging? So I think no need this.

 +     SAVE_ITEM(S5P_CLKSRC_RIGHTBUS),

 Same as 'CLKSRC_LEFTBUS'

 +     SAVE_ITEM(S5P_CLKOUT_CMU_RIGHTBUS),

 Same as 'CMU_LEFTBUS'

 +     SAVE_ITEM(S5P_CLKOUT_CMU_TOP),

 For debugging...

 +     SAVE_ITEM(S5P_CLKOUT_CMU_DMC),

 Same as above.

 (snip)

 +     SAVE_ITEM(S5P_APLL_LOCK),
 +     SAVE_ITEM(S5P_MPLL_LOCK),
 +     SAVE_ITEM(S5P_APLL_CON0),
 +     SAVE_ITEM(S5P_APLL_CON1),
 +     SAVE_ITEM(S5P_MPLL_CON0),
 +     SAVE_ITEM(S5P_MPLL_CON1),

 Basically, these value should be set in boot-loader after wake up.

 (snip)

 +     /* PMU */
 +     SAVE_ITEM(S5P_HDMI_PHY_CONTROL),
 +     SAVE_ITEM(S5P_USBOTG_PHY_CONTROL),
 +     SAVE_ITEM(S5P_USBHOST_PHY_CONTROL),
 +     SAVE_ITEM(S5P_DAC_CONTROL),
 +     SAVE_ITEM(S5P_MIPI_CONTROL0),
 +     SAVE_ITEM(S5P_MIPI_CONTROL1),
 +     SAVE_ITEM(S5P_ADC_CONTROL),
 +     SAVE_ITEM(S5P_PCIE_CONTROL),
 +     SAVE_ITEM(S5P_SATA_CONTROL),
 +     SAVE_ITEM(S5P_PMU_DEBUG),
 +     SAVE_ITEM(S5P_ARM_CORE0_CONFIGURATION),
 +     SAVE_ITEM(S5P_ARM_CORE1_CONFIGURATION),
 +     SAVE_ITEM(S5P_ARM_CPU_L2_0_CONFIGURATION),
 +     SAVE_ITEM(S5P_ARM_CPU_L2_1_CONFIGURATION),
 +     SAVE_ITEM(S5P_XUSBXTI_CONFIGURATION),
 +     SAVE_ITEM(S5P_XXTI_CONFIGURATION),
 +     SAVE_ITEM(S5P_PMU_CAM_CONF),
 +     SAVE_ITEM(S5P_PMU_TV_CONF),
 +     SAVE_ITEM(S5P_PMU_MFC_CONF),
 +     SAVE_ITEM(S5P_PMU_G3D_CONF),
 +     SAVE_ITEM(S5P_PMU_LCD0_CONF),
 +     SAVE_ITEM(S5P_PMU_LCD1_CONF),
 +     SAVE_ITEM(S5P_MAUDIO_CONFIGURATION),
 +     SAVE_ITEM(S5P_PMU_GPS_CONF),

 Since PMU part is alive block, so no need.

 +
 +     /* System Controller side */
 +     SAVE_ITEM(S3C_VA_SYS + 0x0210),
 +     SAVE_ITEM(S3C_VA_SYS + 0x0214),
 +     SAVE_ITEM(S3C_VA_SYS + 0x0218),
 +     SAVE_ITEM(S3C_VA_SYS + 0x0220),
 +     SAVE_ITEM(S3C_VA_SYS + 0x0230),

 Hmm..really need this?

 +
       /* GIC side */
       SAVE_ITEM(S5P_VA_GIC_CPU + 0x000),
       SAVE_ITEM(S5P_VA_GIC_CPU + 0x004),
 @@ -232,11 +286,32 @@ static struct sleep_save exynos4_core_save[] = {
       SAVE_ITEM(S5P_VA_GIC_DIST + 0xC20),
       SAVE_ITEM(S5P_VA_GIC_DIST + 0xC24),

 -
       SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x000),
       SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x010),
       SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x020),
       SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x030),
 +     SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x040),
 +     SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x050),
 +     SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x060),
 +     SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x070),
 +     SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x080),
 +     SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x090),

 No need to save/restore external GIC part...

 (snip)

 +     /* PWM Register */
 +     SAVE_ITEM(S3C2410_TCFG0),
 +     SAVE_ITEM(S3C2410_TCFG1),
 +     SAVE_ITEM(S3C64XX_TINT_CSTAT),
 +     SAVE_ITEM(S3C2410_TCON),
 +     SAVE_ITEM(S3C2410_TCNTB(0)),
 +     SAVE_ITEM(S3C2410_TCMPB(0)),
 +     SAVE_ITEM(S3C2410_TCNTO(0)),

 PWM? I'm not sure why this is needed here.

 (snip)

 Others, ok.

 Thanks.

 Best regards,
 Kgene.
 --
 Kukjin Kim kgene@samsung.com, Senior Engineer,
 SW Solution Development Team, Samsung Electronics Co., Ltd.


Hello,


Removing the registers you've mentioned didn't break the PM test as
NURI board also does not use debug clocks.

And, PWM driver appears to backup and restore ctirical register; thus,
we don't need to back them up at pm.c. That's good.

For PLLs, I'll let it rely on bootloader as you've mentioned.

The corrected patch will follow this reply soon.


Thanks.

- MyungJoo

-- 
MyungJoo Ham (함명주), Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the 

[PATCH v2 2/2] ARM: EXYNOS4: Add more registers to be saved and restored for PM

2011-07-19 Thread MyungJoo Ham
We need more registers to be saved and restored for PM of Exynos4210.
Otherwise, with additional drivers running, suspend-to-RAM fails to wake
up properly. This patch adds registers omitted in the initial PM
patches.

Signed-off-by: MyungJoo Ham myungjoo@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
--
Changed from v1
- removed unnecessary registers
- As the patch 1/2 is not changed, it is not re-sent.

---
 arch/arm/mach-exynos4/pm.c |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
index a103c13..5d6f768 100644
--- a/arch/arm/mach-exynos4/pm.c
+++ b/arch/arm/mach-exynos4/pm.c
@@ -27,6 +27,7 @@
 #include plat/cpu.h
 #include plat/pm.h
 #include plat/pll.h
+#include plat/regs-srom.h
 
 #include mach/regs-irq.h
 #include mach/regs-gpio.h
@@ -67,7 +68,9 @@ static struct sleep_save exynos4_core_save[] = {
SAVE_ITEM(S5P_CLKSRC_TOP0),
SAVE_ITEM(S5P_CLKSRC_TOP1),
SAVE_ITEM(S5P_CLKSRC_CAM),
+   SAVE_ITEM(S5P_CLKSRC_TV),
SAVE_ITEM(S5P_CLKSRC_MFC),
+   SAVE_ITEM(S5P_CLKSRC_G3D),
SAVE_ITEM(S5P_CLKSRC_IMAGE),
SAVE_ITEM(S5P_CLKSRC_LCD0),
SAVE_ITEM(S5P_CLKSRC_LCD1),
@@ -94,6 +97,7 @@ static struct sleep_save exynos4_core_save[] = {
SAVE_ITEM(S5P_CLKDIV_PERIL4),
SAVE_ITEM(S5P_CLKDIV_PERIL5),
SAVE_ITEM(S5P_CLKDIV_TOP),
+   SAVE_ITEM(S5P_CLKSRC_MASK_TOP),
SAVE_ITEM(S5P_CLKSRC_MASK_CAM),
SAVE_ITEM(S5P_CLKSRC_MASK_TV),
SAVE_ITEM(S5P_CLKSRC_MASK_LCD0),
@@ -102,6 +106,7 @@ static struct sleep_save exynos4_core_save[] = {
SAVE_ITEM(S5P_CLKSRC_MASK_FSYS),
SAVE_ITEM(S5P_CLKSRC_MASK_PERIL0),
SAVE_ITEM(S5P_CLKSRC_MASK_PERIL1),
+   SAVE_ITEM(S5P_CLKDIV2_RATIO),
SAVE_ITEM(S5P_CLKGATE_SCLKCAM),
SAVE_ITEM(S5P_CLKGATE_IP_CAM),
SAVE_ITEM(S5P_CLKGATE_IP_TV),
@@ -122,8 +127,10 @@ static struct sleep_save exynos4_core_save[] = {
SAVE_ITEM(S5P_CLKGATE_IP_DMC),
SAVE_ITEM(S5P_CLKSRC_CPU),
SAVE_ITEM(S5P_CLKDIV_CPU),
+   SAVE_ITEM(S5P_CLKDIV_CPU + 0x4),
SAVE_ITEM(S5P_CLKGATE_SCLKCPU),
SAVE_ITEM(S5P_CLKGATE_IP_CPU),
+
/* GIC side */
SAVE_ITEM(S5P_VA_GIC_CPU + 0x000),
SAVE_ITEM(S5P_VA_GIC_CPU + 0x004),
@@ -232,11 +239,17 @@ static struct sleep_save exynos4_core_save[] = {
SAVE_ITEM(S5P_VA_GIC_DIST + 0xC20),
SAVE_ITEM(S5P_VA_GIC_DIST + 0xC24),
 
-
SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x000),
SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x010),
SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x020),
SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x030),
+
+   /* SROM side */
+   SAVE_ITEM(S5P_SROM_BW),
+   SAVE_ITEM(S5P_SROM_BC0),
+   SAVE_ITEM(S5P_SROM_BC1),
+   SAVE_ITEM(S5P_SROM_BC2),
+   SAVE_ITEM(S5P_SROM_BC3),
 };
 
 static struct sleep_save exynos4_l2cc_save[] = {
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/8] Updated s5p-tv platform definitions

2011-07-19 Thread Marek Szyprowski
Hello,

This patch series contains platform definitions for s5p-tv driver
rebased onto latest for-next branch (including generic GIC and clockdev
changes).

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center


Patch summary:

Tomasz Stanislawski (8):
  ARM: Samsung: add i2c8 controller definitions
  ARM: Exynos4: add support for i2c8 controller (for HDMIPHY)
  ARM: S5PV210: add support for i2c3 controller (for HDMIPHY)
  ARM: S5P: add support for tv device
  ARM: Exynos4: add support for TV device
  ARM: Exynos4: enable TV support on Universal_C210 board
  ARM: S5PV210: add support for TV device
  ARM: S5PV210: enable TV support on GONI board

 arch/arm/mach-exynos4/Kconfig   |2 +
 arch/arm/mach-exynos4/clock.c   |  211 +++
 arch/arm/mach-exynos4/cpu.c |6 +
 arch/arm/mach-exynos4/include/mach/irqs.h   |5 +
 arch/arm/mach-exynos4/include/mach/map.h|   27 +++
 arch/arm/mach-exynos4/include/mach/regs-clock.h |1 +
 arch/arm/mach-exynos4/include/mach/regs-pmu.h   |6 +
 arch/arm/mach-exynos4/mach-universal_c210.c |   76 
 arch/arm/mach-s5pv210/Kconfig   |8 +
 arch/arm/mach-s5pv210/Makefile  |1 +
 arch/arm/mach-s5pv210/clock.c   |  162 --
 arch/arm/mach-s5pv210/cpu.c |5 +
 arch/arm/mach-s5pv210/include/mach/irqs.h   |2 +-
 arch/arm/mach-s5pv210/include/mach/map.h|   18 ++
 arch/arm/mach-s5pv210/include/mach/regs-clock.h |7 +-
 arch/arm/mach-s5pv210/mach-goni.c   |9 +
 arch/arm/mach-s5pv210/setup-i2c3.c  |   26 +++
 arch/arm/plat-s5p/Kconfig   |5 +
 arch/arm/plat-s5p/Makefile  |1 +
 arch/arm/plat-s5p/dev-tv.c  |  100 +++
 arch/arm/plat-samsung/Kconfig   |5 +
 arch/arm/plat-samsung/Makefile  |1 +
 arch/arm/plat-samsung/dev-i2c8.c|   58 ++
 arch/arm/plat-samsung/include/plat/devs.h   |6 +
 arch/arm/plat-samsung/include/plat/iic-core.h   |   14 ++
 arch/arm/plat-samsung/include/plat/iic.h|1 +
 arch/arm/plat-samsung/include/plat/tv-core.h|   44 +
 27 files changed, 793 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-i2c3.c
 create mode 100644 arch/arm/plat-s5p/dev-tv.c
 create mode 100644 arch/arm/plat-samsung/dev-i2c8.c
 create mode 100644 arch/arm/plat-samsung/include/plat/tv-core.h

-- 
1.7.1.569.g6f426

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/8] ARM: Exynos4: enable TV support on Universal_C210 board

2011-07-19 Thread Marek Szyprowski
From: Tomasz Stanislawski t.stanisl...@samsung.com

This patch adds platform devices and regulators for TV devices on
Samsung Universal C210 board.

Signed-off-by: Tomasz Stanislawski t.stanisl...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-exynos4/Kconfig   |2 +
 arch/arm/mach-exynos4/mach-universal_c210.c |   76 +++
 2 files changed, 78 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index 8236ffb..494ff7b 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -166,9 +166,11 @@ config MACH_UNIVERSAL_C210
select S3C_DEV_I2C1
select S3C_DEV_I2C3
select S3C_DEV_I2C5
+   select S3C_DEV_I2C8
select S5P_DEV_MFC
select S5P_DEV_ONENAND
select EXYNOS4_DEV_PD
+   select S5P_DEV_TV
select EXYNOS4_SETUP_I2C1
select EXYNOS4_SETUP_I2C3
select EXYNOS4_SETUP_I2C5
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c 
b/arch/arm/mach-exynos4/mach-universal_c210.c
index 0e280d1..0fd81be 100644
--- a/arch/arm/mach-exynos4/mach-universal_c210.c
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -110,6 +110,8 @@ static struct regulator_consumer_supply 
lp3974_buck1_consumer =
 static struct regulator_consumer_supply lp3974_buck2_consumer =
REGULATOR_SUPPLY(vddg3d, NULL);
 
+static struct regulator_consumer_supply lp3974_buck3_consumer =
+   REGULATOR_SUPPLY(vdet, s5p-sdo);
 static struct regulator_init_data lp3974_buck1_data = {
.constraints= {
.name   = VINT_1.1V,
@@ -153,6 +155,8 @@ static struct regulator_init_data lp3974_buck3_data = {
.enabled= 1,
},
},
+   .num_consumer_supplies = 1,
+   .consumer_supplies = lp3974_buck3_consumer,
 };
 
 static struct regulator_init_data lp3974_buck4_data = {
@@ -181,6 +185,13 @@ static struct regulator_init_data lp3974_ldo2_data = {
},
 };
 
+static struct regulator_consumer_supply lp3974_ldo3_consumer[] = {
+   REGULATOR_SUPPLY(vusb_a, s3c-hsotg),
+   REGULATOR_SUPPLY(vdd11, s5p-mipi-csis.0),
+   REGULATOR_SUPPLY(vdd, exynos4-hdmi),
+   REGULATOR_SUPPLY(vdd_pll, exynos4-hdmi),
+};
+
 static struct regulator_init_data lp3974_ldo3_data = {
.constraints= {
.name   = VUSB+MIPI_1.1V,
@@ -192,6 +203,12 @@ static struct regulator_init_data lp3974_ldo3_data = {
.disabled   = 1,
},
},
+   .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo3_consumer),
+   .consumer_supplies = lp3974_ldo3_consumer,
+};
+
+static struct regulator_consumer_supply lp3974_ldo4_consumer[] = {
+   REGULATOR_SUPPLY(vdd_osc, exynos4-hdmi),
 };
 
 static struct regulator_init_data lp3974_ldo4_data = {
@@ -205,6 +222,8 @@ static struct regulator_init_data lp3974_ldo4_data = {
.disabled   = 1,
},
},
+   .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo4_consumer),
+   .consumer_supplies = lp3974_ldo4_consumer,
 };
 
 static struct regulator_init_data lp3974_ldo5_data = {
@@ -246,6 +265,11 @@ static struct regulator_init_data lp3974_ldo7_data = {
},
 };
 
+static struct regulator_consumer_supply lp3974_ldo8_consumer[] = {
+   REGULATOR_SUPPLY(vusb_d, s3c-hsotg),
+   REGULATOR_SUPPLY(vdd33a_dac, s5p-sdo),
+};
+
 static struct regulator_init_data lp3974_ldo8_data = {
.constraints= {
.name   = VUSB+VDAC_3.3V,
@@ -257,6 +281,8 @@ static struct regulator_init_data lp3974_ldo8_data = {
.disabled   = 1,
},
},
+   .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo8_consumer),
+   .consumer_supplies = lp3974_ldo8_consumer,
 };
 
 static struct regulator_init_data lp3974_ldo9_data = {
@@ -472,6 +498,34 @@ static struct max8998_platform_data universal_lp3974_pdata 
= {
.wakeup = true,
 };
 
+static struct regulator_consumer_supply hdmi_fixed_consumer =
+   REGULATOR_SUPPLY(hdmi-en, exynos4-hdmi);
+
+static struct regulator_init_data hdmi_fixed_voltage_init_data = {
+   .constraints= {
+   .name   = HDMI_5V,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   },
+   .num_consumer_supplies  = 1,
+   .consumer_supplies  = hdmi_fixed_consumer,
+};
+
+static struct fixed_voltage_config hdmi_fixed_voltage_config = {
+   .supply_name= HDMI_EN1,
+   .microvolts = 500,
+   .gpio   = EXYNOS4_GPE0(1),
+   .enable_high= true,
+   .init_data  = hdmi_fixed_voltage_init_data,
+};
+
+static struct platform_device hdmi_fixed_voltage = {
+   .name   = 

[PATCH 3/8] ARM: S5PV210: add support for i2c3 controller (for HDMIPHY)

2011-07-19 Thread Marek Szyprowski
From: Tomasz Stanislawski t.stanisl...@samsung.com

This patch add support for i2c3 controller for S5PV210 platform (as
HDMIPHY dedicated bus).

Signed-off-by: Tomasz Stanislawski t.stanisl...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig |5 
 arch/arm/mach-s5pv210/Makefile|1 +
 arch/arm/mach-s5pv210/clock.c |6 +
 arch/arm/mach-s5pv210/cpu.c   |1 +
 arch/arm/mach-s5pv210/include/mach/map.h  |2 +
 arch/arm/mach-s5pv210/setup-i2c3.c|   26 +
 arch/arm/plat-samsung/include/plat/iic-core.h |7 ++
 7 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-i2c3.c

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index a06acce..26b1f8f 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -28,6 +28,11 @@ config S5PV210_SETUP_I2C2
help
  Common setup code for i2c bus 2.
 
+config S5PV210_SETUP_I2C3
+   bool
+   help
+ Common setup code for i2c bus 3.
+
 config S5PV210_SETUP_IDE
bool
help
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 50907ac..3656d64 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)  += setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_FIMC)   += setup-fimc.o
 obj-$(CONFIG_S5PV210_SETUP_I2C1)   += setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2)   += setup-i2c2.o
+obj-$(CONFIG_S5PV210_SETUP_I2C3)   += setup-i2c3.o
 obj-$(CONFIG_S5PV210_SETUP_IDE)+= setup-ide.o
 obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)   += setup-sdhci.o
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index 52a8e60..f41ee26 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -407,6 +407,12 @@ static struct clk init_clocks_off[] = {
.enable = s5pv210_clk_ip3_ctrl,
.ctrlbit= (19),
}, {
+   .name   = i2c,
+   .devname= s3c2440-hdmiphy-i2c.3,
+   .parent = clk_pclk_psys.clk,
+   .enable = s5pv210_clk_ip3_ctrl,
+   .ctrlbit= (1  11),
+   }, {
.name   = spi,
.devname= s3c64xx-spi.0,
.parent = clk_pclk_psys.clk,
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c
index 61e6c24..2b3fa1d 100644
--- a/arch/arm/mach-s5pv210/cpu.c
+++ b/arch/arm/mach-s5pv210/cpu.c
@@ -138,6 +138,7 @@ void __init s5pv210_map_io(void)
s3c_i2c0_setname(s3c2440-i2c);
s3c_i2c1_setname(s3c2440-i2c);
s3c_i2c2_setname(s3c2440-i2c);
+   s3c_i2c3_setname(s3c2440-hdmiphy-i2c);
 
s3c_fb_setname(s5pv210-fb);
 
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h 
b/arch/arm/mach-s5pv210/include/mach/map.h
index aac343c..bb405b3 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -41,6 +41,7 @@
 #define S5PV210_PA_IIC00xE180
 #define S5PV210_PA_IIC10xFAB0
 #define S5PV210_PA_IIC20xE1A0
+#define S5PV210_PA_IIC30xFA90
 
 #define S5PV210_PA_AC970xE220
 
@@ -100,6 +101,7 @@
 #define S3C_PA_IIC S5PV210_PA_IIC0
 #define S3C_PA_IIC1S5PV210_PA_IIC1
 #define S3C_PA_IIC2S5PV210_PA_IIC2
+#define S3C_PA_IIC3S5PV210_PA_IIC3
 #define S3C_PA_RTC S5PV210_PA_RTC
 #define S3C_PA_USB_HSOTG   S5PV210_PA_HSOTG
 #define S3C_PA_WDT S5PV210_PA_WATCHDOG
diff --git a/arch/arm/mach-s5pv210/setup-i2c3.c 
b/arch/arm/mach-s5pv210/setup-i2c3.c
new file mode 100644
index 000..e6e291e
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-i2c3.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * I2C3 GPIO configuration.
+ *
+ * based on linux/arch/arm/mach-s5pv210/setup-i2c2.c
+ *
+ * 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/kernel.h
+#include linux/types.h
+#include linux/gpio.h
+
+struct platform_device; /* don't need the contents */
+
+#include plat/iic.h
+#include plat/gpio-cfg.h
+
+void s3c_i2c3_cfg_gpio(struct platform_device *dev)
+{
+   /* controller is internally connected, nothing to configure */
+}
diff --git 

[PATCH 8/8] ARM: S5PV210: enable TV support on GONI board

2011-07-19 Thread Marek Szyprowski
From: Tomasz Stanislawski t.stanisl...@samsung.com

This patch adds platform devices and regulators for TV devices on
Samsung Goni board.

Signed-off-by: Tomasz Stanislawski t.stanisl...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig |3 +++
 arch/arm/mach-s5pv210/mach-goni.c |9 +
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 26b1f8f..a4b7579 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -95,13 +95,16 @@ config MACH_GONI
select S3C_DEV_HSMMC2
select S3C_DEV_I2C1
select S3C_DEV_I2C2
+   select S3C_DEV_I2C3
select S5P_DEV_MFC
select S3C_DEV_USB_HSOTG
select S5P_DEV_ONENAND
select SAMSUNG_DEV_KEYPAD
+   select S5P_DEV_TV
select S5PV210_SETUP_FB_24BPP
select S5PV210_SETUP_I2C1
select S5PV210_SETUP_I2C2
+   select S5PV210_SETUP_I2C3
select S5PV210_SETUP_KEYPAD
select S5PV210_SETUP_SDHCI
help
diff --git a/arch/arm/mach-s5pv210/mach-goni.c 
b/arch/arm/mach-s5pv210/mach-goni.c
index 50f2cc7..b0d2894 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -285,6 +285,7 @@ static struct regulator_consumer_supply 
goni_ldo5_consumers[] = {
 
 static struct regulator_consumer_supply goni_ldo8_consumers[] = {
REGULATOR_SUPPLY(vusb_d, s3c-hsotg),
+   REGULATOR_SUPPLY(vdd33a_dac, s5p-sdo),
 };
 
 static struct regulator_consumer_supply goni_ldo11_consumers[] = {
@@ -475,6 +476,10 @@ static struct regulator_consumer_supply buck1_consumer =
 static struct regulator_consumer_supply buck2_consumer =
REGULATOR_SUPPLY(vddint, NULL);
 
+static struct regulator_consumer_supply buck3_consumer =
+   REGULATOR_SUPPLY(vdet, s5p-sdo);
+
+
 static struct regulator_init_data goni_buck1_data = {
.constraints= {
.name   = VARM_1.2V,
@@ -511,6 +516,8 @@ static struct regulator_init_data goni_buck3_data = {
.enabled = 1,
},
},
+   .num_consumer_supplies  = 1,
+   .consumer_supplies  = buck3_consumer,
 };
 
 static struct regulator_init_data goni_buck4_data = {
@@ -812,6 +819,8 @@ static struct platform_device *goni_devices[] __initdata = {
s5p_device_mfc,
s5p_device_mfc_l,
s5p_device_mfc_r,
+   s5p_device_mixer,
+   s5p_device_sdo,
s3c_device_i2c0,
s5p_device_fimc0,
s5p_device_fimc1,
-- 
1.7.1.569.g6f426

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] ARM: SAMSUNG: Code cleanup for various devices

2011-07-19 Thread Banajit Goswami
 Use generic s3c_set_platdata to perform the same job. Saves a few lines
 of code. 
 
 The patches are created against for-next branch of Kukjin Kim's tree at:
 git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

 These patches are only compile tested.

 o To Kukjin Kim
  PATCH[1/7] ARM: SAMSUNG: Use generic s3c_set_platdata for TS
  PATCH[2/7] ARM: SAMSUNG: Use generic s3c_set_platdata for FB
  PATCH[3/7] ARM: SAMSUNG: Use generic s3c_set_platdata for HWMON
  PATCH[4/7] ARM: SAMSUNG: Use generic s3c_set_platdata for USB OHCI
  PATCH[5/7] ARM: SAMSUNG: Use generic s3c_set_platdata for NAND

 o To Ben Dooks
  PATCH[6/7] ARM: S3C64XX: Use generic s3c_set_platdata for OneNAND
  PATCH[7/7] ARM: S3C24XX: Use generic s3c_set_platdata for devices

 arch/arm/mach-s3c64xx/dev-onenand1.c |   10 +++-
 arch/arm/plat-s3c24xx/devs.c |   38 ++---
 arch/arm/plat-samsung/dev-fb.c   |   14 +--
 arch/arm/plat-samsung/dev-hwmon.c|   14 +--
 arch/arm/plat-samsung/dev-nand.c |9 ++-
 arch/arm/plat-samsung/dev-ts.c   |   14 +--
 arch/arm/plat-samsung/dev-usb.c  |9 +--
 7 files changed, 22 insertions(+), 86 deletions(-)

-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] ARM: SAMSUNG: Use generic s3c_set_platdata for TS

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata to set TS platform data

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-samsung/dev-ts.c |   14 ++
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/arm/plat-samsung/dev-ts.c b/arch/arm/plat-samsung/dev-ts.c
index 3e4bd81..82543f0 100644
--- a/arch/arm/plat-samsung/dev-ts.c
+++ b/arch/arm/plat-samsung/dev-ts.c
@@ -45,16 +45,6 @@ struct platform_device s3c_device_ts = {
 
 void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
 {
-   struct s3c2410_ts_mach_info *npd;
-
-   if (!pd) {
-   printk(KERN_ERR %s: no platform data\n, __func__);
-   return;
-   }
-
-   npd = kmemdup(pd, sizeof(struct s3c2410_ts_mach_info), GFP_KERNEL);
-   if (!npd)
-   printk(KERN_ERR %s: no memory for platform data\n, __func__);
-
-   s3c_device_ts.dev.platform_data = npd;
+   s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
+s3c_device_ts);
 }
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] ARM: SAMSUNG: Use generic s3c_set_platdata for FB

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata to set FB platform data

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-samsung/dev-fb.c |   14 ++
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/arm/plat-samsung/dev-fb.c b/arch/arm/plat-samsung/dev-fb.c
index bf60204..49a1362 100644
--- a/arch/arm/plat-samsung/dev-fb.c
+++ b/arch/arm/plat-samsung/dev-fb.c
@@ -58,16 +58,6 @@ struct platform_device s3c_device_fb = {
 
 void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
 {
-   struct s3c_fb_platdata *npd;
-
-   if (!pd) {
-   printk(KERN_ERR %s: no platform data\n, __func__);
-   return;
-   }
-
-   npd = kmemdup(pd, sizeof(struct s3c_fb_platdata), GFP_KERNEL);
-   if (!npd)
-   printk(KERN_ERR %s: no memory for platform data\n, __func__);
-
-   s3c_device_fb.dev.platform_data = npd;
+   s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
+s3c_device_fb);
 }
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] ARM: SAMSUNG: Use generic s3c_set_platdata for NAND

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata to set NAND platdata

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-samsung/dev-nand.c |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-samsung/dev-nand.c b/arch/arm/plat-samsung/dev-nand.c
index 6927ae8..b8e30ec 100644
--- a/arch/arm/plat-samsung/dev-nand.c
+++ b/arch/arm/plat-samsung/dev-nand.c
@@ -91,11 +91,10 @@ void __init s3c_nand_set_platdata(struct 
s3c2410_platform_nand *nand)
 * time then there is little chance the system is going to run.
 */ 
 
-   npd = kmemdup(nand, sizeof(struct s3c2410_platform_nand), GFP_KERNEL);
-   if (!npd) {
-   printk(KERN_ERR %s: failed copying platform data\n, __func__);
+   npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand),
+   s3c_device_nand);
+   if (!npd)
return;
-   }
 
/* now see if we need to copy any of the nand set data */
 
@@ -123,6 +122,4 @@ void __init s3c_nand_set_platdata(struct 
s3c2410_platform_nand *nand)
to++;
}
}
-
-   s3c_device_nand.dev.platform_data = npd;
 }
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] ARM: S3C64XX: Use generic s3c_set_platdata for OneNAND

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata for setting platdata for OneNAND on
S3C64XX

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s3c64xx/dev-onenand1.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/dev-onenand1.c 
b/arch/arm/mach-s3c64xx/dev-onenand1.c
index 92ffd5b..999f9e1 100644
--- a/arch/arm/mach-s3c64xx/dev-onenand1.c
+++ b/arch/arm/mach-s3c64xx/dev-onenand1.c
@@ -19,6 +19,8 @@
 #include mach/irqs.h
 #include mach/map.h
 
+#include plat/devs.h
+
 static struct resource s3c64xx_onenand1_resources[] = {
[0] = {
.start  = S3C64XX_PA_ONENAND1,
@@ -46,10 +48,6 @@ struct platform_device s3c64xx_device_onenand1 = {
 
 void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
 {
-   struct onenand_platform_data *pd;
-
-   pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL);
-   if (!pd)
-   printk(KERN_ERR %s: no memory for platform data\n, __func__);
-   s3c64xx_device_onenand1.dev.platform_data = pd;
+   s3c_set_platdata(pdata, sizeof(struct onenand_platform_data),
+s3c64xx_device_onenand1);
 }
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] ARM: S3C24XX: Use generic s3c_set_platdata for devices

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata for various set_platdata functions
of S3C24XX

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-s3c24xx/devs.c |   38 +++---
 1 files changed, 7 insertions(+), 31 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 7366799..a76bf2d 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -150,9 +150,8 @@ void __init s3c24xx_fb_set_platdata(struct 
s3c2410fb_mach_info *pd)
 {
struct s3c2410fb_mach_info *npd;
 
-   npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+   npd = s3c_set_platdata(pd, sizeof(*npd), s3c_device_lcd);
if (npd) {
-   s3c_device_lcd.dev.platform_data = npd;
npd-displays = kmemdup(pd-displays,
sizeof(struct s3c2410fb_display) * npd-num_displays,
GFP_KERNEL);
@@ -188,12 +187,10 @@ struct platform_device s3c_device_ts = {
 };
 EXPORT_SYMBOL(s3c_device_ts);
 
-static struct s3c2410_ts_mach_info s3c2410ts_info;
-
 void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info 
*hard_s3c2410ts_info)
 {
-   memcpy(s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct 
s3c2410_ts_mach_info));
-   s3c_device_ts.dev.platform_data = s3c2410ts_info;
+   s3c_set_platdata(hard_s3c2410ts_info,
+sizeof(struct s3c2410_ts_mach_info), s3c_device_ts);
 }
 
 /* USB Device (Gadget)*/
@@ -223,15 +220,7 @@ EXPORT_SYMBOL(s3c_device_usbgadget);
 
 void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
 {
-   struct s3c2410_udc_mach_info *npd;
-
-   npd = kmalloc(sizeof(*npd), GFP_KERNEL);
-   if (npd) {
-   memcpy(npd, pd, sizeof(*npd));
-   s3c_device_usbgadget.dev.platform_data = npd;
-   } else {
-   printk(KERN_ERR no memory for udc platform data\n);
-   }
+   s3c_set_platdata(pd, sizeof(*pd), s3c_device_usbgadget);
 }
 
 /* USB High Speed 2.0 Device (Gadget) */
@@ -263,15 +252,7 @@ struct platform_device s3c_device_usb_hsudc = {
 
 void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
 {
-   struct s3c24xx_hsudc_platdata *npd;
-
-   npd = kmalloc(sizeof(*npd), GFP_KERNEL);
-   if (npd) {
-   memcpy(npd, pd, sizeof(*npd));
-   s3c_device_usb_hsudc.dev.platform_data = npd;
-   } else {
-   printk(KERN_ERR no memory for udc platform data\n);
-   }
+   s3c_set_platdata(pd, sizeof(*pd), s3c_device_usb_hsudc);
 }
 
 /* IIS */
@@ -383,13 +364,8 @@ EXPORT_SYMBOL(s3c_device_sdi);
 
 void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
 {
-   struct s3c24xx_mci_pdata *npd;
-
-   npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL);
-   if (!npd)
-   printk(KERN_ERR %s: no memory to copy pdata, __func__);
-
-   s3c_device_sdi.dev.platform_data = npd;
+   s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata),
+s3c_device_sdi);
 }
 
 
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] [CPUFREQ] EXYNOS4210: Add Support for DVS Lock

2011-07-19 Thread Mark Brown
On Mon, Jul 18, 2011 at 04:08:53PM +0900, Kukjin Kim wrote:

  This feels like something cpufreq should support to at least some extent
  in the core, especially the thing with forcing a particular mode on
  suspend.  Not that I have any particularly bright ideas for how
  immediately.

 Basically, I agreed, but I also have no idea yet :(
 How about to use this for now then let us think the way?

Probably just as well.  For the suspend stuff we should be able to
implement a generic override the governor callback for use in suspend
entry easily enough but for other things I'm drawing a blank right now.
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 1/6] Samsung SoC ADC: use regulator (VDD for ADC).

2011-07-19 Thread Mark Brown
On Sat, Jul 16, 2011 at 02:07:13PM +0900, Kukjin Kim wrote:
 Mark Brown wrote:

  If there isn't a separate supply for the regulators on S3C24xx devices
  then I guess the best option is to provide that supply as a dummy
  regulator in the s3c24xx core code.

 OK, but it means I can't apply this until adding a dummy regulator for
 S3C24XX?

That could always come later as a bug fix :)  The regulator API does
have a couple of methods of substituting in a dummy regulator itself,
though it does complain a bit, so it should mostly be a simple config
change to work around on affected systems.
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] arm: dt: Add device tree support for i2c instance 1 on exynos4 dt machine

2011-07-19 Thread G, Manjunath Kondaiah
On Tue, Jul 19, 2011 at 2:00 AM, Grant Likely grant.lik...@secretlab.ca wrote:
 On Mon, Jul 18, 2011 at 5:53 AM, G, Manjunath Kondaiah
 manj...@linaro.org wrote:
 Abraham,
 Few comments on i2c child devices handling:

 On 18 July 2011 06:20, Thomas Abraham thomas.abra...@linaro.org wrote:
 Add device node for i2c instance 1 and list all its connected slave
 devices.

 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
 ---
  arch/arm/boot/dts/exynos4-smdkv310.dts  |   19 ++-
  arch/arm/mach-exynos4/Kconfig           |    1 +
  arch/arm/mach-exynos4/mach-exynos4-dt.c |    9 +
  3 files changed, 28 insertions(+), 1 deletions(-)

 diff --git a/arch/arm/boot/dts/exynos4-smdkv310.dts 
 b/arch/arm/boot/dts/exynos4-smdkv310.dts
 index d65c18c..29c40ed 100644
 --- a/arch/arm/boot/dts/exynos4-smdkv310.dts
 +++ b/arch/arm/boot/dts/exynos4-smdkv310.dts
 @@ -23,7 +23,7 @@
        };

        chosen {
 -               bootargs = root=/dev/mmcblk0p1 rootfstype=ext3 rootwait 
 console=ttySAC1,115200;
 +               bootargs = root=/dev/mmcblk0p1 rootfstype=ext3 rootwait 
 console=ttySAC1,115200 init=/linuxrc;
        };

        soc {
 @@ -64,5 +64,22 @@
                        samsung,sdhci-cd-type = 0;
                        samsung,sdhci-clkdiv-external;
                };
 +
 +               i2c@1387 {
 +                       compatible = samsung,s3c2440-i2c;
 +                       reg = 0x1387 0x100;
 +                       interrupts = 345;
 +                       samsung,i2c-bus-number = 1;
 +                       samsung,i2c-slave-addr = 16;
 +                       samsung,i2c-sda-delay = 100;
 +                       samsung,i2c-max-bus-freq = 10;
 +                       #address-cells = 1;
 +                       #size-cells = 0;
 +
 +                       wm8994@1a {
 +                               compatible = wlf,wm8994;
 +                               reg = 0x1a;
 +                       };

 The i2c child devices are board specific.
 For ex: few boards such as smdkxxx based on exynos4 has wm8994 with
 i2c1 controller
 where as other boards based on exynos4 does not have any i2c1 devices.
 Hence these child entries should go to board specific .dts file right?

 No, the i2c bus node should still appear in the SoC .dtsi file.  If a
 board doesn't use a particular i2c bus, then the board.dts file can
 add a status = disabled; property to the i2c bus node to disable it.

that's right. I am referring to I2C slave devices. For a given SoC,
two different
boards can have different i2c slave devices with different slave
address. In that case,
it is better to have i2c child/slave nodes in board .dts file.

-M
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] ARM: EXYNOS4: Add platform device for dwmci driver.

2011-07-19 Thread Seungwon Jeon
This patch adds platform device for Synopsys DesignWare Multimedia Card
Interface driver.

Signed-off-by: Seungwon Jeon tgih@samsung.com
---
 arch/arm/mach-exynos4/Kconfig  |5 ++
 arch/arm/mach-exynos4/Makefile |1 +
 arch/arm/mach-exynos4/dev-dwmci.c  |   82 
 arch/arm/mach-exynos4/include/mach/dwmci.h |   20 +++
 arch/arm/mach-exynos4/include/mach/irqs.h  |1 +
 arch/arm/mach-exynos4/include/mach/map.h   |1 +
 arch/arm/plat-samsung/include/plat/devs.h  |1 +
 7 files changed, 111 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-exynos4/dev-dwmci.c
 create mode 100644 arch/arm/mach-exynos4/include/mach/dwmci.h

diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index a4fb109..31f798c 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -36,6 +36,11 @@ config EXYNOS4_DEV_SYSMMU
help
  Common setup code for SYSTEM MMU in EXYNOS4

+config EXYNOS4_DEV_DWMCI
+   bool
+   help
+ Compile in platform device definitions for DWMCI
+
 config EXYNOS4_SETUP_I2C1
bool
help
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
index c3c70ab..4c4ea6b 100644
--- a/arch/arm/mach-exynos4/Makefile
+++ b/arch/arm/mach-exynos4/Makefile
@@ -38,6 +38,7 @@ obj-y += dev-audio.o
 obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o
 obj-$(CONFIG_EXYNOS4_DEV_PD)   += dev-pd.o
 obj-$(CONFIG_EXYNOS4_DEV_SYSMMU)   += dev-sysmmu.o
+obj-$(CONFIG_EXYNOS4_DEV_DWMCI)+= dev-dwmci.o

 obj-$(CONFIG_EXYNOS4_SETUP_FIMC)   += setup-fimc.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C1)   += setup-i2c1.o
diff --git a/arch/arm/mach-exynos4/dev-dwmci.c 
b/arch/arm/mach-exynos4/dev-dwmci.c
new file mode 100644
index 000..b025db4
--- /dev/null
+++ b/arch/arm/mach-exynos4/dev-dwmci.c
@@ -0,0 +1,82 @@
+/*
+ * linux/arch/arm/mach-exynos4/dev-dwmci.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Platform device for Synopsys DesignWare Mobile Storage IP
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include linux/kernel.h
+#include linux/dma-mapping.h
+#include linux/platform_device.h
+#include linux/interrupt.h
+#include linux/mmc/dw_mmc.h
+
+#include plat/devs.h
+
+#include mach/map.h
+
+static int exynos4_dwmci_get_bus_wd(u32 slot_id)
+{
+   return 4;
+}
+
+static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler, void *data)
+{
+   return 0;
+}
+
+static struct resource exynos4_dwmci_resource[] = {
+   [0] = {
+   .start  = EXYNOS4_PA_DWMCI,
+   .end= EXYNOS4_PA_DWMCI + SZ_4K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = IRQ_DWMCI,
+   .end= IRQ_DWMCI,
+   .flags  = IORESOURCE_IRQ,
+   }
+};
+
+static struct dw_mci_board exynos4_dwci_pdata = {
+   .num_slots  = 1,
+   .quirks = DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
+   .bus_hz = 80 * 1000 * 1000,
+   .detect_delay_ms= 200,
+   .init   = exynos4_dwmci_init,
+   .get_bus_wd = exynos4_dwmci_get_bus_wd,
+};
+
+static u64 exynos4_dwmci_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device exynos4_device_dwmci = {
+   .name   = dw_mmc,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(exynos4_dwmci_resource),
+   .resource   = exynos4_dwmci_resource,
+   .dev= {
+   .dma_mask   = exynos4_dwmci_dmamask,
+   .coherent_dma_mask  = DMA_BIT_MASK(32),
+   .platform_data  = exynos4_dwci_pdata,
+   },
+};
+
+void __init exynos4_dwmci_set_platdata(struct dw_mci_board *pd)
+{
+   struct dw_mci_board *npd;
+
+   npd = s3c_set_platdata(pd, sizeof(struct dw_mci_board),
+   exynos4_device_dwmci);
+
+   if (!npd-init)
+   npd-init = exynos4_dwmci_init;
+   if (!npd-get_bus_wd)
+   npd-get_bus_wd = exynos4_dwmci_get_bus_wd;
+}
diff --git a/arch/arm/mach-exynos4/include/mach/dwmci.h 
b/arch/arm/mach-exynos4/include/mach/dwmci.h
new file mode 100644
index 000..7ce6574
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/dwmci.h
@@ -0,0 +1,20 @@
+/* linux/arch/arm/mach-exynos4/include/mach/dwmci.h
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * Synopsys DesignWare Mobile Storage for EXYNOS4210
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under