linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] soc: samsung: Modify and enhance power domain driver
@ 2014-11-03  3:52 Amit Daniel Kachhap
  2014-11-03  3:52 ` [PATCH 01/12] ARM: EXYNOS: Move pmu specific header files under "linux/mfd/samsung" Amit Daniel Kachhap
                   ` (11 more replies)
  0 siblings, 12 replies; 34+ messages in thread
From: Amit Daniel Kachhap @ 2014-11-03  3:52 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc, linux-pm
  Cc: kgene.kim, pankaj.dubey, Amit Daniel Kachhap

This patch series[3 - 12] performs several implementations as described below,

1) Converts power domain driver to platform driver.
2) Registers this driver as MFD client driver.
3) Moves them into driver/soc/samsung folder.
4) Add new power domain notifier feature.
5) Uses those notfier from exynos clk.
6) Adds parent power domain and some other features mostly for exynos7 platforms.

This patch will change the DT representation of all the exynos power domain
DT nodes which will be posted as a new patch series.

This patch has dependency on following patches posted earlier and most of them are
already accepted or in final stages of review.
1) http://www.spinics.net/lists/linux-samsung-soc/msg37050.html
2) https://lkml.org/lkml/2014/10/6/581

Patches 1-2 are from Pankaj and have been posted earlier.
(http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/271555.html
They are kept in this patch series for completeness after rebase fixes.

This complete patch series is rebased on linux-next as it involves many
subsystems.

Amit Daniel Kachhap (10):
  PM / Domains: Add notifier support for power domain transitions
  mfd: exynos-pmu: Register exynos-pmu driver as a mfd driver
  arm: exynos: Add platform driver support for power domain driver
  soc: exynos: Move exynos power domain file to driver/soc/samsung
    folder
  soc: samsung: pm_domain: Use compatible name for power domain name
  soc: samsung: pm_domain: Add a new parameter for power configuration
  soc: samsung: pm_domain: Add support for parent power domain
  soc: samsung: pm_domain: Use the recently added PM Domain notifiers
  clk: samsung: save and restore clock registers for power domain
  arm64: Kconfig: Enable PM_GENERIC_DOMAINS for exynos7

Pankaj Dubey (2):
  ARM: EXYNOS: Move pmu specific header files under "linux/mfd/samsung"
  drivers: mfd: Add support for Exynos PMU driver

 .../bindings/arm/exynos/power_domain.txt           |   21 +++-
 arch/arm/mach-exynos/Kconfig                       |    1 +
 arch/arm/mach-exynos/Makefile                      |    3 +-
 arch/arm/mach-exynos/exynos.c                      |    2 +-
 arch/arm/mach-exynos/mcpm-exynos.c                 |    2 +-
 arch/arm/mach-exynos/platsmp.c                     |    2 +-
 arch/arm/mach-exynos/pm.c                          |    5 +-
 arch/arm/mach-exynos/suspend.c                     |    3 +-
 arch/arm64/Kconfig                                 |    1 +
 drivers/base/power/domain.c                        |  112 +++++++++++++++++-
 drivers/clk/samsung/clk.c                          |   66 +++++++++++
 drivers/clk/samsung/clk.h                          |   14 +++
 drivers/mfd/Kconfig                                |    9 ++
 drivers/mfd/Makefile                               |    1 +
 .../mach-exynos/pmu.c => drivers/mfd/exynos-pmu.c  |   30 ++++-
 drivers/soc/Kconfig                                |    1 +
 drivers/soc/Makefile                               |    1 +
 drivers/soc/samsung/Kconfig                        |   11 ++
 drivers/soc/samsung/Makefile                       |    1 +
 .../soc/samsung}/pm_domains.c                      |  124 ++++++++++++++++----
 .../linux/mfd/samsung}/exynos-pmu.h                |    5 +
 .../linux/mfd/samsung/exynos-regs-pmu.h            |    0
 include/linux/pm_domain.h                          |   31 +++++
 23 files changed, 409 insertions(+), 37 deletions(-)
 rename arch/arm/mach-exynos/pmu.c => drivers/mfd/exynos-pmu.c (96%)
 create mode 100644 drivers/soc/samsung/Kconfig
 create mode 100644 drivers/soc/samsung/Makefile
 rename {arch/arm/mach-exynos => drivers/soc/samsung}/pm_domains.c (51%)
 rename {arch/arm/mach-exynos => include/linux/mfd/samsung}/exynos-pmu.h (86%)
 rename arch/arm/mach-exynos/regs-pmu.h => include/linux/mfd/samsung/exynos-regs-pmu.h (100%)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 34+ messages in thread
* RE: [PATCH 02/12] drivers: mfd: Add support for Exynos PMU driver
@ 2014-11-06  5:48 Pankaj Dubey
  2014-11-06  6:17 ` amit daniel kachhap
  0 siblings, 1 reply; 34+ messages in thread
From: Pankaj Dubey @ 2014-11-06  5:48 UTC (permalink / raw)
  To: 'Sylwester Nawrocki', 'Lee Jones'
  Cc: 'Amit Daniel Kachhap', linux-arm-kernel,
	linux-samsung-soc, linux-pm, kgene.kim, 'Sangbeom Kim',
	'Samuel Ortiz'

On Wednesday, November 05, 2014 7:18 PM, Sylwester Nawrocki wrote:
> On 04/11/14 04:18, Pankaj Dubey wrote:
> > 2: Since PM domain relies on PMU registers and does not have its own 
> > DT binding, MFD client and MFD device is most suitable for making 
> > this kind of platform drivers.
> 
> We have DT binding for the Exynos power domains:
> Documentation/devicetree/bindings/arm/exynos/power_domain.txt
> In fact the IO memory regions used in the power domain bindings fall 
> within the
> (sparse) PMU registers region.
> 

Correct. But currently there is no platform driver for those DT bindings so we have two options:
1) Register a new platform driver for each of those DT nodes, which are using a very small subset of PMU register region. And we end up getting platform driver's probe for each pd nodes.
2) Register an Exynos power domain driver which will be a client driver of main Exynos PMU driver, and will get platform data from it. And in this probe parse all pd device nodes and populate all related information from those nodes into Exynos_pm_domain struct instances and keep list of these instances. Same has been proposed in Amit's patch.

I would prefer second method, as next, we can move pm sleep functionality (which also uses PMU register sets) also into such small mfd client driver. And as far as I know for pm sleep currently there is no DT nodes.

> There is also DT binding for the PMU subsystem:
> Documentation/devicetree/bindings/arm/samsung/pmu.txt

Yes, and currently I have used same binding to convert PMU implementation into a platform driver [1]. Now what we trying to address is same PMU implementation can be reused for ARM64 based SoC if we have to move it into "drivers/mfd/" or "drivers/power/" or may be "drivers/soc".

[1]: http://www.spinics.net/lists/linux-samsung-soc/msg37572.html

Currently we moved into "drivers/mfd" and patches from Amit shows an use case where power domain implementation has been converted into platform driver, but its probe will be called by MFD subsystem and will not be bind to DT nodes of pd  as it will be a client device to main PMU device. Please check this [2], [3].

[2]: http://www.spinics.net/lists/linux-samsung-soc/msg38446.html
[3]: http://www.spinics.net/lists/linux-samsung-soc/msg38447.html

> 
> I guess a platform device driver in drivers/power would be a better 
> fit than drivers/mfd. I doubt introducing an mfd driver now makes much 
> sense, we have already DT bindings for PHYs, the power domains, etc.
> 

The reason behind making it a mfd driver is, to make following design for pm domain and pm sleep functionality.
			 ----------------------
			| Exynos - PMU  |
			| MFD device      |
			| drivers/mfd/     |
			------------------------
				|
		  -----------------------------------------------
		|					|
	  -------------------------------		------------------------------------
	|  Exynos -pd		      |		|   Exynos - pm-sleep	      |
	|  PMU's client device	      |		|   PMU's client device      |  
	| (drivers/soc/samsung/) |		| (drivers/soc/samsung/) |	
	--------------------------------		---------------------------------
 
As Lee mentioned MFD can be used to register the device ( I am assuming he is referring to use of " mfd_add_devices" from Exynos -PMU driver, to make it a mfd device) but it should be kept outside of "drivers/mfd". I just looked for current users of "mfd_add_devices" but only drivers from "drivers/mfd" only are calling this API, also once we call this API it will become an MFD device then why not keep into "drivers/mfd" or maybe I have little understanding of purpose of "drivers/mfd".

But still if it's OK to register Exynos -PMU as MFD device even if it's not in "drivers/mfd" folder, then I would suggest better to keep it in "drivers/soc/samsung/" as it's very much SoC specific. As "drivers/power" looks like place to keep external power supply drivers such as batteries, AC, USB etc.

Thanks,
Pankaj Dubey

> --
> Thanks,
> Sylwester


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2014-11-28 18:04 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03  3:52 [PATCH 00/12] soc: samsung: Modify and enhance power domain driver Amit Daniel Kachhap
2014-11-03  3:52 ` [PATCH 01/12] ARM: EXYNOS: Move pmu specific header files under "linux/mfd/samsung" Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 02/12] drivers: mfd: Add support for Exynos PMU driver Amit Daniel Kachhap
2014-11-03 15:26   ` Lee Jones
2014-11-04  3:18     ` Pankaj Dubey
2014-11-04  8:24       ` Lee Jones
2014-11-05 13:47       ` Sylwester Nawrocki
2014-11-03  3:53 ` [PATCH 03/12] PM / Domains: Add notifier support for power domain transitions Amit Daniel Kachhap
2014-11-03 14:54   ` Rafael J. Wysocki
2014-11-03 14:52     ` Ulf Hansson
2014-11-04  6:18       ` amit daniel kachhap
2014-11-03 18:23     ` Kevin Hilman
2014-11-04  6:44       ` amit daniel kachhap
2014-11-04 11:01         ` Sylwester Nawrocki
2014-11-07 18:45           ` Kevin Hilman
2014-11-10  9:08             ` amit daniel kachhap
2014-11-28 18:04             ` Sylwester Nawrocki
2014-11-03 18:21   ` Sylwester Nawrocki
2014-11-03 18:41     ` Sylwester Nawrocki
2014-11-04  3:23       ` Pankaj Dubey
2014-11-04  6:16     ` amit daniel kachhap
2014-11-04 12:08       ` Sylwester Nawrocki
2014-11-04 18:10         ` [RFC PATCH] pm: Add PM domain state transition notifications Sylwester Nawrocki
2014-11-03  3:53 ` [PATCH 04/12] mfd: exynos-pmu: Register exynos-pmu driver as a mfd driver Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 05/12] arm: exynos: Add platform driver support for power domain driver Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 06/12] soc: exynos: Move exynos power domain file to driver/soc/samsung folder Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 07/12] soc: samsung: pm_domain: Use compatible name for power domain name Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 08/12] soc: samsung: pm_domain: Add a new parameter for power configuration Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 09/12] soc: samsung: pm_domain: Add support for parent power domain Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 10/12] soc: samsung: pm_domain: Use the recently added PM Domain notifiers Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 11/12] clk: samsung: save and restore clock registers for power domain Amit Daniel Kachhap
2014-11-03  3:53 ` [PATCH 12/12] arm64: Kconfig: Enable PM_GENERIC_DOMAINS for exynos7 Amit Daniel Kachhap
  -- strict thread matches above, loose matches on Subject: below --
2014-11-06  5:48 [PATCH 02/12] drivers: mfd: Add support for Exynos PMU driver Pankaj Dubey
2014-11-06  6:17 ` amit daniel kachhap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).