[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170107085456.w5dhm7qadqa6tc7v@kozik-lap>
Date: Sat, 7 Jan 2017 10:54:56 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Peter Chen <peter.chen@....com>
Cc: gregkh@...uxfoundation.org, stern@...land.harvard.edu,
ulf.hansson@...aro.org, broonie@...nel.org, sre@...nel.org,
robh+dt@...nel.org, shawnguo@...nel.org, rjw@...ysocki.net,
dbaryshkov@...il.com, heiko@...ech.de,
linux-arm-kernel@...ts.infradead.org, p.zabel@...gutronix.de,
devicetree@...r.kernel.org, pawel.moll@....com,
mark.rutland@....com, linux-usb@...r.kernel.org, arnd@...db.de,
s.hauer@...gutronix.de, mail@...iej.szmigiero.name,
troy.kisky@...ndarydevices.com, festevam@...il.com,
oscar@...andei.net, stephen.boyd@...aro.org,
linux-pm@...r.kernel.org, stillcompiling@...il.com,
linux-kernel@...r.kernel.org, mka@...omium.org,
vaibhav.hiremath@...aro.org, gary.bisson@...ndarydevices.com,
hverkuil@...all.nl, krzk@...nel.org
Subject: Re: [PATCH v11 2/8] power: add power sequence library
On Thu, Jan 05, 2017 at 02:01:53PM +0800, Peter Chen wrote:
> We have an well-known problem that the device needs to do some power
> sequence before it can be recognized by related host, the typical
> example like hard-wired mmc devices and usb devices.
>
> This power sequence is hard to be described at device tree and handled by
> related host driver, so we have created a common power sequence
> library to cover this requirement. The core code has supplied
> some common helpers for host driver, and individual power sequence
> libraries handle kinds of power sequence for devices. The pwrseq
> librares always need to allocate extra instance for compatible
> string match.
>
> pwrseq_generic is intended for general purpose of power sequence, which
> handles gpios and clocks currently, and can cover other controls in
> future. The host driver just needs to call of_pwrseq_on/of_pwrseq_off
> if only one power sequence is needed, else call of_pwrseq_on_list
> /of_pwrseq_off_list instead (eg, USB hub driver).
>
> For new power sequence library, it can add its compatible string
> to pwrseq_of_match_table, then the pwrseq core will match it with
> DT's, and choose this library at runtime.
>
> Signed-off-by: Peter Chen <peter.chen@....com>
> Tested-by: Maciej S. Szmigiero <mail@...iej.szmigiero.name>
> Tested-by Joshua Clayton <stillcompiling@...il.com>
> Reviewed-by: Matthias Kaehlcke <mka@...omium.org>
> Tested-by: Matthias Kaehlcke <mka@...omium.org>
> ---
> MAINTAINERS | 9 +
> drivers/power/Kconfig | 1 +
> drivers/power/Makefile | 1 +
> drivers/power/pwrseq/Kconfig | 20 ++
> drivers/power/pwrseq/Makefile | 2 +
> drivers/power/pwrseq/core.c | 335 ++++++++++++++++++++++++++++++++++
> drivers/power/pwrseq/pwrseq_generic.c | 224 +++++++++++++++++++++++
> include/linux/power/pwrseq.h | 81 ++++++++
> 8 files changed, 673 insertions(+)
> create mode 100644 drivers/power/pwrseq/Kconfig
> create mode 100644 drivers/power/pwrseq/Makefile
> create mode 100644 drivers/power/pwrseq/core.c
> create mode 100644 drivers/power/pwrseq/pwrseq_generic.c
> create mode 100644 include/linux/power/pwrseq.h
>
Acked-by: Krzysztof Kozlowski <krzk@...nel.org>
Tested on Odroid U3 (reset sequence for LAN9730):
Tested-by: Krzysztof Kozlowski <krzk@...nel.org>
Best regards,
Krzysztof
Powered by blists - more mailing lists