Re: [PATCH 1/2] power: reset: Add qcom reboot mode driver

From: Rob Herring
Date: Tue Oct 18 2016 - 10:12:28 EST


On Fri, Oct 14, 2016 at 10:02:27AM +0800, Xiaogang Cui wrote:
> This is a initial version so it's very similar with syscon
> reboot mode driver. We will add more functionalities in the
> further after dependency is ready.
>
> Signed-off-by: Xiaogang Cui <xiaogang@xxxxxxxxxxxxxx>
> ---
> .../bindings/power_supply/qcom-reboot-mode.txt | 23 +++++
> drivers/power/reset/Kconfig | 10 ++
> drivers/power/reset/Makefile | 1 +
> drivers/power/reset/qcom-reboot-mode.c | 109 +++++++++++++++++++++
> 4 files changed, 143 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/power_supply/qcom-reboot-mode.txt
> create mode 100644 drivers/power/reset/qcom-reboot-mode.c
>
> diff --git a/Documentation/devicetree/bindings/power_supply/qcom-reboot-mode.txt b/Documentation/devicetree/bindings/power_supply/qcom-reboot-mode.txt
> new file mode 100644
> index 0000000..8b33592
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power_supply/qcom-reboot-mode.txt
> @@ -0,0 +1,23 @@
> +Qualcomm Reboot Mode Driver
> +
> +Qualcomm reboot mode driver based on reboot mode framework to update
> +SPMI specific bits.
> +
> +Required Properties:
> +-compatible: "qcom,reboot-mode"
> +-offset: offset of the SPMI reboot mode register
> +
> +Optional Properties:
> +-mask: mask of reboot mode
> +-mode-xxx: magic of reboot mode
> +
> +Example:
> + qcom,reboot-mode@88f {

Node names should be generic. Just reboot-mode@...

> + compatible = "qcom,reboot-mode";
> + offset = <0x88f>;
> + mode-normal = <0x00>;
> + mode-recovery = <0x04>;
> + mode-bootloader = <0x08>;
> + mode-rtc = <0x0C>;

In addition to what John said, I think vendor specfic modes should
have a vendor prefix (e.g. qcom,mode-rtc). That will complicate parsing
a bit though.

Rob