Re: [PATCH v3] i2c: s3c2410: enable RuntimePM before registering to the core

2015-10-12 Thread Kukjin Kim
On 10/10/15 16:24, Wolfram Sang wrote:
> From: Wolfram Sang <wsa+rene...@sang-engineering.com>
> 
> The core may register clients attached to this master which may use
> funtionality from the master. So, RuntimePM must be enabled before, otherwise
> this will fail. While here, move drvdata, too.
> 
> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>

Looks good to me,

Acked-by: Kukjin Kim <kg...@kernel.org>

Thanks,
Kukjin

> ---
> 
> Changes since v2: don't call runtime pm on adaper if it wasn't registered
> 
> Thanks to Krzysztof for testing!
> 
>  drivers/i2c/busses/i2c-s3c2410.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v4 1/2] i2c: s3c2410: Handle i2c sys_cfg register in i2c driver

2014-11-21 Thread Kukjin Kim
Pankaj Dubey wrote:
 
 On Friday 21 November 2014 12:55 PM, Wolfram Sang wrote:
  On Thu, Oct 30, 2014 at 01:34:29PM +0530, Pankaj Dubey wrote:
  Let's handle i2c interrupt re-configuration in i2c driver. This will
  help us in removing some soc specific checks from machine files and
  will help in removing static iomapping of SYS register in exynos.c
 
  Since only Exynos5250, and Exynos5420 has i2c nodes in DT, added syscon
  based phandle to i2c device nodes of respective SoC DT files.
 
Well...actually there are 4ch i2c in exynos5410 and exynos5800 as well, i2c
nodes are not added in dt files though.

  Also handle saving and restoring of SYS_I2C_CFG register during
  suspend and resume of i2c driver.
 
  CC: Rob Herring robh...@kernel.org
  CC: Randy Dunlap rdun...@infradead.org
  CC: Wolfram Sang w...@the-dreams.de
  CC: Russell King li...@arm.linux.org.uk
  CC: devicet...@vger.kernel.org
  CC: linux-...@vger.kernel.org
  CC: linux-i2c@vger.kernel.org
  Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
  ---
.../devicetree/bindings/i2c/i2c-s3c2410.txt|1 +
arch/arm/boot/dts/exynos5250.dtsi  |4 +++
arch/arm/boot/dts/exynos5420.dtsi  |4 +++
 
  I usually don't take DTS patches. They should go via arm-soc. Please say
  so if there are reasons I should take them.
 
 I CC'ed to you because same patch contains changes in i2c driver.
 I am not very sure via which tree this should go. May be I can ask
 samsung SoC maintainer Kukjin to look into this, as patch 2/2 has
 changes in mach-exynos which should go via Kukjin's tree.
 
I'll reply on other email.

Thanks,
Kukjin

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


RE: [PATCH v4 1/2] i2c: s3c2410: Handle i2c sys_cfg register in i2c driver

2014-11-21 Thread Kukjin Kim
Wolfram Sang wrote:
 
Hi Wolfram,

  I usually don't take DTS patches. They should go via arm-soc. Please say
  so if there are reasons I should take them.
 
  I CC'ed to you because same patch contains changes in i2c driver.
 
 Yes, those should absolutely go via my I2C tree. You need to make a
 seperate patch out of the dts changes which then also should go via
 samsung-soc, unless Kukjin says he really wants to go the via I2C. But I
 guess the latter will just create merge conflicts.

Hmm...I think, Pankaj needs to submit separated patches 1) driver change, 2) dt
change and then 3) remove change. And 2nd and 3rd changes should be handed in
Samsung tree together after landing 1) change in -next.

Of course, 1) change should be handled in i2c tree ;)

Thanks,
Kukjin

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


RE: [PATCH 1/1] i2c: Kconfig: Enable HSI2C for Exynos5 platform

2014-06-25 Thread Kukjin Kim
Sachin Kamat wrote:
 
 All Exynos5 platforms have HSI2C controllers and are needed by
 various IPs connected to the boards based on these SoCs. Thus
 select this by default for Exynos5 platforms.
 
Yeah right, even upcoming exynos5 SoCs have only HS-I2C not I2C ;-)

 Signed-off-by: Sachin Kamat sachin.ka...@samsung.com
 Cc: Doug Anderson diand...@chromium.org

Acked-by: Kukjin Kim kgene@samsung.com

Thanks,
Kukjin

 ---
  drivers/i2c/busses/Kconfig |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
 index 9f7d5859cf65..c7918cffe790 100644
 --- a/drivers/i2c/busses/Kconfig
 +++ b/drivers/i2c/busses/Kconfig
 @@ -465,9 +465,9 @@ config I2C_EG20T
  config I2C_EXYNOS5
   tristate Exynos5 high-speed I2C driver
   depends on ARCH_EXYNOS5  OF
 + default y
   help
 -   Say Y here to include support for high-speed I2C controller in the
 -   Exynos5 based Samsung SoCs.
 +   High-speed I2C controller on Exynos5 based Samsung SoCs.
 
  config I2C_GPIO
   tristate GPIO-based bitbanging I2C
 --
 1.7.9.5

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


RE: [PATCH v2] i2c: exynos5: Properly use the noirq variants of suspend/resume

2014-06-25 Thread Kukjin Kim
Doug Anderson wrote:
 
 The original code for the exynos i2c controller registered for the
 noirq variants.  However during review feedback it was moved to
 SIMPLE_DEV_PM_OPS without anyone noticing that it meant we were no
 longer actually noirq (despite functions named
 exynos5_i2c_suspend_noirq and exynos5_i2c_resume_noirq).
 
 i2c controllers that might have wakeup sources on them seem to need to
 resume at noirq time so that the individual drivers can actually read
 the i2c bus to handle their wakeup.
 
 NOTE: I took the original review feedback from Wolfram and added
 poweroff, thaw, freeze, restore.
 
Yeah I'm not sure except .suspend_noirq and .resume_noirq but I'm fine if
Wolfram suggested ;-)

 This patch has only been compile-tested since I don't have all the
 patches needed to make my machine using this i2c driver actually
 suspend/resume.
 
 Signed-off-by: Doug Anderson diand...@chromium.org
 ---
 Changes in v2:
 - Added missing CONFIG_PM_SLEEP
 
  drivers/i2c/busses/i2c-exynos5.c | 12 ++--
  1 file changed, 10 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-
 exynos5.c
 index 63d2292..348b1cd 100644
 --- a/drivers/i2c/busses/i2c-exynos5.c
 +++ b/drivers/i2c/busses/i2c-exynos5.c
 @@ -789,8 +789,16 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
  }
  #endif
 
 -static SIMPLE_DEV_PM_OPS(exynos5_i2c_dev_pm_ops, exynos5_i2c_suspend_noirq,
 -  exynos5_i2c_resume_noirq);
 +const struct dev_pm_ops exynos5_i2c_dev_pm_ops = {

Maybe static const struct...?

 +#ifdef CONFIG_PM_SLEEP
 + .suspend_noirq = exynos5_i2c_suspend_noirq,
 + .resume_noirq = exynos5_i2c_resume_noirq,
 + .freeze_noirq = exynos5_i2c_suspend_noirq,
 + .thaw_noirq = exynos5_i2c_resume_noirq,
 + .poweroff_noirq = exynos5_i2c_suspend_noirq,
 + .restore_noirq = exynos5_i2c_resume_noirq,
 +#endif
 +};
 
  static struct platform_driver exynos5_i2c_driver = {
   .probe  = exynos5_i2c_probe,
 --
 2.0.0.526.g5318336

Others look good to me,

Acked-by: Kukjin Kim kgene@samsung.com

Thanks,
Kukjin

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


RE: [PATCH] i2c: s3c2410: resume race fix

2014-04-23 Thread Kukjin Kim
Doug Anderson wrote:
 
 From: Olof Johansson o...@lixom.net
 
 Don't unmark the device as suspended until after it's been re-setup.
 
 The main race would be w.r.t. an i2c driver that gets resumed at the same
 time (asyncronously), that is allowed to do a transfer since suspended
 is set to 0 before reinit, but really should have seen the -EIO return
 instead.
 
 Signed-off-by: Olof Johansson o...@lixom.net
 Signed-off-by: Doug Anderson diand...@chromium.org

Acked-by: Kukjin Kim kgene@samsung.com

Thanks,
Kukjin

 ---
  drivers/i2c/busses/i2c-s3c2410.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-
 s3c2410.c
 index ae44910..bb3a996 100644
 --- a/drivers/i2c/busses/i2c-s3c2410.c
 +++ b/drivers/i2c/busses/i2c-s3c2410.c
 @@ -1276,10 +1276,10 @@ static int s3c24xx_i2c_resume(struct device *dev)
   struct platform_device *pdev = to_platform_device(dev);
   struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
 
 - i2c-suspended = 0;
   clk_prepare_enable(i2c-clk);
   s3c24xx_i2c_init(i2c);
   clk_disable_unprepare(i2c-clk);
 + i2c-suspended = 0;
 
   return 0;
  }
 --
 1.9.1.423.g4596e3a

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


Re: [PATCH] ARM: DTS: exynos5420: Rename hsi2c compatible to exynos5250-hsi2c

2014-02-13 Thread Kukjin Kim

On 02/06/14 21:07, Naveen Krishna Chatradhi wrote:

As per the changes submitted for the i2c-exynos5.c driver with the
compatible string being named after the first SoC it is observed on.
This patch modifes the existing hsi2c compatible strings in
arch/arm/boot/dts.

Signed-off-by: Naveen Krishna Chatradhich.nav...@samsung.com
---
  arch/arm/boot/dts/exynos5420.dtsi |   14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 11dd202..c5187d1 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -486,7 +486,7 @@
};

hsi2c_4: i2c@12CA {
-   compatible = samsung,exynos5-hsi2c;
+   compatible = samsung,exynos5250-hsi2c;
reg =0x12CA 0x1000;
interrupts =0 60 0;
#address-cells =1;
@@ -499,7 +499,7 @@
};

hsi2c_5: i2c@12CB {
-   compatible = samsung,exynos5-hsi2c;
+   compatible = samsung,exynos5250-hsi2c;
reg =0x12CB 0x1000;
interrupts =0 61 0;
#address-cells =1;
@@ -512,7 +512,7 @@
};

hsi2c_6: i2c@12CC {
-   compatible = samsung,exynos5-hsi2c;
+   compatible = samsung,exynos5250-hsi2c;
reg =0x12CC 0x1000;
interrupts =0 62 0;
#address-cells =1;
@@ -525,7 +525,7 @@
};

hsi2c_7: i2c@12CD {
-   compatible = samsung,exynos5-hsi2c;
+   compatible = samsung,exynos5250-hsi2c;
reg =0x12CD 0x1000;
interrupts =0 63 0;
#address-cells =1;
@@ -538,7 +538,7 @@
};

hsi2c_8: i2c@12E0 {
-   compatible = samsung,exynos5-hsi2c;
+   compatible = samsung,exynos5250-hsi2c;
reg =0x12E0 0x1000;
interrupts =0 87 0;
#address-cells =1;
@@ -551,7 +551,7 @@
};

hsi2c_9: i2c@12E1 {
-   compatible = samsung,exynos5-hsi2c;
+   compatible = samsung,exynos5250-hsi2c;
reg =0x12E1 0x1000;
interrupts =0 88 0;
#address-cells =1;
@@ -564,7 +564,7 @@
};

hsi2c_10: i2c@12E2 {
-   compatible = samsung,exynos5-hsi2c;
+   compatible = samsung,exynos5250-hsi2c;
reg =0x12E2 0x1000;
interrupts =0 203 0;
#address-cells =1;


Naveen,

Please don't post separately for one series. It's hard to find to look 
at regarding patches.


And please post regarding binding doc together. Additionally if you run 
checkpatch, you can see see below complaining.


WARNING: DT compatible string samsung,exynos5250-hsi2c appears 
un-documented -- check ./Documentation/devicetree/bindings/


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


Re: [PATCH 08/33] drivers/i2c/busses: don't check resource with devm_ioremap_resource

2013-05-20 Thread Kukjin Kim

On 05/16/13 20:15, Wolfram Sang wrote:

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sangw...@the-dreams.de


For i2c-s3c2410:
Acked-by: Kukjin Kim kgene@samsung.com

Thanks.

- Kukjin


---
  drivers/i2c/busses/i2c-s3c2410.c |5 -
  drivers/i2c/busses/i2c-sirf.c|6 --
  drivers/i2c/busses/i2c-tegra.c   |5 -
  3 files changed, 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 6e8ee92..cab1c91 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1082,11 +1082,6 @@ static int s3c24xx_i2c_probe(struct platform_device 
*pdev)
/* map the registers */

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (res == NULL) {
-   dev_err(pdev-dev, cannot find IO resource\n);
-   return -ENOENT;
-   }
-
i2c-regs = devm_ioremap_resource(pdev-dev, res);

if (IS_ERR(i2c-regs))
diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 5a7ad24..a63c7d5 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -303,12 +303,6 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
adap-class = I2C_CLASS_HWMON;

mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (mem_res == NULL) {
-   dev_err(pdev-dev, Unable to get MEM resource\n);
-   err = -EINVAL;
-   goto out;
-   }
-
siic-base = devm_ioremap_resource(pdev-dev, mem_res);
if (IS_ERR(siic-base)) {
err = PTR_ERR(siic-base);
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index b60ff90..9aa1b60 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -714,11 +714,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
int ret = 0;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(pdev-dev, no mem resource\n);
-   return -EINVAL;
-   }
-
base = devm_ioremap_resource(pdev-dev, res);
if (IS_ERR(base))
return PTR_ERR(base);

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


RE: [PATCH 1/2] i2c: s3c2410: move mach/regs-iic.h into i2c-s3c2410 device driver

2013-02-12 Thread Kukjin Kim
 S3C2410_IICSTAT_MODEMASK (36)
 +
 +#define S3C2410_IICSTAT_START(15)
 +#define S3C2410_IICSTAT_BUSBUSY  (15)
 +#define S3C2410_IICSTAT_TXRXEN   (14)
 +#define S3C2410_IICSTAT_ARBITR   (13)
 +#define S3C2410_IICSTAT_ASSLAVE  (12)
 +#define S3C2410_IICSTAT_ADDR0(11)
 +#define S3C2410_IICSTAT_LASTBIT  (10)
 +
 +#define S3C2410_IICLC_SDA_DELAY0 (0  0)
 +#define S3C2410_IICLC_SDA_DELAY5 (1  0)
 +#define S3C2410_IICLC_SDA_DELAY10(2  0)
 +#define S3C2410_IICLC_SDA_DELAY15(3  0)
 +#define S3C2410_IICLC_SDA_DELAY_MASK (3  0)
 +
 +#define S3C2410_IICLC_FILTER_ON  (12)
 +
  /* Treat S3C2410 as baseline hardware, anything else is supported via quirks
 */
  #define QUIRK_S3C2440(1  0)
  #define QUIRK_HDMIPHY(1  1)
 --
 1.7.2.3

Looks good to me on this series:
Acked-by: Kukjin Kim kgene@samsung.com

Hi Wolfram, if you're ok on this, please pick up into your tree with my ack.

Thanks.

- Kukjin


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


RE: [PATCH 1/2] i2c: s3c2410: move mach/regs-iic.h into i2c-s3c2410 device driver

2013-02-12 Thread Kukjin Kim
Kukjin Kim wrote:
 
 Heiko Stübner wrote:
 
  The register definitions are only used in the driver itself.
  This also removes the last dependency on plat/ includes from the i2c
  driver.
 
  Signed-off-by: Heiko Stuebner he...@sntech.de
  ---
   arch/arm/mach-s3c24xx/mach-rx1950.c   |1 -
   arch/arm/plat-samsung/devs.c  |1 -
   arch/arm/plat-samsung/include/plat/regs-iic.h |   56 
  -
   drivers/i2c/busses/i2c-s3c2410.c  |   41 ++-
   4 files changed, 40 insertions(+), 59 deletions(-)  delete mode
  100644 arch/arm/plat-samsung/include/plat/regs-iic.h
 
  diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-
  s3c24xx/mach-rx1950.c index 799af43..64b52a9 100644
  --- a/arch/arm/mach-s3c24xx/mach-rx1950.c
  +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
  @@ -56,7 +56,6 @@
   #include plat/cpu.h
   #include plat/devs.h
   #include plat/pm.h
  -#include plat/regs-iic.h
   #include plat/regs-serial.h
   #include plat/samsung-time.h
 
  diff --git a/arch/arm/plat-samsung/devs.c
  b/arch/arm/plat-samsung/devs.c index e1124d9..6317a9e 100644
  --- a/arch/arm/plat-samsung/devs.c
  +++ b/arch/arm/plat-samsung/devs.c
  @@ -62,7 +62,6 @@
   #include linux/platform_data/usb-s3c2410_udc.h
   #include linux/platform_data/usb-ohci-s3c2410.h
   #include plat/usb-phy.h
  -#include plat/regs-iic.h
   #include plat/regs-serial.h
   #include plat/regs-spi.h
   #include linux/platform_data/spi-s3c64xx.h
  diff --git a/arch/arm/plat-samsung/include/plat/regs-iic.h
  b/arch/arm/plat- samsung/include/plat/regs-iic.h deleted file mode
  100644 index 2f7c17d..000
  --- a/arch/arm/plat-samsung/include/plat/regs-iic.h
  +++ /dev/null
  @@ -1,56 +0,0 @@
  -/* arch/arm/mach-s3c2410/include/mach/regs-iic.h
  - *
  - * Copyright (c) 2004 Simtec Electronics li...@simtec.co.uk
  - * http://www.simtec.co.uk/products/SWLINUX/
  - *
  - * 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.
  - *
  - * S3C2410 I2C Controller
  -*/
  -
  -#ifndef __ASM_ARCH_REGS_IIC_H
  -#define __ASM_ARCH_REGS_IIC_H __FILE__
  -
  -/* see s3c2410x user guide, v1.1, section 9 (p447) for more info */
  -
  -#define S3C2410_IICREG(x) (x)
  -
  -#define S3C2410_IICCONS3C2410_IICREG(0x00)
  -#define S3C2410_IICSTAT   S3C2410_IICREG(0x04)
  -#define S3C2410_IICADDS3C2410_IICREG(0x08)
  -#define S3C2410_IICDS S3C2410_IICREG(0x0C)
  -#define S3C2440_IICLCS3C2410_IICREG(0x10)
  -
  -#define S3C2410_IICCON_ACKEN   (17)
  -#define S3C2410_IICCON_TXDIV_16(06)
  -#define S3C2410_IICCON_TXDIV_512   (16)
  -#define S3C2410_IICCON_IRQEN   (15)
  -#define S3C2410_IICCON_IRQPEND (14)
  -#define S3C2410_IICCON_SCALE(x)((x)15)
  -#define S3C2410_IICCON_SCALEMASK   (0xf)
  -
  -#define S3C2410_IICSTAT_MASTER_RX  (26)
  -#define S3C2410_IICSTAT_MASTER_TX  (36)
  -#define S3C2410_IICSTAT_SLAVE_RX   (06)
  -#define S3C2410_IICSTAT_SLAVE_TX   (16)
  -#define S3C2410_IICSTAT_MODEMASK   (36)
  -
  -#define S3C2410_IICSTAT_START  (15)
  -#define S3C2410_IICSTAT_BUSBUSY(15)
  -#define S3C2410_IICSTAT_TXRXEN (14)
  -#define S3C2410_IICSTAT_ARBITR (13)
  -#define S3C2410_IICSTAT_ASSLAVE(12)
  -#define S3C2410_IICSTAT_ADDR0  (11)
  -#define S3C2410_IICSTAT_LASTBIT(10)
  -
  -#define S3C2410_IICLC_SDA_DELAY0   (0  0)
  -#define S3C2410_IICLC_SDA_DELAY5   (1  0)
  -#define S3C2410_IICLC_SDA_DELAY10  (2  0)
  -#define S3C2410_IICLC_SDA_DELAY15  (3  0)
  -#define S3C2410_IICLC_SDA_DELAY_MASK   (3  0)
  -
  -#define S3C2410_IICLC_FILTER_ON(12)
  -
  -#endif /* __ASM_ARCH_REGS_IIC_H */
  diff --git a/drivers/i2c/busses/i2c-s3c2410.c
  b/drivers/i2c/busses/i2c- s3c2410.c index a290d08..5cc4f71 100644
  --- a/drivers/i2c/busses/i2c-s3c2410.c
  +++ b/drivers/i2c/busses/i2c-s3c2410.c
  @@ -42,9 +42,48 @@
 
   #include asm/irq.h
 
  -#include plat/regs-iic.h
   #include linux/platform_data/i2c-s3c2410.h
 
  +/* see s3c2410x user guide, v1.1, section 9 (p447) for more info */
  +
  +#define S3C2410_IICREG(x) (x)
  +
  +#define S3C2410_IICCONS3C2410_IICREG(0x00)
  +#define S3C2410_IICSTAT   S3C2410_IICREG(0x04)
  +#define S3C2410_IICADDS3C2410_IICREG(0x08)
  +#define S3C2410_IICDS S3C2410_IICREG(0x0C)
  +#define S3C2440_IICLCS3C2410_IICREG(0x10)
  +
  +#define S3C2410_IICCON_ACKEN   (17)
  +#define S3C2410_IICCON_TXDIV_16(06)
  +#define S3C2410_IICCON_TXDIV_512   (16)
  +#define S3C2410_IICCON_IRQEN   (15)
  +#define S3C2410_IICCON_IRQPEND (14)
  +#define S3C2410_IICCON_SCALE(x)((x)15)
  +#define S3C2410_IICCON_SCALEMASK   (0xf)
  +
  +#define S3C2410_IICSTAT_MASTER_RX  (26)
  +#define

[PATCH v2 re-send] i2c: s3c2410: Add quirk to exclude GPIO config for exynos5440

2013-01-24 Thread Kukjin Kim
From: Giridhar Maruthy giridha...@samsung.com

Signed-off-by: Giridhar Maruthy giridha...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
Resending due to line wrapped from e-mail client.

 Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt |2 ++
 drivers/i2c/busses/i2c-s3c2410.c  |2 ++
 2 files changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt 
b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
index e9611ac..b92bc14 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
@@ -8,6 +8,8 @@ Required properties:
   (b) samsung, s3c2440-i2c, for i2c compatible with s3c2440 i2c.
   (c) samsung, s3c2440-hdmiphy-i2c, for s3c2440-like i2c used
   inside HDMIPHY block found on several samsung SoCs
+  (d) samsung, exynos5440-i2c, for s3c2440-like i2c used
+  on EXYNOS5440 which does not need GPIO configuration.
   - reg: physical base address of the controller and length of memory mapped
 region.
   - interrupts: interrupt number to the cpu.
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index a290d08..17c5c37 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -111,6 +111,8 @@ static const struct of_device_id s3c24xx_i2c_match[] = {
{ .compatible = samsung,s3c2440-i2c, .data = (void *)QUIRK_S3C2440 },
{ .compatible = samsung,s3c2440-hdmiphy-i2c,
  .data = (void *)(QUIRK_S3C2440 | QUIRK_HDMIPHY | QUIRK_NO_GPIO) },
+   { .compatible = samsung,exynos5440-i2c,
+ .data = (void *)(QUIRK_S3C2440 | QUIRK_NO_GPIO) },
{},
 };
 MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match);
-- 
1.7.10.4

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


RE: PATCH v2] i2c: s3c2410: Add quirk to exclude GPIO config for exynos5440

2013-01-24 Thread Kukjin Kim
Wolfram Sang wrote:
 
 On Tue, Jan 22, 2013 at 06:47:39PM -0800, Kukjin Kim wrote:
  From: Giridhar Maruthy giridha...@samsung.com
 
  Signed-off-by: Giridhar Maruthy giridha...@samsung.com
  Signed-off-by: Kukjin Kim kgene@samsung.com
 
 Looks OK but is line wrapped, can't apply.
 
Oh, OK. Re-sent it just now. Please take it.

Thanks.

- Kukjin

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


PATCH v2] i2c: s3c2410: Add quirk to exclude GPIO config for exynos5440

2013-01-22 Thread Kukjin Kim
From: Giridhar Maruthy giridha...@samsung.com

Signed-off-by: Giridhar Maruthy giridha...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
Changes since v1:
- added documentation of device tree bindings for i2c-s3c2410,
  as per Tomasz's suggestion
- changed ordering for of_device_id according to binding ordering
  of the documentation

 Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt |2 ++
 drivers/i2c/busses/i2c-s3c2410.c  |2 ++
 2 files changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
index e9611ac..b92bc14 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
@@ -8,6 +8,8 @@ Required properties:
   (b) samsung, s3c2440-i2c, for i2c compatible with s3c2440 i2c.
   (c) samsung, s3c2440-hdmiphy-i2c, for s3c2440-like i2c used
   inside HDMIPHY block found on several samsung SoCs
+  (d) samsung, exynos5440-i2c, for s3c2440-like i2c used
+  on EXYNOS5440 which does not need GPIO configuration.
   - reg: physical base address of the controller and length of memory
mapped
 region.
   - interrupts: interrupt number to the cpu.
diff --git a/drivers/i2c/busses/i2c-s3c2410.c
b/drivers/i2c/busses/i2c-s3c2410.c
index a290d08..17c5c37 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -111,6 +111,8 @@ static const struct of_device_id s3c24xx_i2c_match[] = {
{ .compatible = samsung,s3c2440-i2c, .data = (void *)QUIRK_S3C2440
},
{ .compatible = samsung,s3c2440-hdmiphy-i2c,
  .data = (void *)(QUIRK_S3C2440 | QUIRK_HDMIPHY | QUIRK_NO_GPIO) },
+   { .compatible = samsung,exynos5440-i2c,
+ .data = (void *)(QUIRK_S3C2440 | QUIRK_NO_GPIO) },
{},
 };
 MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match);
-- 
1.7.10.4

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


RE: [PATCH] i2c: s3c2410: Add quirk to exclude GPIO config for exynos5440

2013-01-20 Thread Kukjin Kim
Tomasz Figa wrote:
 
 Hi Kukjin,
 
Hi,

 You should also add the new compatible value to the documentation of
 device tree bindings for i2c-s3c2410.
 
Yeah, agreed.

 (Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt)
 
Giridhar, please address comments from Tomasz.

Thanks.

- Kukjin

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


[PATCH] i2c: s3c2410: Add quirk to exclude GPIO config for exynos5440

2013-01-18 Thread Kukjin Kim
From: Giridhar Maruthy giridha...@samsung.com

Signed-off-by: Giridhar Maruthy giridha...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 drivers/i2c/busses/i2c-s3c2410.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index a290d08..ec141b4 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -109,6 +109,8 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids);
 static const struct of_device_id s3c24xx_i2c_match[] = {
{ .compatible = samsung,s3c2410-i2c, .data = (void *)0 },
{ .compatible = samsung,s3c2440-i2c, .data = (void *)QUIRK_S3C2440 },
+   { .compatible = samsung,exynos5440-i2c,
+ .data = (void *)(QUIRK_S3C2440 | QUIRK_NO_GPIO) },
{ .compatible = samsung,s3c2440-hdmiphy-i2c,
  .data = (void *)(QUIRK_S3C2440 | QUIRK_HDMIPHY | QUIRK_NO_GPIO) },
{},
-- 
1.7.10.4

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


RE: [PATCH v2 1/6] ARM: EXYNOS5: Clock settings for SATA and SATA PHY

2012-11-23 Thread Kukjin Kim
Vasanth Ananthan wrote:
 
 Hi,
 
 Missed to include Ben, for I2C patch, including him and copying others.
 
Vasanth, you didn't my reply? I already applied this 1st and 2nd patches.

Thanks.

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

 
 On Tue, Oct 30, 2012 at 9:31 PM, Vasanth Ananthan
 vasanthanant...@gmail.com wrote:
  This patch adds neccessary clock entries for SATA, SATA PHY and
  I2C_SATAPHY
 
  Signed-off-by: Vasanth Ananthan vasant...@samsung.com
  ---
   arch/arm/mach-exynos/clock-exynos5.c |   21 ++---
   1 files changed, 18 insertions(+), 3 deletions(-)
 
  diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-
 exynos/clock-exynos5.c
  index c44ca1e..124c54f 100644
  --- a/arch/arm/mach-exynos/clock-exynos5.c
  +++ b/arch/arm/mach-exynos/clock-exynos5.c
  @@ -651,15 +651,20 @@ static struct clk exynos5_init_clocks_off[] = {
  .ctrlbit= (1  15),
  }, {
  .name   = sata,
  -   .devname= ahci,
  +   .devname= exynos5-sata,
  +   .parent = exynos5_clk_aclk_200.clk,
  .enable = exynos5_clk_ip_fsys_ctrl,
  .ctrlbit= (1  6),
  }, {
  -   .name   = sata_phy,
  +   .name   = sata-phy,
  +   .devname= exynos5-sata-phy,
  +   .parent = exynos5_clk_aclk_200.clk,
  .enable = exynos5_clk_ip_fsys_ctrl,
  .ctrlbit= (1  24),
  }, {
  -   .name   = sata_phy_i2c,
  +   .name   = i2c,
  +   .devname= exynos5-sata-phy-i2c,
  +   .parent = exynos5_clk_aclk_200.clk,
  .enable = exynos5_clk_ip_fsys_ctrl,
  .ctrlbit= (1  25),
  }, {
  @@ -1226,6 +1231,16 @@ static struct clksrc_clk exynos5_clksrcs[] = {
  .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 24,
.size
 = 3 },
  }, {
  .clk= {
  +   .name   = sclk_sata,
  +   .devname= exynos5-sata,
  +   .enable = exynos5_clksrc_mask_fsys_ctrl,
  +   .ctrlbit= (1  24),
  +   },
  +   .sources = exynos5_clkset_aclk,
  +   .reg_src = { .reg = EXYNOS5_CLKSRC_FSYS, .shift = 24,
.size
 = 1 },
  +   .reg_div = { .reg = EXYNOS5_CLKDIV_FSYS0, .shift =
 20, .size = 4 },
  +   }, {
  +   .clk= {
  .name   = sclk_gscl_wrap,
  .devname= s5p-mipi-csis.0,
  .enable = exynos5_clksrc_mask_gscl_ctrl,
  --
  1.7.4.1
 
 
 
 
 --

--
To unsubscribe from this list: send the line unsubscribe linux-i2c 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] i2c: s3c2410: Get the i2c bus number from alias id

2012-11-22 Thread Kukjin Kim
Doug Anderson wrote:
 
 On Tue, Nov 20, 2012 at 8:09 PM, Mark Brown
 broo...@opensource.wolfsonmicro.com wrote:
  On Tue, Nov 20, 2012 at 02:27:04PM -0800, Doug Anderson wrote:
  From: Padmavathi Venna padm...@samsung.com
 
  Get the i2c bus number that the device is connected to using the alias
  id.  This makes debugging / grokking of kernel messages much easier.
 
  This doesn't look like a s3c2410 specific change - it's a generic device
  tree issue.  This suggests that it sohuld be implemented in the
  framework so that all I2C controllers with DT can use it.
 
 Good suggestion.  I have posted a series with the title Add automatic
 bus number support for i2c busses with device tree.  It contains the
 i2c-core patch as well as a patch removing similar code from the pxa
 i2c driver.
 
 Kukjin: please consider this patch abandoned and superseded by the new
 i2c-core patch.  As Olof said, the patch for adding aliases for
 exynos4 should still be fine to apply.
 
OK, I see.

Thanks.

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

--
To unsubscribe from this list: send the line unsubscribe linux-i2c 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] i2c: s3c2410: Get the i2c bus number from alias id

2012-11-21 Thread Kukjin Kim
Doug Anderson wrote:
 
 From: Padmavathi Venna padm...@samsung.com
 
 Get the i2c bus number that the device is connected to using the alias
 id.  This makes debugging / grokking of kernel messages much easier.
 
 [dianders: slight patch cleanup from Padmavathi's original.]
 
 Signed-off-by: Padmavathi Venna padm...@samsung.com
 Signed-off-by: Doug Anderson diand...@chromium.org

Acked-by: Kukjin Kim kgene@samsung.com

Thanks.

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

 ---
  drivers/i2c/busses/i2c-s3c2410.c |   10 +-
  1 files changed, 9 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-
 s3c2410.c
 index 3e0335f..ca43590 100644
 --- a/drivers/i2c/busses/i2c-s3c2410.c
 +++ b/drivers/i2c/busses/i2c-s3c2410.c
 @@ -899,11 +899,19 @@ static void
  s3c24xx_i2c_parse_dt(struct device_node *np, struct s3c24xx_i2c *i2c)
  {
   struct s3c2410_platform_i2c *pdata = i2c-pdata;
 + int id;
 
   if (!np)
   return;
 
 - pdata-bus_num = -1; /* i2c bus number is dynamically assigned */
 + id = of_alias_get_id(np, i2c);
 + if (id  0) {
 + dev_warn(i2c-dev, failed to get alias id:%d\n, id);
 + pdata-bus_num = -1;
 + } else {
 + /* i2c bus number is statically assigned from alias */
 + pdata-bus_num = id;
 + }
   of_property_read_u32(np, samsung,i2c-sda-delay, pdata-
 sda_delay);
   of_property_read_u32(np, samsung,i2c-slave-addr, pdata-
 slave_addr);
   of_property_read_u32(np, samsung,i2c-max-bus-freq,
 --
 1.7.7.3

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


RE: [PATCH] ARM: exynos: dt: add all i2c busses to auxdata

2012-11-21 Thread Kukjin Kim
Doug Anderson wrote:
 
 From: Olof Johansson o...@lixom.net
 
 Needed to match device ids for clocks, etc.
 
 Signed-off-by: Olof Johansson o...@lixom.net
 Signed-off-by: Doug Anderson diand...@chromium.org
 
 ---
  arch/arm/mach-exynos/mach-exynos5-dt.c |   10 ++
  1 files changed, 10 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-
 exynos/mach-exynos5-dt.c
 index ed37273..e1491f7 100644
 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c
 +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
 @@ -52,6 +52,16 @@ static const struct of_dev_auxdata
 exynos5250_auxdata_lookup[] __initconst = {
   s3c2440-i2c.1, NULL),
   OF_DEV_AUXDATA(samsung,s3c2440-i2c, EXYNOS5_PA_IIC(2),
   s3c2440-i2c.2, NULL),
 + OF_DEV_AUXDATA(samsung,s3c2440-i2c, EXYNOS5_PA_IIC(3),
 + s3c2440-i2c.3, NULL),
 + OF_DEV_AUXDATA(samsung,s3c2440-i2c, EXYNOS5_PA_IIC(4),
 + s3c2440-i2c.4, NULL),
 + OF_DEV_AUXDATA(samsung,s3c2440-i2c, EXYNOS5_PA_IIC(5),
 + s3c2440-i2c.5, NULL),
 + OF_DEV_AUXDATA(samsung,s3c2440-i2c, EXYNOS5_PA_IIC(6),
 + s3c2440-i2c.6, NULL),
 + OF_DEV_AUXDATA(samsung,s3c2440-i2c, EXYNOS5_PA_IIC(7),
 + s3c2440-i2c.7, NULL),
   OF_DEV_AUXDATA(samsung,s3c2440-hdmiphy-i2c, EXYNOS5_PA_IIC(8),
   s3c2440-hdmiphy-i2c, NULL),
   OF_DEV_AUXDATA(samsung,exynos5250-dw-mshc, EXYNOS5_PA_DWMCI0,
 --
 1.7.7.3

Looks ok to me, applied.

Thanks.

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

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


RE: [PATCH 1/2] ARM: EXYNOS: Add aliases for i2c controller for exynos4

2012-11-21 Thread Kukjin Kim
Doug Anderson wrote:
 
 This is similar to a recent commit for exynos5250 titled:
   ARM: EXYNOS: Add aliases for i2c controller
 
 Adding aliases will be useful to prevent warnings in a future
 change.  See:
   i2c: s3c2410: Get the i2c bus number from alias id
 
 Signed-off-by: Doug Anderson diand...@chromium.org
 
 ---
  arch/arm/boot/dts/exynos4.dtsi |   24 
  1 files changed, 16 insertions(+), 8 deletions(-)
 
 diff --git a/arch/arm/boot/dts/exynos4.dtsi
 b/arch/arm/boot/dts/exynos4.dtsi
 index a26c3dd..824d362 100644
 --- a/arch/arm/boot/dts/exynos4.dtsi
 +++ b/arch/arm/boot/dts/exynos4.dtsi
 @@ -28,6 +28,14 @@
   spi0 = spi_0;
   spi1 = spi_1;
   spi2 = spi_2;
 + i2c0 = i2c_0;
 + i2c1 = i2c_1;
 + i2c2 = i2c_2;
 + i2c3 = i2c_3;
 + i2c4 = i2c_4;
 + i2c5 = i2c_5;
 + i2c6 = i2c_6;
 + i2c7 = i2c_7;
   };
 
   gic:interrupt-controller@1049 {
 @@ -121,7 +129,7 @@
   status = disabled;
   };
 
 - i2c@1386 {
 + i2c_0: i2c@1386 {
   #address-cells = 1;
   #size-cells = 0;
   compatible = samsung,s3c2440-i2c;
 @@ -130,7 +138,7 @@
   status = disabled;
   };
 
 - i2c@1387 {
 + i2c_1: i2c@1387 {
   #address-cells = 1;
   #size-cells = 0;
   compatible = samsung,s3c2440-i2c;
 @@ -139,7 +147,7 @@
   status = disabled;
   };
 
 - i2c@1388 {
 + i2c_2: i2c@1388 {
   #address-cells = 1;
   #size-cells = 0;
   compatible = samsung,s3c2440-i2c;
 @@ -148,7 +156,7 @@
   status = disabled;
   };
 
 - i2c@1389 {
 + i2c_3: i2c@1389 {
   #address-cells = 1;
   #size-cells = 0;
   compatible = samsung,s3c2440-i2c;
 @@ -157,7 +165,7 @@
   status = disabled;
   };
 
 - i2c@138A {
 + i2c_4: i2c@138A {
   #address-cells = 1;
   #size-cells = 0;
   compatible = samsung,s3c2440-i2c;
 @@ -166,7 +174,7 @@
   status = disabled;
   };
 
 - i2c@138B {
 + i2c_5: i2c@138B {
   #address-cells = 1;
   #size-cells = 0;
   compatible = samsung,s3c2440-i2c;
 @@ -175,7 +183,7 @@
   status = disabled;
   };
 
 - i2c@138C {
 + i2c_6: i2c@138C {
   #address-cells = 1;
   #size-cells = 0;
   compatible = samsung,s3c2440-i2c;
 @@ -184,7 +192,7 @@
   status = disabled;
   };
 
 - i2c@138D {
 + i2c_7: i2c@138D {
   #address-cells = 1;
   #size-cells = 0;
   compatible = samsung,s3c2440-i2c;
 --
 1.7.7.3

Applied, thanks.

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

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


RE: [PATCH RESEND] drivers: i2c: s3c2410: add support for HDMIPHY dedicated controller

2011-10-11 Thread Kukjin Kim
Marek Szyprowski wrote:
 
 From: Tomasz Stanislawski t.stanisl...@samsung.com
 
 This patch adds support for I2C HDMIPHY dedicated controller. It has
 different timeout handling and reset conditions.
 
 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

Acked-by: Kukjin Kim kgene@samsung.com

Hi Ben,

If you're ok with this, please apply this to go to upstream via your i2c
tree.

Thanks.

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

 ---
  drivers/i2c/busses/i2c-s3c2410.c |   36
 +++-
  1 files changed, 35 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-s3c2410.c
b/drivers/i2c/busses/i2c-s3c2410.c
 index f84a63c..e456cf9 100644
 --- a/drivers/i2c/busses/i2c-s3c2410.c
 +++ b/drivers/i2c/busses/i2c-s3c2410.c
 @@ -54,6 +54,7 @@ enum s3c24xx_i2c_state {
  enum s3c24xx_i2c_type {
   TYPE_S3C2410,
   TYPE_S3C2440,
 + TYPE_S3C2440_HDMIPHY,
  };
 
  struct s3c24xx_i2c {
 @@ -96,7 +97,21 @@ static inline int s3c24xx_i2c_is2440(struct s3c24xx_i2c
*i2c)
   enum s3c24xx_i2c_type type;
 
   type = platform_get_device_id(pdev)-driver_data;
 - return type == TYPE_S3C2440;
 + return type == TYPE_S3C2440 || type == TYPE_S3C2440_HDMIPHY;
 +}
 +
 +/* s3c24xx_i2c_is2440_hdmiphy()
 + *
 + * return true is this is an s3c2440 dedicated for HDMIPHY interface
 +*/
 +
 +static inline int s3c24xx_i2c_is2440_hdmiphy(struct s3c24xx_i2c *i2c)
 +{
 + struct platform_device *pdev = to_platform_device(i2c-dev);
 + enum s3c24xx_i2c_type type;
 +
 + type = platform_get_device_id(pdev)-driver_data;
 + return type == TYPE_S3C2440_HDMIPHY;
  }
 
  /* s3c24xx_i2c_master_complete
 @@ -460,6 +475,13 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c
*i2c)
   unsigned long iicstat;
   int timeout = 400;
 
 + /* if hang-up of HDMIPHY occured reduce timeout
 +  * The controller will work after reset, so waiting
 +  * 400 ms will cause unneccessary system hangup
 +  */
 + if (s3c24xx_i2c_is2440_hdmiphy(i2c))
 + timeout = 10;
 +
   while (timeout--  0) {
   iicstat = readl(i2c-regs + S3C2410_IICSTAT);
 
 @@ -469,6 +491,15 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c
*i2c)
   msleep(1);
   }
 
 + /* hang-up of bus dedicated for HDMIPHY occured, resetting */
 + if (s3c24xx_i2c_is2440_hdmiphy(i2c)) {
 + writel(0, i2c-regs + S3C2410_IICCON);
 + writel(0, i2c-regs + S3C2410_IICSTAT);
 + writel(0, i2c-regs + S3C2410_IICDS);
 +
 + return 0;
 + }
 +
   return -ETIMEDOUT;
  }
 
 @@ -1008,6 +1039,9 @@ static struct platform_device_id
s3c24xx_driver_ids[] = {
   }, {
   .name   = s3c2440-i2c,
   .driver_data= TYPE_S3C2440,
 + }, {
 + .name   = s3c2440-hdmiphy-i2c,
 + .driver_data= TYPE_S3C2440_HDMIPHY,
   }, { },
  };
  MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids);
 --
 1.7.1.569.g6f426

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


[PATCH] i2c-s3c2410: Fix typo 'i2s' - 'i2c'

2011-06-23 Thread Kukjin Kim
From: Huisung Kang hs1218.k...@samsung.com

Signed-off-by: Huisung Kang hs1218.k...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 drivers/i2c/busses/i2c-s3c2410.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 553b9cc..f84a63c 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -248,12 +248,12 @@ static inline int is_msgend(struct s3c24xx_i2c *i2c)
return i2c-msg_ptr = i2c-msg-len;
 }
 
-/* i2s_s3c_irq_nextbyte
+/* i2c_s3c_irq_nextbyte
  *
  * process an interrupt and work out what to do
  */
 
-static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
+static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
 {
unsigned long tmp;
unsigned char byte;
@@ -443,7 +443,7 @@ static irqreturn_t s3c24xx_i2c_irq(int irqno, void *dev_id)
/* pretty much this leaves us with the fact that we've
 * transmitted or received whatever byte we last sent */
 
-   i2s_s3c_irq_nextbyte(i2c, status);
+   i2c_s3c_irq_nextbyte(i2c, status);
 
  out:
return IRQ_HANDLED;
-- 
1.7.1

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


[PATCH] i2c-s3c2410: Remove useless break code

2011-06-23 Thread Kukjin Kim
From: Jonghwan Choi jhbird.c...@samsung.com

Signed-off-by: Jonghwan Choi jhbird.c...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 drivers/i2c/busses/i2c-s3c2410.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 6c00c10..553b9cc 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -264,7 +264,6 @@ static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, 
unsigned long iicstat)
case STATE_IDLE:
dev_err(i2c-dev, %s: called in STATE_IDLE\n, __func__);
goto out;
-   break;
 
case STATE_STOP:
dev_err(i2c-dev, %s: called in STATE_STOP\n, __func__);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-i2c 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 3/3] ARM: SAMSUNG: i2c/busses: Add HAVE_S3C2410_I2C option to include I2C for Samsung SoCs

2010-07-29 Thread Kukjin Kim
Kyungmin Park wrote:
 
 On Thu, Jul 29, 2010 at 6:42 PM, Kukjin Kim kgene@samsung.com wrote:
  From: Naveen Krishna Ch ch.nav...@samsung.com
 
  This patch adds HAVE_S3C2410_I2C to control inclusion of I2C bus driver
  on Samsung SoCs and makes I2C bus driver dependency SoC specific instead
  of machine specific. This will enalbe all machines using Samsung
 ARCH_S3C2410,
  _S3C64XX, _S5P6440, _S5PC100, and _S5PV210 to select the I2C driver by
 default
 
 What's the different from use PLAT_SAMSUNG?
 
Hi,

Hmm..the difference?

I remember, already said to you...
Anyway actually, there was a stuff in here about that.
Please refer to following...it may answer on your question.

--- From Ben Dooks

  config RTC_DRV_S3C
   tristate Samsung S3C series SoC RTC
 - depends on ARCH_S3C2410
 + depends on ARCH_S3C2410 || ARCH_S3C64XX

I wonder whether just making this depend on either S3C_DEV_RTC, or simply
PLAT_SAMSUNG would just be a better choice.

The S3C_DEV_RTC would mean that the drivers the core of the kernel
would be built, but means that we can't speculatively build drivers
if the kernel hasn't any machines using them.

Making it depend on PLAT_SAMSUNG would mean it is available to all,
but would be selectable even if there isn't a machine supporting it
being built.

The current situation would mean that we have to update driver Kconfig
entries each time a new SoC turns up...

We could also have a HAVE_RTC_DRV_S3C so that all SoCs supporting this
coudl select it independant of whether there is machine support.

---

It doesn't mean that we should use HAVE_XXX in this case...
But this way is better _now_ and they used same method in several drivers.
And if driver IP changes, we can use with HAVE_XXXV2...

 config I2C_S3C2410
 tristate S3C2410 I2C Driver
 depends on PLAT_SAMSUNG
 
 Please don't populate the Kconfigs.
 

I hope you stop talking same issue without alternative...

 Thank you,
 Kyungmin Park
 
 
  Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
  Signed-off-by: Kukjin Kim kgene@samsung.com
  Cc: Ben Dooks ben-li...@fluff.org
  ---
  Changes since v2:
  - Added HAVE_S3C2410_I2C in drivers Kconfig
  - Made I2C bus driver dependency SoC specific
  - Selected additional support I2C bus driver for S5P6440, S5PC100,
   and S5PV210
 
  Changes since v1:
  - Modifed the Kconfig help comments.
 
   arch/arm/Kconfig   |5 +
   drivers/i2c/busses/Kconfig |   11 +--
   2 files changed, 14 insertions(+), 2 deletions(-)
 
  diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
  index 98922f7..e922994 100644
  --- a/arch/arm/Kconfig
  +++ b/arch/arm/Kconfig
  @@ -634,6 +634,7 @@ config ARCH_S3C2410
 select ARCH_HAS_CPUFREQ
 select HAVE_CLK
 select ARCH_USES_GETTIMEOFFSET
  +   select HAVE_S3C2410_I2C
 help
   Samsung S3C2410X CPU based systems, such as the Simtec
 Electronics
   BAST (http://www.simtec.co.uk/products/EB110ITX/), the IPAQ 1940
 or
  @@ -663,6 +664,7 @@ config ARCH_S3C64XX
 select S3C_DEV_NAND
 select USB_ARCH_HAS_OHCI
 select SAMSUNG_GPIOLIB_4BIT
  +   select HAVE_S3C2410_I2C
 help
   Samsung S3C64XX series based systems
 
  @@ -672,6 +674,7 @@ config ARCH_S5P6440
 select GENERIC_GPIO
 select HAVE_CLK
 select ARCH_USES_GETTIMEOFFSET
  +   select HAVE_S3C2410_I2C
 help
   Samsung S5P6440 CPU based systems
 
  @@ -691,6 +694,7 @@ config ARCH_S5PC100
 select CPU_V7
 select ARM_L1_CACHE_SHIFT_6
 select ARCH_USES_GETTIMEOFFSET
  +   select HAVE_S3C2410_I2C
 help
   Samsung S5PC100 series based systems
 
  @@ -701,6 +705,7 @@ config ARCH_S5PV210
 select HAVE_CLK
 select ARM_L1_CACHE_SHIFT_6
 select ARCH_USES_GETTIMEOFFSET
  +   select HAVE_S3C2410_I2C
 help
   Samsung S5PV210/S5PC110 series based systems
 
  diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
  index bceafbf..f1751da 100644
  --- a/drivers/i2c/busses/Kconfig
  +++ b/drivers/i2c/busses/Kconfig
  @@ -521,12 +521,19 @@ config I2C_PXA_SLAVE
   is necessary for systems where the PXA may be a target on the
   I2C bus.
 
  +config HAVE_S3C2410_I2C
  +   bool
  +   help
  + This will include I2C support for Samsung SoCs. If you want to
  + include I2C support for any machine, kindly select this in the
  + respective Kconfig file.
  +
   config I2C_S3C2410
 tristate S3C2410 I2C Driver
  -   depends on ARCH_S3C2410 || ARCH_S3C64XX
  +   depends on HAVE_S3C2410_I2C
 help
   Say Y here to include support for I2C controller in the
  - Samsung S3C2410 based System-on-Chip devices.
  + Samsung SoCs.
 
   config I2C_S6000
 tristate S6000 I2C support
  --


Thanks.

Best regards,
Kgene.
--
Kukjin Kim kgene@samsung.com, Senior Engineer,
SW

RE: [PATCH v3 3/3] ARM: SAMSUNG: i2c/busses: Add HAVE_S3C2410_I2C option to include I2C for Samsung SoCs

2010-07-29 Thread Kukjin Kim

 -Original Message-
 From: kyungmi...@gmail.com [mailto:kyungmi...@gmail.com] On Behalf Of
 Kyungmin Park
 Sent: Friday, July 30, 2010 11:43 AM
 To: Kukjin Kim
 Cc: linux-arm-ker...@lists.infradead.org;
linux-samsung-...@vger.kernel.org;
 linux-i2c@vger.kernel.org; ben-li...@fluff.org; Naveen Krishna Ch
 Subject: Re: [PATCH v3 3/3] ARM: SAMSUNG: i2c/busses: Add
 HAVE_S3C2410_I2C option to include I2C for Samsung SoCs
 
 On Fri, Jul 30, 2010 at 10:03 AM, Kukjin Kim kgene@samsung.com
wrote:
  Kyungmin Park wrote:
 
  On Thu, Jul 29, 2010 at 6:42 PM, Kukjin Kim kgene@samsung.com
wrote:
   From: Naveen Krishna Ch ch.nav...@samsung.com
  
   This patch adds HAVE_S3C2410_I2C to control inclusion of I2C bus
driver
   on Samsung SoCs and makes I2C bus driver dependency SoC specific
 instead
   of machine specific. This will enalbe all machines using Samsung
  ARCH_S3C2410,
   _S3C64XX, _S5P6440, _S5PC100, and _S5PV210 to select the I2C driver
by
  default
 
  What's the different from use PLAT_SAMSUNG?
 
  Hi,
 
  Hmm..the difference?
 
  I remember, already said to you...
  Anyway actually, there was a stuff in here about that.
  Please refer to following...it may answer on your question.
 
  --- From Ben Dooks
 
   config RTC_DRV_S3C
        tristate Samsung S3C series SoC RTC
  -     depends on ARCH_S3C2410
  +     depends on ARCH_S3C2410 || ARCH_S3C64XX
 
  I wonder whether just making this depend on either S3C_DEV_RTC, or
simply
  PLAT_SAMSUNG would just be a better choice.
 
  The S3C_DEV_RTC would mean that the drivers the core of the kernel
  would be built, but means that we can't speculatively build drivers
  if the kernel hasn't any machines using them.
 
  Making it depend on PLAT_SAMSUNG would mean it is available to all,
  but would be selectable even if there isn't a machine supporting it
  being built.
 
  The current situation would mean that we have to update driver Kconfig
  entries each time a new SoC turns up...
 
 In other word, It can make it workable when new SoCs arrives, even
 though depends on PLAT_SAMSUNG.
 
 If new chip has improved i2C IP then define new I2C drivers and modify
 it as 'depends on PLAT_SAMUSNG if !NEW_IP_I2C'
 and use another i2c drivers. of course it's depends on PLAT_SAMSUNG or
 PLAT_S5P if NEW_IP_I2C.
 
Hmm...if there is new IP driver for Samsung SoCs, why should I add extra
option for new one like your suggestion?
As I said, just 'depends on HAVE_SAMSUNGNEWIPV2_I2C' is enough for it...

I'm still thinking, this way is better to me...anything else?

 
  We could also have a HAVE_RTC_DRV_S3C so that all SoCs supporting this
  coudl select it independant of whether there is machine support.
 
  ---
 
  It doesn't mean that we should use HAVE_XXX in this case...
  But this way is better _now_ and they used same method in several
drivers.
  And if driver IP changes, we can use with HAVE_XXXV2...
 
  config I2C_S3C2410
          tristate S3C2410 I2C Driver
          depends on PLAT_SAMSUNG
 
  Please don't populate the Kconfigs.
 
 
  I hope you stop talking same issue without alternative...
 
  Thank you,
  Kyungmin Park
 
  
   Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
   Signed-off-by: Kukjin Kim kgene@samsung.com
   Cc: Ben Dooks ben-li...@fluff.org
   ---

(snip)

Thanks.

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

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


[PATCH v2 2/3] ARM: S5PV210: Add support for I2C devices on SMDKV210 and SMDKC110

2010-07-21 Thread Kukjin Kim
From: Naveen Krishna Ch ch.nav...@samsung.com

This patch adds support I2C-0/1/2 devices to the SMDKV210/SMDKC110.

Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
Changes since v1:
- Fixed the wrong name as per Kyungmin Park's comments

 arch/arm/mach-s5pv210/Kconfig |8 
 arch/arm/mach-s5pv210/mach-smdkc110.c |   28 
 arch/arm/mach-s5pv210/mach-smdkv210.c |   29 +
 3 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 0761eac..2a996d9 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -72,9 +72,13 @@ config MACH_SMDKV210
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
select SAMSUNG_DEV_ADC
+   select S3C_DEV_I2C1
+   select S3C_DEV_I2C2
select SAMSUNG_DEV_TS
select S3C_DEV_WDT
select HAVE_S3C2410_WATCHDOG
+   select S5PV210_SETUP_I2C1
+   select S5PV210_SETUP_I2C2
help
  Machine support for Samsung SMDKV210
 
@@ -82,8 +86,12 @@ config MACH_SMDKC110
bool SMDKC110
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
+   select S3C_DEV_I2C1
+   select S3C_DEV_I2C2
select S3C_DEV_WDT
select HAVE_S3C2410_WATCHDOG
+   select S5PV210_SETUP_I2C1
+   select S5PV210_SETUP_I2C2
help
  Machine support for Samsung SMDKC110
  S5PC110(MCP) is one of package option of S5PV210
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c 
b/arch/arm/mach-s5pv210/mach-smdkc110.c
index 4c8903c..fcd475f 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -12,6 +12,7 @@
 #include linux/types.h
 #include linux/init.h
 #include linux/serial_core.h
+#include linux/i2c.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -25,6 +26,7 @@
 #include plat/s5pv210.h
 #include plat/devs.h
 #include plat/cpu.h
+#include plat/iic.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
@@ -74,9 +76,24 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata 
= {
 static struct platform_device *smdkc110_devices[] __initdata = {
s5pv210_device_iis0,
s5pv210_device_ac97,
+   s3c_device_i2c0,
+   s3c_device_i2c1,
+   s3c_device_i2c2,
s3c_device_wdt,
 };
 
+static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = {
+   { I2C_BOARD_INFO(24c08, 0x50), }, /* Samsung S524AD0XD1 */
+};
+
+static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
+   /* To Be Updated */
+};
+
+static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
+   /* To Be Updated */
+};
+
 static void __init smdkc110_map_io(void)
 {
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -86,6 +103,17 @@ static void __init smdkc110_map_io(void)
 
 static void __init smdkc110_machine_init(void)
 {
+   /* I2C */
+   s3c_i2c0_set_platdata(NULL);
+   s3c_i2c1_set_platdata(NULL);
+   s3c_i2c2_set_platdata(NULL);
+   i2c_register_board_info(0, smdkc110_i2c_devs0,
+   ARRAY_SIZE(smdkc110_i2c_devs0));
+   i2c_register_board_info(1, smdkc110_i2c_devs1,
+   ARRAY_SIZE(smdkc110_i2c_devs1));
+   i2c_register_board_info(2, smdkc110_i2c_devs2,
+   ARRAY_SIZE(smdkc110_i2c_devs2));
+
platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
 }
 
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c 
b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 0d46279..765f47e 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -10,6 +10,7 @@
 
 #include linux/kernel.h
 #include linux/types.h
+#include linux/i2c.h
 #include linux/init.h
 #include linux/serial_core.h
 
@@ -27,6 +28,7 @@
 #include plat/cpu.h
 #include plat/adc.h
 #include plat/ts.h
+#include plat/iic.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
@@ -77,10 +79,25 @@ static struct platform_device *smdkv210_devices[] 
__initdata = {
s5pv210_device_iis0,
s5pv210_device_ac97,
s3c_device_adc,
+   s3c_device_i2c0,
+   s3c_device_i2c1,
+   s3c_device_i2c2,
s3c_device_ts,
s3c_device_wdt,
 };
 
+static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = {
+   { I2C_BOARD_INFO(24c08, 0x50), }, /* Samsung S524AD0XD1 */
+};
+
+static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = {
+   /* To Be Updated */
+};
+
+static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = {
+   /* To Be Updated */
+};
+
 static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
.delay  = 1,
.presc

RE: [PATCH 2/3] ARM: S5PV210: Add support for I2C devices on SMDKV210 and SMDKC110

2010-07-18 Thread Kukjin Kim
Kyungmin Park wrote:
 
 On Fri, Jul 16, 2010 at 10:13 PM, Kukjin Kim kgene@samsung.com
wrote:
  From: Naveen Krishna Ch ch.nav...@samsung.com
 
  This patch adds support I2C-0/1/2 devices to the SMDKV210/SMDKC110.
 
  Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
  Signed-off-by: Kukjin Kim kgene@samsung.com
  ---
   arch/arm/mach-s5pv210/Kconfig         |    8 
   arch/arm/mach-s5pv210/mach-smdkc110.c |   28
 
   arch/arm/mach-s5pv210/mach-smdkv210.c |   29
 +
   3 files changed, 65 insertions(+), 0 deletions(-)
 

(snip)

 
  +static struct i2c_board_info smdkc100_i2c_devs0[] __initdata = {
  +       { I2C_BOARD_INFO(24c08, 0x50), },     /* Samsung S524AD0XD1 */
  +};
  +
 
 why smdkc100?
 
Oh,...thank you for pointing out..will fix it.

  +static struct i2c_board_info smdkc100_i2c_devs1[] __initdata = {
  +       /* To Be Updated */
  +};
  +
 Ditto
 
  +static struct i2c_board_info smdkc100_i2c_devs2[] __initdata = {
  +       /* To Be Updated */
  +};
 Ditto
 

(snip)

Thanks.

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

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


[PATCH 3/3] i2c/busses: Select I2C bus support for S5PV210 and S5P6440.

2010-07-16 Thread Kukjin Kim
From: Naveen Krishna Ch ch.nav...@samsung.com

This patch is to select support I2C channels 0, 1 and 2 for S5PV210 and S5P6440.

Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 drivers/i2c/busses/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index bceafbf..e553fe8 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -523,7 +523,7 @@ config I2C_PXA_SLAVE
 
 config I2C_S3C2410
tristate S3C2410 I2C Driver
-   depends on ARCH_S3C2410 || ARCH_S3C64XX
+   depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PV210 || ARCH_S5P6440
help
  Say Y here to include support for I2C controller in the
  Samsung S3C2410 based System-on-Chip devices.
-- 
1.6.2.5

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


[PATCH 1/3] ARM: S5P6440: Add support for I2C channel 0 and 1 on SMDK6440

2010-07-16 Thread Kukjin Kim
From: Naveen Krishna Ch ch.nav...@samsung.com

This patch adds helper functions for I2C channel 0 and 1, GPIO
configurations for I2C on S5P6440 and support I2C-0/1 devices
on SMDK6440.

Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 arch/arm/mach-s5p6440/Kconfig|7 +++
 arch/arm/mach-s5p6440/Makefile   |1 +
 arch/arm/mach-s5p6440/include/mach/map.h |2 ++
 arch/arm/mach-s5p6440/mach-smdk6440.c|   20 
 arch/arm/mach-s5p6440/setup-i2c0.c   |7 ++-
 arch/arm/mach-s5p6440/setup-i2c1.c   |   30 ++
 6 files changed, 66 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-s5p6440/setup-i2c1.c

diff --git a/arch/arm/mach-s5p6440/Kconfig b/arch/arm/mach-s5p6440/Kconfig
index f066fae..ba3927b 100644
--- a/arch/arm/mach-s5p6440/Kconfig
+++ b/arch/arm/mach-s5p6440/Kconfig
@@ -13,13 +13,20 @@ config CPU_S5P6440
help
  Enable S5P6440 CPU support
 
+config S5P6440_SETUP_I2C1
+   bool
+   help
+ Common setup code for i2c bus 1.
+
 config MACH_SMDK6440
bool SMDK6440
select CPU_S5P6440
select SAMSUNG_DEV_TS
select SAMSUNG_DEV_ADC
+   select S3C_DEV_I2C1
select S3C_DEV_WDT
select HAVE_S3C2410_WATCHDOG
+   select S5P6440_SETUP_I2C1
help
  Machine support for the Samsung SMDK6440
 
diff --git a/arch/arm/mach-s5p6440/Makefile b/arch/arm/mach-s5p6440/Makefile
index be3c53a..c3fe4d3 100644
--- a/arch/arm/mach-s5p6440/Makefile
+++ b/arch/arm/mach-s5p6440/Makefile
@@ -22,3 +22,4 @@ obj-$(CONFIG_MACH_SMDK6440)   += mach-smdk6440.o
 # device support
 obj-y  += dev-audio.o
 obj-$(CONFIG_S3C64XX_DEV_SPI)  += dev-spi.o
+obj-$(CONFIG_S5P6440_SETUP_I2C1)   += setup-i2c1.o
diff --git a/arch/arm/mach-s5p6440/include/mach/map.h 
b/arch/arm/mach-s5p6440/include/mach/map.h
index 44011b9..d6a3a29 100644
--- a/arch/arm/mach-s5p6440/include/mach/map.h
+++ b/arch/arm/mach-s5p6440/include/mach/map.h
@@ -53,6 +53,7 @@
 #define S5P_SZ_UARTSZ_256
 
 #define S5P6440_PA_IIC0(0xEC104000)
+#define S5P6440_PA_IIC1(0xEC20F000)
 
 #define S5P6440_PA_SPI00xEC40
 #define S5P6440_PA_SPI10xEC50
@@ -77,6 +78,7 @@
 /* compatibiltiy defines. */
 #define S3C_PA_UARTS5P6440_PA_UART
 #define S3C_PA_IIC S5P6440_PA_IIC0
+#define S3C_PA_IIC1S5P6440_PA_IIC1
 #define S3C_PA_WDT S5P6440_PA_WDT
 
 #define SAMSUNG_PA_ADC S5P6440_PA_ADC
diff --git a/arch/arm/mach-s5p6440/mach-smdk6440.c 
b/arch/arm/mach-s5p6440/mach-smdk6440.c
index 8291fec..623354e 100644
--- a/arch/arm/mach-s5p6440/mach-smdk6440.c
+++ b/arch/arm/mach-s5p6440/mach-smdk6440.c
@@ -15,6 +15,7 @@
 #include linux/timer.h
 #include linux/delay.h
 #include linux/init.h
+#include linux/i2c.h
 #include linux/serial_core.h
 #include linux/platform_device.h
 #include linux/io.h
@@ -37,6 +38,7 @@
 #include mach/regs-clock.h
 #include plat/devs.h
 #include plat/cpu.h
+#include plat/iic.h
 #include plat/pll.h
 #include plat/adc.h
 #include plat/ts.h
@@ -88,10 +90,20 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] 
__initdata = {
 static struct platform_device *smdk6440_devices[] __initdata = {
s5p6440_device_iis,
s3c_device_adc,
+   s3c_device_i2c0,
+   s3c_device_i2c1,
s3c_device_ts,
s3c_device_wdt,
 };
 
+static struct i2c_board_info smdk6440_i2c_devs0[] __initdata = {
+   { I2C_BOARD_INFO(24c08, 0x50), },
+};
+
+static struct i2c_board_info smdk6440_i2c_devs1[] __initdata = {
+   /* To be populated */
+};
+
 static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
.delay  = 1,
.presc  = 49,
@@ -109,6 +121,14 @@ static void __init smdk6440_machine_init(void)
 {
s3c24xx_ts_set_platdata(s3c_ts_platform);
 
+   /* I2C */
+   s3c_i2c0_set_platdata(NULL);
+   s3c_i2c1_set_platdata(NULL);
+   i2c_register_board_info(0, smdk6440_i2c_devs0,
+   ARRAY_SIZE(smdk6440_i2c_devs0));
+   i2c_register_board_info(1, smdk6440_i2c_devs1,
+   ARRAY_SIZE(smdk6440_i2c_devs1));
+
platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
 }
 
diff --git a/arch/arm/mach-s5p6440/setup-i2c0.c 
b/arch/arm/mach-s5p6440/setup-i2c0.c
index 69e8a66..2c99d14 100644
--- a/arch/arm/mach-s5p6440/setup-i2c0.c
+++ b/arch/arm/mach-s5p6440/setup-i2c0.c
@@ -17,9 +17,14 @@
 
 struct platform_device; /* don't need the contents */
 
+#include linux/gpio.h
+#include plat/gpio-cfg.h
 #include plat/iic.h
 
 void s3c_i2c0_cfg_gpio(struct platform_device *dev)
 {
-   /* Will be populated later */
+   s3c_gpio_cfgpin(S5P6440_GPB(5), S3C_GPIO_SFN(2));
+   s3c_gpio_setpull(S5P6440_GPB(5), S3C_GPIO_PULL_UP

[PATCH 2/3] ARM: S5PV210: Add support for I2C devices on SMDKV210 and SMDKC110

2010-07-16 Thread Kukjin Kim
From: Naveen Krishna Ch ch.nav...@samsung.com

This patch adds support I2C-0/1/2 devices to the SMDKV210/SMDKC110.

Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig |8 
 arch/arm/mach-s5pv210/mach-smdkc110.c |   28 
 arch/arm/mach-s5pv210/mach-smdkv210.c |   29 +
 3 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 0761eac..2a996d9 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -72,9 +72,13 @@ config MACH_SMDKV210
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
select SAMSUNG_DEV_ADC
+   select S3C_DEV_I2C1
+   select S3C_DEV_I2C2
select SAMSUNG_DEV_TS
select S3C_DEV_WDT
select HAVE_S3C2410_WATCHDOG
+   select S5PV210_SETUP_I2C1
+   select S5PV210_SETUP_I2C2
help
  Machine support for Samsung SMDKV210
 
@@ -82,8 +86,12 @@ config MACH_SMDKC110
bool SMDKC110
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
+   select S3C_DEV_I2C1
+   select S3C_DEV_I2C2
select S3C_DEV_WDT
select HAVE_S3C2410_WATCHDOG
+   select S5PV210_SETUP_I2C1
+   select S5PV210_SETUP_I2C2
help
  Machine support for Samsung SMDKC110
  S5PC110(MCP) is one of package option of S5PV210
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c 
b/arch/arm/mach-s5pv210/mach-smdkc110.c
index 4c8903c..420f9a0 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -12,6 +12,7 @@
 #include linux/types.h
 #include linux/init.h
 #include linux/serial_core.h
+#include linux/i2c.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -25,6 +26,7 @@
 #include plat/s5pv210.h
 #include plat/devs.h
 #include plat/cpu.h
+#include plat/iic.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
@@ -74,9 +76,24 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata 
= {
 static struct platform_device *smdkc110_devices[] __initdata = {
s5pv210_device_iis0,
s5pv210_device_ac97,
+   s3c_device_i2c0,
+   s3c_device_i2c1,
+   s3c_device_i2c2,
s3c_device_wdt,
 };
 
+static struct i2c_board_info smdkc100_i2c_devs0[] __initdata = {
+   { I2C_BOARD_INFO(24c08, 0x50), }, /* Samsung S524AD0XD1 */
+};
+
+static struct i2c_board_info smdkc100_i2c_devs1[] __initdata = {
+   /* To Be Updated */
+};
+
+static struct i2c_board_info smdkc100_i2c_devs2[] __initdata = {
+   /* To Be Updated */
+};
+
 static void __init smdkc110_map_io(void)
 {
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -86,6 +103,17 @@ static void __init smdkc110_map_io(void)
 
 static void __init smdkc110_machine_init(void)
 {
+   /* I2C */
+   s3c_i2c0_set_platdata(NULL);
+   s3c_i2c1_set_platdata(NULL);
+   s3c_i2c2_set_platdata(NULL);
+   i2c_register_board_info(0, smdkc100_i2c_devs0,
+   ARRAY_SIZE(smdkc100_i2c_devs0));
+   i2c_register_board_info(1, smdkc100_i2c_devs1,
+   ARRAY_SIZE(smdkc100_i2c_devs1));
+   i2c_register_board_info(2, smdkc100_i2c_devs2,
+   ARRAY_SIZE(smdkc100_i2c_devs2));
+
platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
 }
 
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c 
b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 0d46279..765f47e 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -10,6 +10,7 @@
 
 #include linux/kernel.h
 #include linux/types.h
+#include linux/i2c.h
 #include linux/init.h
 #include linux/serial_core.h
 
@@ -27,6 +28,7 @@
 #include plat/cpu.h
 #include plat/adc.h
 #include plat/ts.h
+#include plat/iic.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |\
@@ -77,10 +79,25 @@ static struct platform_device *smdkv210_devices[] 
__initdata = {
s5pv210_device_iis0,
s5pv210_device_ac97,
s3c_device_adc,
+   s3c_device_i2c0,
+   s3c_device_i2c1,
+   s3c_device_i2c2,
s3c_device_ts,
s3c_device_wdt,
 };
 
+static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = {
+   { I2C_BOARD_INFO(24c08, 0x50), }, /* Samsung S524AD0XD1 */
+};
+
+static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = {
+   /* To Be Updated */
+};
+
+static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = {
+   /* To Be Updated */
+};
+
 static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
.delay  = 1,
.presc  = 49,
@@ -97,6 +114,18 @@ static void __init smdkv210_map_io(void