From: Pankaj Dubey <pankaj.dubey@samsung.com>
To: 'Sylwester Nawrocki' <s.nawrocki@samsung.com>,
'Lee Jones' <lee.jones@linaro.org>
Cc: 'Amit Daniel Kachhap' <amit.daniel@samsung.com>,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org,
kgene.kim@samsung.com, 'Sangbeom Kim' <sbkim73@samsung.com>,
'Samuel Ortiz' <sameo@linux.intel.com>
Subject: RE: [PATCH 02/12] drivers: mfd: Add support for Exynos PMU driver
Date: Thu, 06 Nov 2014 11:18:48 +0530 [thread overview]
Message-ID: <000601cff985$5b8911f0$129b35d0$@samsung.com> (raw)
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
next reply other threads:[~2014-11-06 5:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 5:48 Pankaj Dubey [this message]
2014-11-06 6:17 ` [PATCH 02/12] drivers: mfd: Add support for Exynos PMU driver amit daniel kachhap
2014-11-06 6:17 ` amit daniel kachhap
-- strict thread matches above, loose matches on Subject: below --
2014-11-03 3:52 [PATCH 00/12] soc: samsung: Modify and enhance power domain driver 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 3:53 ` Amit Daniel Kachhap
2014-11-03 15:26 ` Lee Jones
2014-11-03 15:26 ` Lee Jones
2014-11-04 3:18 ` Pankaj Dubey
2014-11-04 3:18 ` Pankaj Dubey
2014-11-04 8:24 ` Lee Jones
2014-11-04 8:24 ` Lee Jones
2014-11-05 13:47 ` Sylwester Nawrocki
2014-11-05 13:47 ` Sylwester Nawrocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000601cff985$5b8911f0$129b35d0$@samsung.com' \
--to=pankaj.dubey@samsung.com \
--cc=amit.daniel@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=s.nawrocki@samsung.com \
--cc=sameo@linux.intel.com \
--cc=sbkim73@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.