Re: [GIT PULL] Samsung Cleanup EXYNOS clock for v3.4

2012-03-11 Thread Kukjin Kim

On 03/10/12 09:35, Olof Johansson wrote:

[...]



The contents of the branch itself looks good, but now you have introduced
a modified/delete conflict with yourself.

You modify arch/arm/mach-exynos/clock.c in your cleanup-use-static branch, and
then you move it here. That means that when I merge in this branch, git throws
a conflict and I have to do manual edits to make the contents match.

It's better if you base this branch on your cleanup-use-static branch, so that
the move includes those edits. That way there is no conflict resolution to do
at our end either.

Can you please do that rebase and send a fresh pull request? I'll continue
looking at your other requests meanwhile.


Hi Olof,

Sorry for late response. OK I see and your suggestion sounds good to me. 
Let me send a new pull request after that.


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-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: [GIT PULL] Samsung board stuff for v3.4

2012-03-11 Thread Kukjin Kim

On 03/10/12 09:45, Olof Johansson wrote:

Hi,

On Sat, Mar 10, 2012 at 7:34 AM, Kukjin Kimkgene@samsung.com  wrote:

Hi Arnd, Olof,

Please pull regarding Samsung board patches for v3.4.

Most are enabling some features(IPs) on each board and
one is adding new board file, Samsung Mobile's TRATS board.


Given that exynos has started conversion to device tree, there should
not be any  additions of non-devicetree-probed board files being
added.

At the very least, you should move over to using DT_MACHINE instead of
MACHINE for the new board, and probe using device tree. Even better
would be if you added support for this board through mach-exynos4-dt.c
instead of adding a brand new board file.

I also see a large number of the same additions of devices, done to a
number of board files. I don't think you need to rework those patches
now, but please consider how you can make it less churny to add a
device on the SoC in the future without touching all board files.


If you rebase without the board file addition I can take the rest of
the branch while that part is being reworked. Please send a new pull
request with the rebased tree.


OK, I see. let me send a new pull request soon as per your suggestion.

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-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: [GIT PULL 2/4] Samsung devel-pd for v3.4

2012-03-11 Thread Kukjin Kim

On 03/10/12 13:09, Rafael J. Wysocki wrote:

Hi,

On Saturday, March 10, 2012, Olof Johansson wrote:

Hi Rafael,

The below series contains two patches that have been sent to you, and
that are sitting in the pm-domains branch.

Two questions before I pull this into arm-soc:

1) Are you 100% sure this will be submitted to 3.4? And if so, will
you send it early during the merge window?


Yes and yes.


2) Are you 100% sure you will not rebase the branch into which you
pulled the v3.4-for-rafael branch?


Yes, I am.


I am asking because if we pull this in, and you rebase between now and
when it's sent in, we're risking merge conflicts that will be painful
to resolve. We've been bitten by that from other dependencies in the
past so we're being careful.


Sure, I understand that.

As a general rule, topic braches in my tree whose names start with pm- are
never rebased (exactly for this reason).


Hi,

Rafael, thanks.

Olof, please pull devel-samsung-pd from following:

git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
next/devel-samsung-pd


And if any problems, please let me know.
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-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: [GIT PULL 4/4] Samsung devel-dma for v3.4

2012-03-11 Thread Kukjin Kim

On 03/10/12 10:21, Olof Johansson wrote:

On Sat, Mar 10, 2012 at 08:09:11AM -0800, Kukjin Kim wrote:

Hi Arnd, Olof,

This is for Samsung dma stuff for v3.4 and depends on following:
   next/cleanup-use-static
   next/cleanup-exynos-clock

Please pull from:



git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
next/devel-samsung-dma

And conflicts will be happened in clock part. Here is my preferred
resolution. The mach-exynos/clock.c can be removed with following:

arch/arm/mach-exynos/exynos-clock4.c


Hi,

given my feedback on the cleanup-exynos-clock pull request, I'm holding off on
this one waiting on you to do the resolution of the conflicts. :-)


Yes, your suggestion can avoid bad conflicts.

Olof, let me rebase this on top of new cleanup-exynos-clock you 
suggested and will send a new pull request.


Thanks.

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-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: [GIT PULL 3/4] Samsung devel-mmc for v3.4

2012-03-11 Thread Kukjin Kim


On 03/10/12 10:10, Olof Johansson wrote:
 On 03/10/12 10:08, Olof Johansson wrote:

Hi,

On Sat, Mar 10, 2012 at 8:08 AM, Kukjin Kimkgene@samsung.com  wrote:

Hi Arnd, Olof

This is regarding Samsung mmc for v3.4.

As a note, v3.4-for-cjb branch is merged into mmc/mmc-next like following:
http://git.kernel.org/?p=linux/kernel/git/cjb/mmc.git;a=commit;h=fcd9bdae386753531a9cb6b2577359a83f4e121c


Looking at this series, there's really only one patch that is not in
the mmc tree:

ARM: SAMSUNG: change the name from s3c-sdhci to exynos4-sdhci

And all it does is change the platform device string contents.

Since there are no build-time dependencies between this and the MMC
change, I suggest you send only this patch so that we avoid having
merge dependencies where not strictly needed.

Would that be OK with you? If so, please send a fresh pull request
with only the above change in it.



Sorry, I misread the series when browsing it. Looks like there are two

 more patches in it:

 mmc: sdhci-s3c: add platform data for the second capability
 ARM: SAMSUNG: support the second capability for samsung-soc

 But the original suggestion remains, since those two seem to be
 unrelated to the branch sent to Chris. So please resend with just
 those patches, please?

OK, I agree. Let me do it soon.

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-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL v2] Samsung cleanup EXYNOS clock for v3.4

2012-03-11 Thread Kukjin Kim

Hi Arnd, Olof,

I rebased cleanup-exynos-clock on top of cleanup-use-static as per 
Olof's suggestion.


Please pull it from:
  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
next/cleanup-exynos-clock


If any problems, please kindly let me know.

Thanks.

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

The following changes since commit c15a04338b5a6d4305d107a5b6c0cd43418b7f3e:

  Merge branch 'next/cleanup-use-static' into next/cleanup-exynos-clock 
(2012-03-10 22:21:36 -0800)


are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
next/cleanup-exynos-clock


Jaecheol Lee (1):
  ARM: EXYNOS: add clock registers for exynos4x12-cpufreq

Kukjin Kim (4):
  ARM: EXYNOS: replace clock.c for other new EXYNOS SoCs
  ARM: EXYNOS: use static declaration on regarding clock
  ARM: EXYNOS: change the prefix S5P_ to EXYNOS4_ for clock
  PM / devfreq: update the name of EXYNOS clock register

MyungJoo Ham (2):
  PM / devfreq: update the name of EXYNOS clock registers that were 
omitted
  ARM: EXYNOS: Add clock register addresses for EXYNOS4X12 bus 
devfreq driver


 arch/arm/mach-exynos/Makefile |3 +-
 arch/arm/mach-exynos/clock-exynos4.c  | 1563 


 arch/arm/mach-exynos/clock-exynos4.h  |   30 +
 arch/arm/mach-exynos/clock-exynos4210.c   |   46 +-
 arch/arm/mach-exynos/clock-exynos4212.c   |   30 +-
 arch/arm/mach-exynos/clock.c  | 1564 
-

 arch/arm/mach-exynos/common.h |9 +
 arch/arm/mach-exynos/include/mach/exynos4-clock.h |   43 -
 arch/arm/mach-exynos/include/mach/regs-clock.h|  416 +++---
 arch/arm/mach-exynos/pm.c |   40 +-
 drivers/devfreq/exynos4_bus.c |  230 ++--
 11 files changed, 2009 insertions(+), 1965 deletions(-)
 create mode 100644 arch/arm/mach-exynos/clock-exynos4.c
 create mode 100644 arch/arm/mach-exynos/clock-exynos4.h
 delete mode 100644 arch/arm/mach-exynos/clock.c
 delete mode 100644 arch/arm/mach-exynos/include/mach/exynos4-clock.h
--
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


[GIT PULL v2] Samsung board patches for v3.4

2012-03-11 Thread Kukjin Kim

Hi Arnd, Olof,

Please pull regarding rebased Samsung board patches without the non-dt 
board file addition for v3.4.


If any problems, please let me know.

Thanks.

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

The following changes since commit fde7d9049e55ab85a390be7f415d74c9f62dd0f9:

  Linux 3.3-rc7 (2012-03-10 13:49:52 -0800)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
next/board-samsung


Andrzej Pietrasiewicz (2):
  ARM: EXYNOS: Register JPEG on universal_c210
  ARM: EXYNOS: Register JPEG on nuri

Kamil Debski (2):
  ARM: EXYNOS: add G2D to mach-nuri
  ARM: EXYNOS: add G2D to mach-universal

Mark Brown (8):
  ARM: S3C64XX: Support GPIO LEDs on Cragganmore
  ARM: S3C64XX: Fix build of Cragganmore after SPI changes
  ARM: S3C64XX: Enable power management for disk on Cragganmore
  ARM: S3C64XX: Enable power management for WiFi on Cragganmore
  ARM: S3C64XX: Add hookup for Tomatin module on Cragganmore
  ARM: S3C64XX: Add a SPKVDD supply for CODECs on Cragganmore
  ARM: S3C64XX: Add some more Cragganmore module IDs to the table
  ARM: S3C64XX: Supply platform data for SPI on Cragganmore

MyungJoo Ham (1):
  ARM: EXYNOS: support Exynos4210-bus Devfreq driver on Nuri board

Sachin Kamat (13):
  ARM: EXYNOS: Enable G2D on ORIGEN
  ARM: S5PV210: Add missing FIMC media device to Aquila
  ARM: EXYNOS: Add missing FIMC media device to SMDKV310
  ARM: EXYNOS: Add missing FIMC media device to Origen
  ARM: EXYNOS: Enable G2D on SMDKV310
  ARM: S5PV210: Enable MFC on SMDKV210
  ARM: S5PV210: Enable MFC on SMDKC110
  ARM: S5PV210: Enable FIMC on SMDKV210
  ARM: S5PV210: Enable FIMC on SMDKC110
  ARM: EXYNOS: Enable JPEG on SMDKV310
  ARM: EXYNOS: Enable JPEG on Origen
  ARM: S5PV210: Add JPEG board definition
  ARM: S5PV210: Enable JPEG on SMDKV210

Sangwook Lee (1):
  ARM: EXYNOS: Enable Bluetooth on ORIGEN

Sylwester Nawrocki (3):
  ARM: EXYNOS: Increase virtual framebuffer size on Universal C210 
board
  ARM: EXYNOS: Add support for S5K6AAFX image sensor on Universal 
C210 board

  ARM: SAMSUNG: Add support for S5K6AAFX camera on Nuri board

Tushar Behera (2):
  ARM: EXYNOS: Add __init attribute to nuri_camera_init()
  ARM: EXYNOS: Add __init attribute to universal_camera_init()

 arch/arm/mach-exynos/Kconfig |   10 +++
 arch/arm/mach-exynos/mach-nuri.c |   80 
-

 arch/arm/mach-exynos/mach-origen.c   |   37 
 arch/arm/mach-exynos/mach-smdkv310.c |3 +
 arch/arm/mach-exynos/mach-universal_c210.c   |   80 
--

 arch/arm/mach-s3c64xx/Kconfig|1 +
 arch/arm/mach-s3c64xx/mach-crag6410-module.c |   31 ++-
 arch/arm/mach-s3c64xx/mach-crag6410.c|   67 +-
 arch/arm/mach-s5pv210/Kconfig|9 +++
 arch/arm/mach-s5pv210/clock.c|5 ++
 arch/arm/mach-s5pv210/include/mach/map.h |4 +
 arch/arm/mach-s5pv210/mach-aquila.c  |1 +
 arch/arm/mach-s5pv210/mach-smdkc110.c|   14 +
 arch/arm/mach-s5pv210/mach-smdkv210.c|   15 +
 14 files changed, 346 insertions(+), 11 deletions(-)
--
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: [GIT PULL 1/4] Samsung devel for v3.4

2012-03-11 Thread Kukjin Kim

On 03/10/12 10:20, Olof Johansson wrote:

On Sat, Mar 10, 2012 at 8:08 AM, Kukjin Kimkgene@samsung.com  wrote:

Hi Arnd, Olof,

This is various develop regarding Samsung stuff for v3.4.
Please pull following:
  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
next/devel-samsung

I think, you can pull this cleanly without any conflicts.
If any problems, please kindly let me know.



Thanks, pulled into next/soc.


Olof, thanks.

And as a note, will happen merge conflict between this and 
cleanup-exynos-clock. Here is resolution.


diff --git a/arch/arm/mach-exynos/clock-exynos4.c 
b/arch/arm/mach-exynos/clock-exynos4.c

index 31b59e6..060dde7 100644
--- a/arch/arm/mach-exynos/clock-exynos4.c
+++ b/arch/arm/mach-exynos/clock-exynos4.c
@@ -471,6 +471,11 @@ static struct clk exynos4_init_clocks_off[] = {
.enable = exynos4_clk_ip_cam_ctrl,
.ctrlbit= (1  5),
}, {
+   .name   = jpeg,
+   .id = 0,
+   .enable = exynos4_clk_ip_cam_ctrl,
+   .ctrlbit= (1  6),
+   }, {
.name   = fimc,
.devname= exynos4-fimc.0,
.enable = exynos4_clk_ip_cam_ctrl,


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-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL v2 3/4] Samsung devel-mmc for v3.4

2012-03-11 Thread Kukjin Kim

Hi Arnd, Olof

Please pull Samsung devel-mmc for v3.4 and I rebased it on top of 
v3.3-rc7 without v3.4-for-cjb.


Please pull it from:
  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
next/devel-samsung-mmc


If any problems, please kindly let me know.

Thanks.

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

The following changes since commit fde7d9049e55ab85a390be7f415d74c9f62dd0f9:

  Linux 3.3-rc7 (2012-03-10 13:49:52 -0800)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
next/devel-samsung-mmc


Jaehoon Chung (3):
  ARM: SAMSUNG: support the second capability for samsung-soc
  mmc: sdhci-s3c: add platform data for the second capability
  ARM: SAMSUNG: change the name from s3c-sdhci to exynos4-sdhci

 arch/arm/mach-exynos/mach-nuri.c   |4 ++--
 arch/arm/mach-exynos/mach-universal_c210.c |2 +-
 arch/arm/plat-samsung/include/plat/sdhci.h |2 ++
 arch/arm/plat-samsung/platformdata.c   |2 ++
 drivers/mmc/host/sdhci-s3c.c   |6 +++---
 5 files changed, 10 insertions(+), 6 deletions(-)
--
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


[GIT PULL v2 4/4] Samsung devel-dma for v3.4

2012-03-11 Thread Kukjin Kim

Hi Arnd, Olof,

I rebased devel-samsung-dma on top of new next-exynos-clock as per 
Olof's suggestion.


Please pull it from:
 git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
next/devel-samsung-dma


If any problems, please let me know.

Thanks.

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

The following changes since commit 44b2cef5ae6da48523fa634230ca66107110a7dd:

  ARM: EXYNOS: Add clock register addresses for EXYNOS4X12 bus devfreq 
driver (2012-03-10 22:30:32 -0800)


are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
next/devel-samsung-dma


Boojin Kim (2):
  ARM: EXYNOS: Enable MDMA driver
  ARM: EXYNOS: add support DMA for EXYNOS4X12 SoC

Tushar Behera (1):
  ARM: EXYNOS: Add apb_pclk clkdev entry for mdma1

 arch/arm/mach-exynos/Kconfig   |3 +
 arch/arm/mach-exynos/clock-exynos4.c   |9 ++
 arch/arm/mach-exynos/dma.c |  117 
++--

 arch/arm/mach-exynos/include/mach/irqs.h   |2 +
 arch/arm/mach-exynos/include/mach/map.h|3 +-
 arch/arm/plat-samsung/include/plat/dma-pl330.h |   16 +++
 6 files changed, 141 insertions(+), 9 deletions(-)

--
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/5] mmc: sdhci-s3c: setup pins using pinctrl interface

2012-03-11 Thread Thomas Abraham
The platform specific callback to setup the sdhci pin mux and pin config
is removed and the pinctrl subsystem interface is used to setup the
mux and config.

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 drivers/mmc/host/sdhci-s3c.c |   15 +--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index ea0767e..76c1c36 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -22,6 +22,7 @@
 #include linux/module.h
 #include linux/of.h
 #include linux/of_gpio.h
+#include linux/pinctrl/consumer.h
 
 #include linux/mmc/host.h
 
@@ -50,6 +51,7 @@ struct sdhci_s3c {
struct platform_device  *pdev;
struct resource *ioarea;
struct s3c_sdhci_platdata *pdata;
+   struct pinctrl  *pinctrl;
unsigned intcur_clk;
int ext_cd_irq;
int ext_cd_gpio;
@@ -529,6 +531,9 @@ static inline struct sdhci_s3c_drv_data 
*sdhci_s3c_get_driver_data(
platform_get_device_id(pdev)-driver_data;
 }
 
+#include plat/map-s5p.h
+#include plat/map-base.h
+
 static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 {
struct s3c_sdhci_platdata *pdata;
@@ -538,6 +543,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device 
*pdev)
struct sdhci_s3c *sc;
struct resource *res;
int ret, irq, ptr, clks;
+   char *pstate;
 
if (!pdev-dev.platform_data  !pdev-dev.of_node) {
dev_err(dev, no device data specified\n);
@@ -643,8 +649,13 @@ static int __devinit sdhci_s3c_probe(struct 
platform_device *pdev)
}
 
/* Ensure we have minimal gpio selected CMD/CLK/Detect */
-   if (pdata-cfg_gpio)
-   pdata-cfg_gpio(pdev, pdata-max_width);
+   pstate = pdata-max_width ? sdhci-pcfg8 : sdhci-pcfg4;
+   sc-pinctrl = pinctrl_get_select(pdev-dev, pstate);
+   if (IS_ERR(sc-pinctrl)) {
+   dev_err(dev, failed to setup pin configuration\n);
+   ret = -ENXIO;
+   goto err_req_regs;
+   }
 
host-hw_name = samsung-hsmmc;
host-ops = sdhci_s3c_ops;
-- 
1.6.6.rc2

--
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 4/5] ARM: Exynos: Enable pinctrl driver support for Origen board

2012-03-11 Thread Thomas Abraham
Add the pinctrl platform devices for static registration and add
default pin maps.

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 arch/arm/mach-exynos/mach-origen.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/mach-origen.c 
b/arch/arm/mach-exynos/mach-origen.c
index 02c242e..4e39a9b 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -21,6 +21,8 @@
 #include linux/mfd/max8997.h
 #include linux/lcd.h
 #include linux/rfkill-gpio.h
+#include linux/pinctrl/consumer.h
+#include linux/pinctrl/machine.h
 
 #include asm/mach/arch.h
 #include asm/hardware/gic.h
@@ -41,6 +43,7 @@
 #include plat/pd.h
 #include plat/fb.h
 #include plat/mfc.h
+#include plat/pinctrl.h
 
 #include mach/ohci.h
 #include mach/map.h
@@ -622,6 +625,9 @@ static struct platform_device origen_device_bluetooth = {
 };
 
 static struct platform_device *origen_devices[] __initdata = {
+   exynos4_pinctrl0,
+   exynos4_pinctrl1,
+   exynos4_pinctrl2,
s3c_device_hsmmc2,
s3c_device_hsmmc0,
s3c_device_i2c0,
@@ -697,6 +703,7 @@ static void __init origen_reserve(void)
 
 static void __init origen_machine_init(void)
 {
+   exynos4210_pinctrl_register_def_mappings();
origen_power_init();
 
s3c_i2c0_set_platdata(NULL);
-- 
1.6.6.rc2

--
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 3/5] ARM: Exynos4: Add pinctrl devices and pin maps

2012-03-11 Thread Thomas Abraham
Add the three pinctrl platform devices and the pin maps for Exynos4.

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 arch/arm/mach-exynos/Kconfig  |1 +
 arch/arm/mach-exynos/Makefile |1 +
 arch/arm/mach-exynos/common.h |6 ++
 arch/arm/mach-exynos/dev-pinctrl.c|  115 +
 arch/arm/plat-samsung/include/plat/devs.h |3 +
 5 files changed, 126 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-exynos/dev-pinctrl.c

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index c49d450..3e6a1cd 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -18,6 +18,7 @@ choice
 config ARCH_EXYNOS4
bool SAMSUNG EXYNOS4
select HAVE_SMP
+   select PINCTRL
select MIGHT_HAVE_CACHE_L2X0
help
  Samsung EXYNOS4 SoCs based systems
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 6fd8dd9..dbac5f9 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_EXYNOS4_DEV_SYSMMU)  += dev-sysmmu.o
 obj-$(CONFIG_EXYNOS4_DEV_DWMCI)+= dev-dwmci.o
 obj-$(CONFIG_EXYNOS4_DEV_DMA)  += dma.o
 obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o
+obj-$(CONFIG_PINCTRL_SAMSUNG)  += dev-pinctrl.o
 
 obj-$(CONFIG_ARCH_EXYNOS)  += setup-i2c0.o
 obj-$(CONFIG_EXYNOS4_SETUP_FIMC)   += setup-fimc.o
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 677b546..64f3c57 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -52,4 +52,10 @@ void exynos4212_register_clocks(void);
 #define exynos4212_register_clocks()
 #endif
 
+#ifdef CONFIG_PINCTRL_SAMSUNG
+extern int exynos4210_pinctrl_register_def_mappings(void);
+#else
+#define exynos4210_pinctrl_register_def_mappings()
+#endif
+
 #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
diff --git a/arch/arm/mach-exynos/dev-pinctrl.c 
b/arch/arm/mach-exynos/dev-pinctrl.c
new file mode 100644
index 000..d909052
--- /dev/null
+++ b/arch/arm/mach-exynos/dev-pinctrl.c
@@ -0,0 +1,115 @@
+/*
+ * platform device for all the instances of pinctrl.
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * 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/pinctrl/machine.h
+
+#include plat/devs.h
+#include plat/pinctrl.h
+
+#include mach/map.h
+
+static struct resource exynos4_pinctrl_resource0[] = {
+   [0] = {
+   .start  = EXYNOS4_PA_GPIO1,
+   .end= EXYNOS4_PA_GPIO1 + SZ_4K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = IRQ_GPIO_XA,
+   .end= IRQ_GPIO_XA,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+struct platform_device exynos4_pinctrl0 = {
+   .name   = exynos4-pinctrl,
+   .id = 0,
+   .resource   = exynos4_pinctrl_resource0,
+   .num_resources  = ARRAY_SIZE(exynos4_pinctrl_resource0),
+};
+
+static struct resource exynos4_pinctrl_resource1[] = {
+   [0] = {
+   .start  = EXYNOS4_PA_GPIO2,
+   .end= EXYNOS4_PA_GPIO2 + SZ_4K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = IRQ_GPIO_XB,
+   .end= IRQ_GPIO_XB,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+struct platform_device exynos4_pinctrl1 = {
+   .name   = exynos4-pinctrl,
+   .id = 1,
+   .resource   = exynos4_pinctrl_resource1,
+   .num_resources  = ARRAY_SIZE(exynos4_pinctrl_resource1),
+};
+
+static struct resource exynos4_pinctrl_resource2[] = {
+   [0] = {
+   .start  = EXYNOS4_PA_GPIO3,
+   .end= EXYNOS4_PA_GPIO3 + SZ_4K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+};
+
+struct platform_device exynos4_pinctrl2 = {
+   .name   = exynos4-pinctrl,
+   .id = 2,
+   .resource   = exynos4_pinctrl_resource2,
+   .num_resources  = ARRAY_SIZE(exynos4_pinctrl_resource2),
+};
+
+/* pin config options. todo: add other options here. */
+static unsigned long pcfg_pu_drv3[] __initdata = {
+   PINCTRL_CFG_PACK(PUD_UP, DRV_4X),
+};
+
+static unsigned long pcfg_pn_drv3[] __initdata = {
+   PINCTRL_CFG_PACK(PUD_NONE, DRV_4X),
+};
+
+/* Exynos4210 SoC default pin-maps reusable by Exynos4210 based boards*/
+
+static struct pinctrl_map __initdata exynos4210_sdhci2_8bit_map[] = {
+   

[PATCH 2/5] pinctrl: add exynos4 specific pins, groups, functions and gpio chip data

2012-03-11 Thread Thomas Abraham
Add Exynos4 specific information about pins, groups, functions and gpio
chip data that will be used as driver data by the Samsung pinctrl driver.

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 drivers/pinctrl/Kconfig   |7 +
 drivers/pinctrl/Makefile  |1 +
 drivers/pinctrl/pinctrl-exynos4.c |  522 +
 3 files changed, 530 insertions(+), 0 deletions(-)
 create mode 100644 drivers/pinctrl/pinctrl-exynos4.c

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index a068d16..b798a52 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -82,6 +82,13 @@ config PINCTRL_COH901
 config PINCTRL_SAMSUNG
bool Samsung pinctrl driver
 
+config PINCTRL_EXYNOS4
+   bool Pinctrl driver data for Exynos4 SoC
+   depends on ARCH_EXYNOS4
+   select PINCTRL_SAMSUNG
+   select PINMUX
+   select PINCONF
+
 endmenu
 
 endif
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index eaccc1b..79b6cda 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -16,3 +16,4 @@ obj-$(CONFIG_PINCTRL_TEGRA30) += pinctrl-tegra30.o
 obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o
 obj-$(CONFIG_PINCTRL_COH901)   += pinctrl-coh901.o
 obj-$(CONFIG_PINCTRL_SAMSUNG)  += pinctrl-samsung.o
+obj-$(CONFIG_PINCTRL_EXYNOS4)  += pinctrl-exynos4.o
diff --git a/drivers/pinctrl/pinctrl-exynos4.c 
b/drivers/pinctrl/pinctrl-exynos4.c
new file mode 100644
index 000..5eb6168
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-exynos4.c
@@ -0,0 +1,522 @@
+/*
+ * Exynos4 specific driver data for Samsung pinctrl and gpiolib driver.
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ * Copyright (c) 2011 Linaro Ltd
+ * http://www.linaro.org
+ *
+ * This file contains the Exynos4 specific driver data for the Samsung
+ * pinctrl/gpiolib interface drivers.
+ *
+ * ToDo: Add additional pin functions and pin groups available on Exynos4210.
+ *
+ * Author: Thomas Abraham thomas...@samsung.com
+ *
+ * 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/module.h
+#include linux/platform_device.h
+#include linux/pinctrl/pinmux.h
+#include linux/pinctrl/pinconf.h
+#include linux/gpio.h
+
+#include plat/pinctrl.h
+
+#include pinctrl-samsung.h
+
+/* Exynos4210 Pin-Controller 0 pin list */
+static unsigned int exynos4210_i2c2_pins[] = {
+   EXYNOS4_GPA0(6), EXYNOS4_GPA0(7),
+};
+
+static unsigned int exynos4210_i2c3_pins[] = {
+   EXYNOS4_GPA1(2), EXYNOS4_GPA1(3),
+};
+
+static unsigned int exynos4210_spi0_pins[] = {
+   EXYNOS4_GPB(0), EXYNOS4_GPB(1), EXYNOS4_GPB(2), EXYNOS4_GPB(3),
+};
+
+static unsigned int exynos4210_i2c4_pins[] = {
+   EXYNOS4_GPB(2), EXYNOS4_GPB(3),
+};
+
+static unsigned int exynos4210_spi1_pins[] = {
+   EXYNOS4_GPB(4), EXYNOS4_GPB(5), EXYNOS4_GPB(6), EXYNOS4_GPB(7),
+};
+
+static unsigned int exynos4210_i2c5_pins[] = {
+   EXYNOS4_GPB(6), EXYNOS4_GPB(7),
+};
+
+static unsigned int exynos4210_i2s1_pcm1_ac97_pins[] = {
+   EXYNOS4_GPC0(0), EXYNOS4_GPC0(1), EXYNOS4_GPC0(2), EXYNOS4_GPC0(3),
+   EXYNOS4_GPC0(4),
+};
+
+static unsigned int exynos4210_i2s2_pcm2_pins[] = {
+   EXYNOS4_GPC1(0), EXYNOS4_GPC1(1), EXYNOS4_GPC1(2), EXYNOS4_GPC1(3),
+   EXYNOS4_GPC1(4),
+};
+
+static unsigned int exynos4210_spdif_pins[] = {
+   EXYNOS4_GPC1(0), EXYNOS4_GPC1(1),
+};
+
+static unsigned int exynos4210_spi2_pins[] = {
+   EXYNOS4_GPC1(1), EXYNOS4_GPC1(2), EXYNOS4_GPC1(3), EXYNOS4_GPC1(4),
+};
+
+static unsigned int exynos4210_i2c6_pins[] = {
+   EXYNOS4_GPC1(3), EXYNOS4_GPC1(4),
+};
+
+static unsigned int exynos4210_i2c7_pins[] = {
+   EXYNOS4_GPD0(2), EXYNOS4_GPD0(3),
+};
+
+static unsigned int exynos4210_i2c0_pins[] = {
+   EXYNOS4_GPD1(0), EXYNOS4_GPD1(1),
+};
+
+static unsigned int exynos4210_cam_b_pins[] = {
+   EXYNOS4_GPE0(0), EXYNOS4_GPE0(1), EXYNOS4_GPE0(2), EXYNOS4_GPE0(3),
+   EXYNOS4_GPE0(4), EXYNOS4_GPE1(0), EXYNOS4_GPE1(1), EXYNOS4_GPE1(2),
+   EXYNOS4_GPE1(3), EXYNOS4_GPE1(4), EXYNOS4_GPE1(5), EXYNOS4_GPE1(6),
+   EXYNOS4_GPE1(7),
+};
+
+static unsigned int exynos4210_lcd_pins[] = {
+   EXYNOS4_GPF0(0), EXYNOS4_GPF0(1), EXYNOS4_GPF0(2), EXYNOS4_GPF0(3),
+   EXYNOS4_GPF0(4), EXYNOS4_GPF0(5), EXYNOS4_GPF0(6), EXYNOS4_GPF0(7),
+   EXYNOS4_GPF1(0), EXYNOS4_GPF1(1), EXYNOS4_GPF1(2), EXYNOS4_GPF1(3),
+   EXYNOS4_GPF1(4), EXYNOS4_GPF1(5), EXYNOS4_GPF1(6), EXYNOS4_GPF1(7),
+   EXYNOS4_GPF2(0), EXYNOS4_GPF2(1), EXYNOS4_GPF2(2), EXYNOS4_GPF2(3),
+   EXYNOS4_GPF2(4), EXYNOS4_GPF2(5), EXYNOS4_GPF2(6), EXYNOS4_GPF2(7),
+   EXYNOS4_GPF3(0), EXYNOS4_GPF3(1), EXYNOS4_GPF3(2), EXYNOS4_GPF3(3),
+};
+
+/* Exynos4210 Pin-Controller 1 pin list */

Re: [PATCH 3/5] ARM: Exynos4: Add pinctrl devices and pin maps

2012-03-11 Thread Kukjin Kim
Thomas Abraham wrote:
 Add the three pinctrl platform devices and the pin maps for Exynos4.
 
 Signed-off-by: Thomas Abrahamthomas.abra...@linaro.org
 ---
   arch/arm/mach-exynos/Kconfig  |1 +
   arch/arm/mach-exynos/Makefile |1 +
   arch/arm/mach-exynos/common.h |6 ++
   arch/arm/mach-exynos/dev-pinctrl.c|  115 
 +
   arch/arm/plat-samsung/include/plat/devs.h |3 +
   5 files changed, 126 insertions(+), 0 deletions(-)
   create mode 100644 arch/arm/mach-exynos/dev-pinctrl.c

[...]

 +#includelinux/kernel.h
 +#includelinux/dma-mapping.h
 +#includelinux/platform_device.h
 +#includelinux/interrupt.h
 +#includelinux/pinctrl/machine.h

#include linux/ioport.h for DEFINE_RES_xxx at below.

 +
 +#includeplat/devs.h
 +#includeplat/pinctrl.h
 +
 +#includemach/map.h
 +
 +static struct resource exynos4_pinctrl_resource0[] = {
 + [0] = {
 + .start  = EXYNOS4_PA_GPIO1,
 + .end= EXYNOS4_PA_GPIO1 + SZ_4K - 1,
 + .flags  = IORESOURCE_MEM,
 + },

[0] = DEFINE_RES_MEM(EXYNOS4_PA_GPIO1, SZ_4K),

 + [1] = {
 + .start  = IRQ_GPIO_XA,
 + .end= IRQ_GPIO_XA,
 + .flags  = IORESOURCE_IRQ,
 + },

[1] = DEFINE_RES_IRQ(IRQ_GPIO_XA),

But I'm thinking, we need to move to use EXYNOS4_IRQ_GPIO_XA here for
both EXYNOS4 and EXYNOS5 and as a note, I'm working on updating IRQ
naming you can see it in this week :)

 +};
 +
 +struct platform_device exynos4_pinctrl0 = {
 + .name   = exynos4-pinctrl,
 + .id = 0,
 + .resource   = exynos4_pinctrl_resource0,
 + .num_resources  = ARRAY_SIZE(exynos4_pinctrl_resource0),
 +};
 +
 +static struct resource exynos4_pinctrl_resource1[] = {
 + [0] = {
 + .start  = EXYNOS4_PA_GPIO2,
 + .end= EXYNOS4_PA_GPIO2 + SZ_4K - 1,
 + .flags  = IORESOURCE_MEM,
 + },

same as above.

 + [1] = {
 + .start  = IRQ_GPIO_XB,
 + .end= IRQ_GPIO_XB,
 + .flags  = IORESOURCE_IRQ,
 + },

same.

 +};
 +
 +struct platform_device exynos4_pinctrl1 = {
 + .name   = exynos4-pinctrl,
 + .id = 1,
 + .resource   = exynos4_pinctrl_resource1,
 + .num_resources  = ARRAY_SIZE(exynos4_pinctrl_resource1),
 +};
 +
 +static struct resource exynos4_pinctrl_resource2[] = {
 + [0] = {
 + .start  = EXYNOS4_PA_GPIO3,
 + .end= EXYNOS4_PA_GPIO3 + SZ_4K - 1,
 + .flags  = IORESOURCE_MEM,
 + },

same.

 +};
 +
 +struct platform_device exynos4_pinctrl2 = {
 + .name   = exynos4-pinctrl,
 + .id = 2,
 + .resource   = exynos4_pinctrl_resource2,
 + .num_resources  = ARRAY_SIZE(exynos4_pinctrl_resource2),
 +};
 +

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-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 5/5] mmc: sdhci-s3c: setup pins using pinctrl interface

2012-03-11 Thread Kukjin Kim
Thomas Abraham wrote:
 The platform specific callback to setup the sdhci pin mux and pin config
 is removed and the pinctrl subsystem interface is used to setup the
 mux and config.
 
 Signed-off-by: Thomas Abrahamthomas.abra...@linaro.org
 ---
   drivers/mmc/host/sdhci-s3c.c |   15 +--
   1 files changed, 13 insertions(+), 2 deletions(-)
 
[...]

 
 +#includeplat/map-s5p.h
 +#includeplat/map-base.h

You can add mach/map.h instead of above.

 +
   static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
   {
   struct s3c_sdhci_platdata *pdata;
 @@ -538,6 +543,7 @@ static int __devinit sdhci_s3c_probe(struct 
 platform_device *pdev)
   struct sdhci_s3c *sc;
   struct resource *res;
   int ret, irq, ptr, clks;
 + char *pstate;
 
   if (!pdev-dev.platform_data  !pdev-dev.of_node) {
   dev_err(dev, no device data specified\n);
 @@ -643,8 +649,13 @@ static int __devinit sdhci_s3c_probe(struct 
 platform_device *pdev)
   }
 
   /* Ensure we have minimal gpio selected CMD/CLK/Detect */
 - if (pdata-cfg_gpio)
 - pdata-cfg_gpio(pdev, pdata-max_width);

I'm not sure we can remove above now for all of Samsung stuff?

 + pstate = pdata-max_width ? sdhci-pcfg8 : sdhci-pcfg4;

Is this right? Current max_width can be 4 or 8 in each board file now.

 + sc-pinctrl = pinctrl_get_select(pdev-dev, pstate);
 + if (IS_ERR(sc-pinctrl)) {
 + dev_err(dev, failed to setup pin configuration\n);
 + ret = -ENXIO;
 + goto err_req_regs;
 + }
 
   host-hw_name = samsung-hsmmc;
   host-ops =sdhci_s3c_ops;

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-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] drivers: mmc: sdhci-s3c: fix broken compilation for non-Exynos SoCs

2012-03-11 Thread Jaehoon Chung
Looks fine to me.

Acked-by: Jaehoon Chung jh80.ch...@samsung.com

On 03/09/2012 10:44 PM, Marek Szyprowski wrote:

 exynos4_sdhci_drv_data structure is not available on non-Exynos builds,
 that's why EXYNOS4_SDHCI_DRV_DATA macro has been introduced. This patch
 fixes commit 67819656 'mmc: sdhci-s3c: Add device tree support' to use
 that macro. This fixes broken build for pre-Exynos SoCs.
 
 Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
 ---
  drivers/mmc/host/sdhci-s3c.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
 index ea0767e..984601e 100644
 --- a/drivers/mmc/host/sdhci-s3c.c
 +++ b/drivers/mmc/host/sdhci-s3c.c
 @@ -859,7 +859,7 @@ MODULE_DEVICE_TABLE(platform, sdhci_s3c_driver_ids);
  static const struct of_device_id sdhci_s3c_dt_match[] = {
   { .compatible = samsung,s3c6410-sdhci, },
   { .compatible = samsung,exynos4210-sdhci,
 - .data = exynos4_sdhci_drv_data },
 + .data = EXYNOS4_SDHCI_DRV_DATA },
   {},
  };
  MODULE_DEVICE_TABLE(of, sdhci_s3c_dt_match);


--
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 5/5] mmc: sdhci-s3c: setup pins using pinctrl interface

2012-03-11 Thread Kyungmin Park
On 3/11/12, Thomas Abraham thomas.abra...@linaro.org wrote:
 The platform specific callback to setup the sdhci pin mux and pin config
 is removed and the pinctrl subsystem interface is used to setup the
 mux and config.

 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
 ---
  drivers/mmc/host/sdhci-s3c.c |   15 +--
  1 files changed, 13 insertions(+), 2 deletions(-)

 diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
 index ea0767e..76c1c36 100644
 --- a/drivers/mmc/host/sdhci-s3c.c
 +++ b/drivers/mmc/host/sdhci-s3c.c
 @@ -22,6 +22,7 @@
  #include linux/module.h
  #include linux/of.h
  #include linux/of_gpio.h
 +#include linux/pinctrl/consumer.h

  #include linux/mmc/host.h

 @@ -50,6 +51,7 @@ struct sdhci_s3c {
   struct platform_device  *pdev;
   struct resource *ioarea;
   struct s3c_sdhci_platdata *pdata;
 + struct pinctrl  *pinctrl;
   unsigned intcur_clk;
   int ext_cd_irq;
   int ext_cd_gpio;
 @@ -529,6 +531,9 @@ static inline struct sdhci_s3c_drv_data
 *sdhci_s3c_get_driver_data(
   platform_get_device_id(pdev)-driver_data;
  }

 +#include plat/map-s5p.h
 +#include plat/map-base.h

Why this header files are required?
 +
  static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
  {
   struct s3c_sdhci_platdata *pdata;
 @@ -538,6 +543,7 @@ static int __devinit sdhci_s3c_probe(struct
 platform_device *pdev)
   struct sdhci_s3c *sc;
   struct resource *res;
   int ret, irq, ptr, clks;
 + char *pstate;

   if (!pdev-dev.platform_data  !pdev-dev.of_node) {
   dev_err(dev, no device data specified\n);
 @@ -643,8 +649,13 @@ static int __devinit sdhci_s3c_probe(struct
 platform_device *pdev)
   }

   /* Ensure we have minimal gpio selected CMD/CLK/Detect */
 - if (pdata-cfg_gpio)
 - pdata-cfg_gpio(pdev, pdata-max_width);
 + pstate = pdata-max_width ? sdhci-pcfg8 : sdhci-pcfg4;
You should check pdata-max_width == 8 instead of max_width itself.
BTW if platform set the amx_width as 1. How do you handle this?

Thank you,
Kyungmin Park
 + sc-pinctrl = pinctrl_get_select(pdev-dev, pstate);
 + if (IS_ERR(sc-pinctrl)) {
 + dev_err(dev, failed to setup pin configuration\n);
 + ret = -ENXIO;
 + goto err_req_regs;
 + }

   host-hw_name = samsung-hsmmc;
   host-ops = sdhci_s3c_ops;
 --
 1.6.6.rc2

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

--
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 3/5] ARM: Exynos4: Add pinctrl devices and pin maps

2012-03-11 Thread Thomas Abraham
2012/3/12 Kukjin Kim kgene@samsung.com:
 Thomas Abraham wrote:
 Add the three pinctrl platform devices and the pin maps for Exynos4.

 Signed-off-by: Thomas Abrahamthomas.abra...@linaro.org
 ---
   arch/arm/mach-exynos/Kconfig              |    1 +
   arch/arm/mach-exynos/Makefile             |    1 +
   arch/arm/mach-exynos/common.h             |    6 ++
   arch/arm/mach-exynos/dev-pinctrl.c        |  115 
 +
   arch/arm/plat-samsung/include/plat/devs.h |    3 +
   5 files changed, 126 insertions(+), 0 deletions(-)
   create mode 100644 arch/arm/mach-exynos/dev-pinctrl.c

 [...]

 +#includelinux/kernel.h
 +#includelinux/dma-mapping.h
 +#includelinux/platform_device.h
 +#includelinux/interrupt.h
 +#includelinux/pinctrl/machine.h

 #include linux/ioport.h for DEFINE_RES_xxx at below.

 +
 +#includeplat/devs.h
 +#includeplat/pinctrl.h
 +
 +#includemach/map.h
 +
 +static struct resource exynos4_pinctrl_resource0[] = {
 +     [0] = {
 +             .start  = EXYNOS4_PA_GPIO1,
 +             .end    = EXYNOS4_PA_GPIO1 + SZ_4K - 1,
 +             .flags  = IORESOURCE_MEM,
 +     },

 [0] = DEFINE_RES_MEM(EXYNOS4_PA_GPIO1, SZ_4K),

 +     [1] = {
 +             .start  = IRQ_GPIO_XA,
 +             .end    = IRQ_GPIO_XA,
 +             .flags  = IORESOURCE_IRQ,
 +     },

 [1] = DEFINE_RES_IRQ(IRQ_GPIO_XA),

 But I'm thinking, we need to move to use EXYNOS4_IRQ_GPIO_XA here for
 both EXYNOS4 and EXYNOS5 and as a note, I'm working on updating IRQ
 naming you can see it in this week :)

Thanks for reviewing this patch series. I will use DEFINE_RES_xxx for
resource instantiation.

Regards,
Thomas.

[...]
--
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 5/5] mmc: sdhci-s3c: setup pins using pinctrl interface

2012-03-11 Thread Thomas Abraham
2012/3/12 Kukjin Kim kgene@samsung.com:
 Thomas Abraham wrote:
 The platform specific callback to setup the sdhci pin mux and pin config
 is removed and the pinctrl subsystem interface is used to setup the
 mux and config.

 Signed-off-by: Thomas Abrahamthomas.abra...@linaro.org
 ---
   drivers/mmc/host/sdhci-s3c.c |   15 +--
   1 files changed, 13 insertions(+), 2 deletions(-)

 [...]


 +#includeplat/map-s5p.h
 +#includeplat/map-base.h

 You can add mach/map.h instead of above.

 +
   static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
   {
       struct s3c_sdhci_platdata *pdata;
 @@ -538,6 +543,7 @@ static int __devinit sdhci_s3c_probe(struct 
 platform_device *pdev)
       struct sdhci_s3c *sc;
       struct resource *res;
       int ret, irq, ptr, clks;
 +     char *pstate;

       if (!pdev-dev.platform_data  !pdev-dev.of_node) {
               dev_err(dev, no device data specified\n);
 @@ -643,8 +649,13 @@ static int __devinit sdhci_s3c_probe(struct 
 platform_device *pdev)
       }

       /* Ensure we have minimal gpio selected CMD/CLK/Detect */
 -     if (pdata-cfg_gpio)
 -             pdata-cfg_gpio(pdev, pdata-max_width);

 I'm not sure we can remove above now for all of Samsung stuff?

We the pin map table is fully populated for each SoC (and board as
necessary), then the platform callback functions to setup the pinmux
and pinconfig can be removed for the drivers. But before doing that,
the next step would be to add gpio interrupts and wakeup interrupts
support into the samsung pinctrl driver. When we have a fully
functional pinctrl driver, we could add the required bits in SoC and
board files and switch over to the pinctrl driver.


 +     pstate = pdata-max_width ? sdhci-pcfg8 : sdhci-pcfg4;

 Is this right? Current max_width can be 4 or 8 in each board file now.

Sorry, that is not correct. I will fix it. Thanks.

Regards,
Thomas.
--
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 5/5] mmc: sdhci-s3c: setup pins using pinctrl interface

2012-03-11 Thread Thomas Abraham
On 12 March 2012 08:08, Kyungmin Park kmp...@infradead.org wrote:
 On 3/11/12, Thomas Abraham thomas.abra...@linaro.org wrote:
 The platform specific callback to setup the sdhci pin mux and pin config
 is removed and the pinctrl subsystem interface is used to setup the
 mux and config.

 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
 ---
  drivers/mmc/host/sdhci-s3c.c |   15 +--
  1 files changed, 13 insertions(+), 2 deletions(-)

 diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
 index ea0767e..76c1c36 100644
 --- a/drivers/mmc/host/sdhci-s3c.c
 +++ b/drivers/mmc/host/sdhci-s3c.c
 @@ -22,6 +22,7 @@
  #include linux/module.h
  #include linux/of.h
  #include linux/of_gpio.h
 +#include linux/pinctrl/consumer.h

  #include linux/mmc/host.h

 @@ -50,6 +51,7 @@ struct sdhci_s3c {
       struct platform_device  *pdev;
       struct resource         *ioarea;
       struct s3c_sdhci_platdata *pdata;
 +     struct pinctrl          *pinctrl;
       unsigned int            cur_clk;
       int                     ext_cd_irq;
       int                     ext_cd_gpio;
 @@ -529,6 +531,9 @@ static inline struct sdhci_s3c_drv_data
 *sdhci_s3c_get_driver_data(
                       platform_get_device_id(pdev)-driver_data;
  }

 +#include plat/map-s5p.h
 +#include plat/map-base.h

 Why this header files are required?

Sorry, that was a mistake. This was left over here after adding it
here for some debugging. I will take care next time.

 +
  static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
  {
       struct s3c_sdhci_platdata *pdata;
 @@ -538,6 +543,7 @@ static int __devinit sdhci_s3c_probe(struct
 platform_device *pdev)
       struct sdhci_s3c *sc;
       struct resource *res;
       int ret, irq, ptr, clks;
 +     char *pstate;

       if (!pdev-dev.platform_data  !pdev-dev.of_node) {
               dev_err(dev, no device data specified\n);
 @@ -643,8 +649,13 @@ static int __devinit sdhci_s3c_probe(struct
 platform_device *pdev)
       }

       /* Ensure we have minimal gpio selected CMD/CLK/Detect */
 -     if (pdata-cfg_gpio)
 -             pdata-cfg_gpio(pdev, pdata-max_width);
 +     pstate = pdata-max_width ? sdhci-pcfg8 : sdhci-pcfg4;
 You should check pdata-max_width == 8 instead of max_width itself.

Thanks. I will fix that.

 BTW if platform set the amx_width as 1. How do you handle this?

If the bus width is 1, we need to add pin map entry for 1 bit bus
width and correspondingly change the code here. I used the sdhci-s3c
driver for testing the samsung pinctrl driver and only tested with
4-bit and 8-bit bus width. The changes in this patch are not final yet
and was mainly included in this series to show how platform callbacks
can be removed.

Thanks,
Thomas.
--
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 1/2] i2c-s3c2410: Rework device type handling

2012-03-11 Thread Thomas Abraham
On 9 March 2012 22:34, Karol Lewandowski k.lewando...@samsung.com wrote:
 Reorganize driver a bit to better handle device tree-based systems:

  - move machine type to driver's private structure instead of
   quering platform device variants in runtime

  - replace s3c24xx_i2c_type enum with plain unsigned int that can
   hold not only device type but also hw revision-specific quirks

 Signed-off-by: Karol Lewandowski k.lewando...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  drivers/i2c/busses/i2c-s3c2410.c |   56 +
  1 files changed, 20 insertions(+), 36 deletions(-)

 diff --git a/drivers/i2c/busses/i2c-s3c2410.c 
 b/drivers/i2c/busses/i2c-s3c2410.c
 index 737f721..5b400c6 100644
 --- a/drivers/i2c/busses/i2c-s3c2410.c
 +++ b/drivers/i2c/busses/i2c-s3c2410.c
 @@ -44,8 +44,12 @@
  #include plat/regs-iic.h
  #include plat/iic.h

 -/* i2c controller state */
 +/* type */
 +#define TYPE_BITS              0x00ff
 +#define TYPE_S3C2410           0x0001
 +#define TYPE_S3C2440           0x0002

 +/* i2c controller state */
  enum s3c24xx_i2c_state {
        STATE_IDLE,
        STATE_START,
 @@ -54,14 +58,10 @@ enum s3c24xx_i2c_state {
        STATE_STOP
  };

 -enum s3c24xx_i2c_type {
 -       TYPE_S3C2410,
 -       TYPE_S3C2440,
 -};
 -
  struct s3c24xx_i2c {
        spinlock_t              lock;
        wait_queue_head_t       wait;
 +       unsigned int            type;
        unsigned int            suspended:1;

        struct i2c_msg          *msg;
 @@ -88,28 +88,6 @@ struct s3c24xx_i2c {
  #endif
  };

 -/* default platform data removed, dev should always carry data. */
 -
 -/* s3c24xx_i2c_is2440()
 - *
 - * return true is this is an s3c2440
 -*/
 -
 -static inline int s3c24xx_i2c_is2440(struct s3c24xx_i2c *i2c)
 -{
 -       struct platform_device *pdev = to_platform_device(i2c-dev);
 -       enum s3c24xx_i2c_type type;
 -
 -#ifdef CONFIG_OF
 -       if (i2c-dev-of_node)
 -               return of_device_is_compatible(i2c-dev-of_node,
 -                               samsung,s3c2440-i2c);
 -#endif
 -
 -       type = platform_get_device_id(pdev)-driver_data;
 -       return type == TYPE_S3C2440;
 -}
 -
  /* s3c24xx_i2c_master_complete
  *
  * complete the message and wake up the caller, using the given return code,
 @@ -676,7 +654,7 @@ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, 
 unsigned int *got)

        writel(iiccon, i2c-regs + S3C2410_IICCON);

 -       if (s3c24xx_i2c_is2440(i2c)) {
 +       if (i2c-type  TYPE_S3C2440) {

This should be changed to
if (i2c-type == TYPE_S3C2440)

                unsigned long sda_delay;

                if (pdata-sda_delay) {
 @@ -847,6 +825,8 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c)
  }

  #ifdef CONFIG_OF
 +static const struct of_device_id s3c24xx_i2c_match[];
 +
  /* s3c24xx_i2c_parse_dt
  *
  * Parse the device tree node and retreive the platform data.
 @@ -856,11 +836,16 @@ static void
  s3c24xx_i2c_parse_dt(struct device_node *np, struct s3c24xx_i2c *i2c)
  {
        struct s3c2410_platform_i2c *pdata = i2c-pdata;
 +       const struct of_device_id *match;

        if (!np)
                return;

        pdata-bus_num = -1; /* i2c bus number is dynamically assigned */
 +
 +       match = of_match_node(s3c24xx_i2c_match[0], np);

This could be
match = of_match_node(s3c24xx_i2c_match, np);

 +       i2c-type = (unsigned int)match-data;
 +

This function (s3c24xx_i2c_parse_dt) is intended to retrieve the data
from i2c device node. It would be better to not add the determination
of the i2c type inside this function.

        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,
 @@ -906,9 +891,10 @@ static int s3c24xx_i2c_probe(struct platform_device 
 *pdev)
                goto err_noclk;
        }

 -       if (pdata)
 +       if (pdata) {
                memcpy(i2c-pdata, pdata, sizeof(*pdata));
 -       else
 +               i2c-type = platform_get_device_id(pdev)-driver_data;
 +       } else
                s3c24xx_i2c_parse_dt(pdev-dev.of_node, i2c);

It would be better to move the task of retrieving the driver data to a
separate function. An example of this listed below (copied from the
samsung uart driver).

static inline struct s3c24xx_serial_drv_data *s3c24xx_get_driver_data(
struct platform_device *pdev)
{
#ifdef CONFIG_OF
if (pdev-dev.of_node) {
const struct of_device_id *match;
match = of_match_node(s3c24xx_uart_dt_match, pdev-dev.of_node);
return (struct s3c24xx_serial_drv_data *)match-data;
}
#endif
return (struct s3c24xx_serial_drv_data *)
platform_get_device_id(pdev)-driver_data;
}


        strlcpy(i2c-adap.name, s3c2410-i2c, sizeof(i2c-adap.name));
 @@ -1123,13 +1109,11 @@