Re: [RESUBMIT RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-29 Thread Pankaj Dubey

On 04/28/2014 09:26 PM, Lee Jones wrote:

This patch moves Exynos PMU driver implementation from
arm/mach-exynos to drivers/mfd.
This driver is mainly used for setting misc bits of register from PMU IP
of Exynos SoC which will be required to configure before Suspend/Resume.
Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
moving ahead for ARM64 based SoC support, there is a need of DT based
implementation of PMU driver.
This driver uses already existing DT binding information.

CC: Sangbeom Kim sbki...@samsung.com
CC: Samuel Ortiz sa...@linux.intel.com
CC: Lee Jones lee.jo...@linaro.org
Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
  arch/arm/mach-exynos/Kconfig   |2 ++
  arch/arm/mach-exynos/Makefile  |2 --
  drivers/mfd/Kconfig|9 +
  drivers/mfd/Makefile   |1 +
  arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c |0
  5 files changed, 12 insertions(+), 2 deletions(-)
  rename arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c (100%)

So I just took a look at the code as zero changes looks suspicious to
me. The driver can not simply be copied and pasted into the MFD
subsystem in its current state.

The fundamental question is; is this chip actually an MFD? What does
it do besides Power Management?


Exynos PMU chip controls different power states of Exynos, so mainly it
does power management related stuff. Apart from this it has few registers
which controls PHY of various IP blocks of Exynos such as USB, HDMI,
ADC etc. But these phy controlling register are currently being accessed
via syscon driver provided regmap APIs. For same the same reason
Exynos PMU has second compatibility string as syscon.


diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 2f60c90..79559b4 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -27,6 +27,7 @@ config ARCH_EXYNOS4
select PM_GENERIC_DOMAINS if PM_RUNTIME
select S5P_DEV_MFC
select MFD_SYSCON
+   select MFD_EXYNOS_PMU
help
  Samsung EXYNOS4 SoCs based systems
  
@@ -38,6 +39,7 @@ config ARCH_EXYNOS5

select HAVE_SMP
select PINCTRL
select MFD_SYSCON
+   select MFD_EXYNOS_PMU
help
  Samsung EXYNOS5 (Cortex-A15) SoC based systems
  
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile

index a656dbe..19fdf17 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -18,8 +18,6 @@ obj-$(CONFIG_PM_SLEEP)+= pm.o sleep.o
  obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
  obj-$(CONFIG_CPU_IDLE)+= cpuidle.o
  
-obj-$(CONFIG_ARCH_EXYNOS)	+= pmu.o

-
  obj-$(CONFIG_SMP) += platsmp.o headsmp.o
  
  obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 3383412..fd48870 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1203,6 +1203,15 @@ config MFD_STW481X
  in various ST Microelectronics and ST-Ericsson embedded
  Nomadik series.
  
+config MFD_EXYNOS_PMU

+   tristate Support Exynos Power Managment Unit
+   depends on ARM || ARM64
+   help
+   Exynos SoC have Power Management Unit (PMU) which controls power and
+   operation state of Exynos SoC in two different ways. This driver
+   provides impmentation of PMU driver and provides basic functionality
+   required during these operation state.
+
  menu Multimedia Capabilities Port drivers
depends on ARCH_SA1100
  
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile

index 2851275..7c43d07 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -166,3 +166,4 @@ obj-$(CONFIG_MFD_RETU)  += retu-mfd.o
  obj-$(CONFIG_MFD_AS3711)  += as3711.o
  obj-$(CONFIG_MFD_AS3722)  += as3722.o
  obj-$(CONFIG_MFD_STW481X) += stw481x.o
+obj-$(CONFIG_MFD_EXYNOS_PMU)   += exynos-pmu.o
diff --git a/arch/arm/mach-exynos/pmu.c b/drivers/mfd/exynos-pmu.c
similarity index 100%
rename from arch/arm/mach-exynos/pmu.c
rename to drivers/mfd/exynos-pmu.c



--
Best Regards,
Pankaj Dubey

--
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: [RESUBMIT RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-29 Thread Pankaj Dubey

On 04/29/2014 02:37 AM, Catalin Marinas wrote:

On Mon, Apr 28, 2014 at 01:26:46PM +0100, Lee Jones wrote:

This patch moves Exynos PMU driver implementation from
arm/mach-exynos to drivers/mfd.
This driver is mainly used for setting misc bits of register from PMU IP
of Exynos SoC which will be required to configure before Suspend/Resume.
Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
moving ahead for ARM64 based SoC support, there is a need of DT based
implementation of PMU driver.
This driver uses already existing DT binding information.

CC: Sangbeom Kim sbki...@samsung.com
CC: Samuel Ortiz sa...@linux.intel.com
CC: Lee Jones lee.jo...@linaro.org
Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
  arch/arm/mach-exynos/Kconfig   |2 ++
  arch/arm/mach-exynos/Makefile  |2 --
  drivers/mfd/Kconfig|9 +
  drivers/mfd/Makefile   |1 +
  arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c |0
  5 files changed, 12 insertions(+), 2 deletions(-)
  rename arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c (100%)

So I just took a look at the code as zero changes looks suspicious to
me. The driver can not simply be copied and pasted into the MFD
subsystem in its current state.

The fundamental question is; is this chip actually an MFD? What does
it do besides Power Management?

I looked at the code briefly as well and I don't think it matches the
mfd idea. Maybe it could be merged together with
arch/arm/mach-exynos/pm.c and moved to drivers/power/ or a more
appropriate directory for platform_suspend_ops.


Well I was also not quite sure about if drivers/mfd is proper place
for Exynos PMU, so I posted this patch as RFC.

If it does not seems matching with drivers/mfd idea, will it be suitable
for drivers/power/ or should I go for something like drivers/soc/samsung?

Regarding your second point about merging this code with mach-exynos/pm.c
We have plan for this but, I would like to get it done via a separate patch 
series

as mach-exynos/pm.c has a lot of dependencies and requires significant
modifications. So this work can be treated as a first step towards that 
direction.


--
Best Regards,
Pankaj Dubey

--
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: [RESUBMIT RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-29 Thread Lee Jones
 This patch moves Exynos PMU driver implementation from
 arm/mach-exynos to drivers/mfd.
 This driver is mainly used for setting misc bits of register from PMU IP
 of Exynos SoC which will be required to configure before Suspend/Resume.
 Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
 moving ahead for ARM64 based SoC support, there is a need of DT based
 implementation of PMU driver.
 This driver uses already existing DT binding information.
 
 CC: Sangbeom Kim sbki...@samsung.com
 CC: Samuel Ortiz sa...@linux.intel.com
 CC: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
 ---
   arch/arm/mach-exynos/Kconfig   |2 ++
   arch/arm/mach-exynos/Makefile  |2 --
   drivers/mfd/Kconfig|9 +
   drivers/mfd/Makefile   |1 +
   arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c |0
   5 files changed, 12 insertions(+), 2 deletions(-)
   rename arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c (100%)
 So I just took a look at the code as zero changes looks suspicious to
 me. The driver can not simply be copied and pasted into the MFD
 subsystem in its current state.
 
 The fundamental question is; is this chip actually an MFD? What does
 it do besides Power Management?
 
 Exynos PMU chip controls different power states of Exynos, so mainly it
 does power management related stuff. Apart from this it has few registers
 which controls PHY of various IP blocks of Exynos such as USB, HDMI,
 ADC etc. But these phy controlling register are currently being accessed
 via syscon driver provided regmap APIs. For same the same reason
 Exynos PMU has second compatibility string as syscon.

I suggest that this is not suitable for the MFD subsystem then.

Try drivers/power.


-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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: [RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-28 Thread Lee Jones
On Fri, 25 Apr 2014, Pankaj Dubey wrote:

 This patch moves Exynos PMU driver implementation from
 arm/mach-exynos to drivers/mfd.
 This driver is mainly used for setting misc bits of register from PMU IP
 of Exynos SoC which will be required to configure before Suspend/Resume.
 Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
 moving ahead for ARM64 based SoC support, there is a need of DT based
 implementation of PMU driver.
 This driver uses already existing DT binding information.
 
 CC: Sangbeom Kim sbki...@samsung.com
 CC: Samuel Ortiz sa...@linux.intel.com
 CC: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
 ---
  arch/arm/mach-exynos/Kconfig  |2 +
  arch/arm/mach-exynos/Makefile |2 -
  arch/arm/mach-exynos/pmu.c|  521 
 -
  drivers/mfd/Kconfig   |9 +
  drivers/mfd/Makefile  |1 +
  drivers/mfd/exynos-pmu.c  |  521 
 +
  6 files changed, 533 insertions(+), 523 deletions(-)
  delete mode 100644 arch/arm/mach-exynos/pmu.c
  create mode 100644 drivers/mfd/exynos-pmu.c

Same with this patch, `git format-patch -M`.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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: [RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-28 Thread Pankaj Dubey

On 04/28/2014 08:21 PM, Lee Jones wrote:

On Fri, 25 Apr 2014, Pankaj Dubey wrote:


This patch moves Exynos PMU driver implementation from
arm/mach-exynos to drivers/mfd.
This driver is mainly used for setting misc bits of register from PMU IP
of Exynos SoC which will be required to configure before Suspend/Resume.
Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
moving ahead for ARM64 based SoC support, there is a need of DT based
implementation of PMU driver.
This driver uses already existing DT binding information.

CC: Sangbeom Kim sbki...@samsung.com
CC: Samuel Ortiz sa...@linux.intel.com
CC: Lee Jones lee.jo...@linaro.org
Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
  arch/arm/mach-exynos/Kconfig  |2 +
  arch/arm/mach-exynos/Makefile |2 -
  arch/arm/mach-exynos/pmu.c|  521 -
  drivers/mfd/Kconfig   |9 +
  drivers/mfd/Makefile  |1 +
  drivers/mfd/exynos-pmu.c  |  521 +
  6 files changed, 533 insertions(+), 523 deletions(-)
  delete mode 100644 arch/arm/mach-exynos/pmu.c
  create mode 100644 drivers/mfd/exynos-pmu.c

Same with this patch, `git format-patch -M`.


OK, I will resubmit this series.



--
Best Regards,
Pankaj Dubey

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


[RESUBMIT RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-28 Thread Pankaj Dubey
This patch moves Exynos PMU driver implementation from
arm/mach-exynos to drivers/mfd.
This driver is mainly used for setting misc bits of register from PMU IP
of Exynos SoC which will be required to configure before Suspend/Resume.
Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
moving ahead for ARM64 based SoC support, there is a need of DT based
implementation of PMU driver.
This driver uses already existing DT binding information.

CC: Sangbeom Kim sbki...@samsung.com
CC: Samuel Ortiz sa...@linux.intel.com
CC: Lee Jones lee.jo...@linaro.org
Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
 arch/arm/mach-exynos/Kconfig   |2 ++
 arch/arm/mach-exynos/Makefile  |2 --
 drivers/mfd/Kconfig|9 +
 drivers/mfd/Makefile   |1 +
 arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c |0
 5 files changed, 12 insertions(+), 2 deletions(-)
 rename arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c (100%)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 2f60c90..79559b4 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -27,6 +27,7 @@ config ARCH_EXYNOS4
select PM_GENERIC_DOMAINS if PM_RUNTIME
select S5P_DEV_MFC
select MFD_SYSCON
+   select MFD_EXYNOS_PMU
help
  Samsung EXYNOS4 SoCs based systems
 
@@ -38,6 +39,7 @@ config ARCH_EXYNOS5
select HAVE_SMP
select PINCTRL
select MFD_SYSCON
+   select MFD_EXYNOS_PMU
help
  Samsung EXYNOS5 (Cortex-A15) SoC based systems
 
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index a656dbe..19fdf17 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -18,8 +18,6 @@ obj-$(CONFIG_PM_SLEEP)+= pm.o sleep.o
 obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
 obj-$(CONFIG_CPU_IDLE) += cpuidle.o
 
-obj-$(CONFIG_ARCH_EXYNOS)  += pmu.o
-
 obj-$(CONFIG_SMP)  += platsmp.o headsmp.o
 
 obj-$(CONFIG_HOTPLUG_CPU)  += hotplug.o
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 3383412..fd48870 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1203,6 +1203,15 @@ config MFD_STW481X
  in various ST Microelectronics and ST-Ericsson embedded
  Nomadik series.
 
+config MFD_EXYNOS_PMU
+   tristate Support Exynos Power Managment Unit
+   depends on ARM || ARM64
+   help
+   Exynos SoC have Power Management Unit (PMU) which controls power and
+   operation state of Exynos SoC in two different ways. This driver
+   provides impmentation of PMU driver and provides basic functionality
+   required during these operation state.
+
 menu Multimedia Capabilities Port drivers
depends on ARCH_SA1100
 
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 2851275..7c43d07 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -166,3 +166,4 @@ obj-$(CONFIG_MFD_RETU)  += retu-mfd.o
 obj-$(CONFIG_MFD_AS3711)   += as3711.o
 obj-$(CONFIG_MFD_AS3722)   += as3722.o
 obj-$(CONFIG_MFD_STW481X)  += stw481x.o
+obj-$(CONFIG_MFD_EXYNOS_PMU)   += exynos-pmu.o
diff --git a/arch/arm/mach-exynos/pmu.c b/drivers/mfd/exynos-pmu.c
similarity index 100%
rename from arch/arm/mach-exynos/pmu.c
rename to drivers/mfd/exynos-pmu.c
-- 
1.7.10.4

--
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: [RESUBMIT RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-28 Thread Lee Jones
 This patch moves Exynos PMU driver implementation from
 arm/mach-exynos to drivers/mfd.
 This driver is mainly used for setting misc bits of register from PMU IP
 of Exynos SoC which will be required to configure before Suspend/Resume.
 Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
 moving ahead for ARM64 based SoC support, there is a need of DT based
 implementation of PMU driver.
 This driver uses already existing DT binding information.
 
 CC: Sangbeom Kim sbki...@samsung.com
 CC: Samuel Ortiz sa...@linux.intel.com
 CC: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
 ---
  arch/arm/mach-exynos/Kconfig   |2 ++
  arch/arm/mach-exynos/Makefile  |2 --
  drivers/mfd/Kconfig|9 +
  drivers/mfd/Makefile   |1 +
  arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c |0
  5 files changed, 12 insertions(+), 2 deletions(-)
  rename arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c (100%)

[...]

 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
 index 3383412..fd48870 100644
 --- a/drivers/mfd/Kconfig
 +++ b/drivers/mfd/Kconfig
 @@ -1203,6 +1203,15 @@ config MFD_STW481X
 in various ST Microelectronics and ST-Ericsson embedded
 Nomadik series.
  
 +config MFD_EXYNOS_PMU
 + tristate Support Exynos Power Managment Unit
 + depends on ARM || ARM64
 + help
 + Exynos SoC have Power Management Unit (PMU) which controls power and
 + operation state of Exynos SoC in two different ways. This driver
 + provides impmentation of PMU driver and provides basic functionality
 + required during these operation state.
 +

The help should be indented. Take a look at the other entries.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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: [RESUBMIT RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-28 Thread Lee Jones
 This patch moves Exynos PMU driver implementation from
 arm/mach-exynos to drivers/mfd.
 This driver is mainly used for setting misc bits of register from PMU IP
 of Exynos SoC which will be required to configure before Suspend/Resume.
 Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
 moving ahead for ARM64 based SoC support, there is a need of DT based
 implementation of PMU driver.
 This driver uses already existing DT binding information.
 
 CC: Sangbeom Kim sbki...@samsung.com
 CC: Samuel Ortiz sa...@linux.intel.com
 CC: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
 ---
  arch/arm/mach-exynos/Kconfig   |2 ++
  arch/arm/mach-exynos/Makefile  |2 --
  drivers/mfd/Kconfig|9 +
  drivers/mfd/Makefile   |1 +
  arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c |0
  5 files changed, 12 insertions(+), 2 deletions(-)
  rename arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c (100%)

So I just took a look at the code as zero changes looks suspicious to
me. The driver can not simply be copied and pasted into the MFD
subsystem in its current state.

The fundamental question is; is this chip actually an MFD? What does
it do besides Power Management?

 diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
 index 2f60c90..79559b4 100644
 --- a/arch/arm/mach-exynos/Kconfig
 +++ b/arch/arm/mach-exynos/Kconfig
 @@ -27,6 +27,7 @@ config ARCH_EXYNOS4
   select PM_GENERIC_DOMAINS if PM_RUNTIME
   select S5P_DEV_MFC
   select MFD_SYSCON
 + select MFD_EXYNOS_PMU
   help
 Samsung EXYNOS4 SoCs based systems
  
 @@ -38,6 +39,7 @@ config ARCH_EXYNOS5
   select HAVE_SMP
   select PINCTRL
   select MFD_SYSCON
 + select MFD_EXYNOS_PMU
   help
 Samsung EXYNOS5 (Cortex-A15) SoC based systems
  
 diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
 index a656dbe..19fdf17 100644
 --- a/arch/arm/mach-exynos/Makefile
 +++ b/arch/arm/mach-exynos/Makefile
 @@ -18,8 +18,6 @@ obj-$(CONFIG_PM_SLEEP)  += pm.o sleep.o
  obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
  obj-$(CONFIG_CPU_IDLE)   += cpuidle.o
  
 -obj-$(CONFIG_ARCH_EXYNOS)+= pmu.o
 -
  obj-$(CONFIG_SMP)+= platsmp.o headsmp.o
  
  obj-$(CONFIG_HOTPLUG_CPU)+= hotplug.o
 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
 index 3383412..fd48870 100644
 --- a/drivers/mfd/Kconfig
 +++ b/drivers/mfd/Kconfig
 @@ -1203,6 +1203,15 @@ config MFD_STW481X
 in various ST Microelectronics and ST-Ericsson embedded
 Nomadik series.
  
 +config MFD_EXYNOS_PMU
 + tristate Support Exynos Power Managment Unit
 + depends on ARM || ARM64
 + help
 + Exynos SoC have Power Management Unit (PMU) which controls power and
 + operation state of Exynos SoC in two different ways. This driver
 + provides impmentation of PMU driver and provides basic functionality
 + required during these operation state.
 +
  menu Multimedia Capabilities Port drivers
   depends on ARCH_SA1100
  
 diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
 index 2851275..7c43d07 100644
 --- a/drivers/mfd/Makefile
 +++ b/drivers/mfd/Makefile
 @@ -166,3 +166,4 @@ obj-$(CONFIG_MFD_RETU)+= retu-mfd.o
  obj-$(CONFIG_MFD_AS3711) += as3711.o
  obj-$(CONFIG_MFD_AS3722) += as3722.o
  obj-$(CONFIG_MFD_STW481X)+= stw481x.o
 +obj-$(CONFIG_MFD_EXYNOS_PMU) += exynos-pmu.o
 diff --git a/arch/arm/mach-exynos/pmu.c b/drivers/mfd/exynos-pmu.c
 similarity index 100%
 rename from arch/arm/mach-exynos/pmu.c
 rename to drivers/mfd/exynos-pmu.c

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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: [RESUBMIT RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-28 Thread Catalin Marinas
On Mon, Apr 28, 2014 at 01:26:46PM +0100, Lee Jones wrote:
  This patch moves Exynos PMU driver implementation from
  arm/mach-exynos to drivers/mfd.
  This driver is mainly used for setting misc bits of register from PMU IP
  of Exynos SoC which will be required to configure before Suspend/Resume.
  Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
  moving ahead for ARM64 based SoC support, there is a need of DT based
  implementation of PMU driver.
  This driver uses already existing DT binding information.
  
  CC: Sangbeom Kim sbki...@samsung.com
  CC: Samuel Ortiz sa...@linux.intel.com
  CC: Lee Jones lee.jo...@linaro.org
  Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
  ---
   arch/arm/mach-exynos/Kconfig   |2 ++
   arch/arm/mach-exynos/Makefile  |2 --
   drivers/mfd/Kconfig|9 +
   drivers/mfd/Makefile   |1 +
   arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c |0
   5 files changed, 12 insertions(+), 2 deletions(-)
   rename arch/arm/mach-exynos/pmu.c = drivers/mfd/exynos-pmu.c (100%)
 
 So I just took a look at the code as zero changes looks suspicious to
 me. The driver can not simply be copied and pasted into the MFD
 subsystem in its current state.
 
 The fundamental question is; is this chip actually an MFD? What does
 it do besides Power Management?

I looked at the code briefly as well and I don't think it matches the
mfd idea. Maybe it could be merged together with
arch/arm/mach-exynos/pm.c and moved to drivers/power/ or a more
appropriate directory for platform_suspend_ops.

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


[RFC PATCH v2 3/3] drivers: mfd: Add support for Exynos PMU driver

2014-04-25 Thread Pankaj Dubey
This patch moves Exynos PMU driver implementation from
arm/mach-exynos to drivers/mfd.
This driver is mainly used for setting misc bits of register from PMU IP
of Exynos SoC which will be required to configure before Suspend/Resume.
Currently all these settings are done in arch/arm/mach-exynos/pmu.c but
moving ahead for ARM64 based SoC support, there is a need of DT based
implementation of PMU driver.
This driver uses already existing DT binding information.

CC: Sangbeom Kim sbki...@samsung.com
CC: Samuel Ortiz sa...@linux.intel.com
CC: Lee Jones lee.jo...@linaro.org
Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
 arch/arm/mach-exynos/Kconfig  |2 +
 arch/arm/mach-exynos/Makefile |2 -
 arch/arm/mach-exynos/pmu.c|  521 -
 drivers/mfd/Kconfig   |9 +
 drivers/mfd/Makefile  |1 +
 drivers/mfd/exynos-pmu.c  |  521 +
 6 files changed, 533 insertions(+), 523 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/pmu.c
 create mode 100644 drivers/mfd/exynos-pmu.c

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 2f60c90..79559b4 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -27,6 +27,7 @@ config ARCH_EXYNOS4
select PM_GENERIC_DOMAINS if PM_RUNTIME
select S5P_DEV_MFC
select MFD_SYSCON
+   select MFD_EXYNOS_PMU
help
  Samsung EXYNOS4 SoCs based systems
 
@@ -38,6 +39,7 @@ config ARCH_EXYNOS5
select HAVE_SMP
select PINCTRL
select MFD_SYSCON
+   select MFD_EXYNOS_PMU
help
  Samsung EXYNOS5 (Cortex-A15) SoC based systems
 
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index a656dbe..19fdf17 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -18,8 +18,6 @@ obj-$(CONFIG_PM_SLEEP)+= pm.o sleep.o
 obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
 obj-$(CONFIG_CPU_IDLE) += cpuidle.o
 
-obj-$(CONFIG_ARCH_EXYNOS)  += pmu.o
-
 obj-$(CONFIG_SMP)  += platsmp.o headsmp.o
 
 obj-$(CONFIG_HOTPLUG_CPU)  += hotplug.o
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
deleted file mode 100644
index a26332f..000
--- a/arch/arm/mach-exynos/pmu.c
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
- * Copyright (c) 2011-2012 Samsung Electronics Co., Ltd.
- * http://www.samsung.com/
- *
- * EXYNOS - CPU PMU(Power Management Unit) support
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include linux/kernel.h
-#include linux/regmap.h
-#include linux/of.h
-#include linux/platform_device.h
-#include linux/slab.h
-#include linux/mfd/syscon.h
-#include linux/mfd/samsung/exynos-regs-pmu.h
-#include linux/mfd/samsung/exynos-pmu.h
-
-enum exynos_pmu_id {
-   PMU_EXYNOS4210,
-   PMU_EXYNOS4X12,
-   PMU_EXYNOS4412,
-   PMU_EXYNOS5250,
-};
-
-struct exynos_pmu_data {
-   enum exynos_pmu_id  pmu_id;
-   struct regmap   *pmu_regmap;
-};
-
-struct exynos_pmu_data *pmu_data;
-static const struct exynos_pmu_conf *exynos_pmu_config;
-typedef void (*exynos_pmu_init_t)(void);
-
-static const struct exynos_pmu_conf exynos4210_pmu_config[] = {
-   /* { .reg = address, .val = { AFTR, LPA, SLEEP } */
-   { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } },
-   { S5P_DIS_IRQ_CORE0,{ 0x0, 0x0, 0x0 } },
-   { S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } },
-   { S5P_ARM_CORE1_LOWPWR, { 0x0, 0x0, 0x2 } },
-   { S5P_DIS_IRQ_CORE1,{ 0x0, 0x0, 0x0 } },
-   { S5P_DIS_IRQ_CENTRAL1, { 0x0, 0x0, 0x0 } },
-   { S5P_ARM_COMMON_LOWPWR,{ 0x0, 0x0, 0x2 } },
-   { S5P_L2_0_LOWPWR,  { 0x2, 0x2, 0x3 } },
-   { S5P_L2_1_LOWPWR,  { 0x2, 0x2, 0x3 } },
-   { S5P_CMU_ACLKSTOP_LOWPWR,  { 0x1, 0x0, 0x0 } },
-   { S5P_CMU_SCLKSTOP_LOWPWR,  { 0x1, 0x0, 0x0 } },
-   { S5P_CMU_RESET_LOWPWR, { 0x1, 0x1, 0x0 } },
-   { S5P_APLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
-   { S5P_MPLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
-   { S5P_VPLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
-   { S5P_EPLL_SYSCLK_LOWPWR,   { 0x1, 0x1, 0x0 } },
-   { S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR, { 0x1, 0x1, 0x0 } },
-   { S5P_CMU_RESET_GPSALIVE_LOWPWR,{ 0x1, 0x1, 0x0 } },
-   { S5P_CMU_CLKSTOP_CAM_LOWPWR,   { 0x1, 0x1, 0x0 } },
-   { S5P_CMU_CLKSTOP_TV_LOWPWR,{ 0x1, 0x1, 0x0 } },
-   { S5P_CMU_CLKSTOP_MFC_LOWPWR,   { 0x1, 0x1, 0x0 } },
-   { S5P_CMU_CLKSTOP_G3D_LOWPWR,