lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201020153706.GB876906@bogus>
Date:   Tue, 20 Oct 2020 10:37:06 -0500
From:   Rob Herring <robh@...nel.org>
To:     Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
        srv_heupstream@...iatek.com
Subject: Re: [PATCH v2 2/3] dt-bindings: regulator: document binding for
 MT6315 regulator

On Tue, Oct 20, 2020 at 05:56:49PM +0800, Hsin-Hsiung Wang wrote:
> Add device tree binding information for MT6315 regulator driver.
> Example bindings for MT6315 are added.
> 
> Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>
> ---
>  .../regulator/mtk,mt6315-regulator.yaml       | 88 +++++++++++++++++++
>  include/dt-bindings/regulator/mtk,mt6315.h    | 17 ++++
>  2 files changed, 105 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mtk,mt6315-regulator.yaml
>  create mode 100644 include/dt-bindings/regulator/mtk,mt6315.h
> 
> diff --git a/Documentation/devicetree/bindings/regulator/mtk,mt6315-regulator.yaml b/Documentation/devicetree/bindings/regulator/mtk,mt6315-regulator.yaml
> new file mode 100644
> index 000000000000..457606800d5b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mtk,mt6315-regulator.yaml
> @@ -0,0 +1,88 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mtk,mt6315-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Mediatek MT6315 Regulator
> +
> +maintainers:
> +  - Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>
> +
> +description: |
> +  The MT6315 is a power management IC (PMIC) configurable with SPMI.
> +  that contains 4 BUCKs output which can combine with each other
> +  by different efuse settings.
> +
> +allOf:
> +  - $ref: "regulator.yaml#"

This doesn't go here, but...

> +
> +properties:
> +  $nodename:
> +    pattern: "mt6315@[0-9]"
> +  compatible:
> +    enum:
> +      - mediatek,mt6315_3-regulator
> +      - mediatek,mt6315_6-regulator
> +      - mediatek,mt6315_7-regulator

What's 3, 6, 7 mean?

> +
> +  reg:
> +    maxItems: 1
> +
> +  regulators:
> +    type: object
> +    description: List of regulators and its properties
> +
> +    patternProperties:
> +      "^vbuck[1-4]$":
> +        type: object

regulator.yaml ref goes here.

> +
> +        properties:
> +          regulator-name:
> +            pattern: "^vbuck[1-4]$"
> +            description:
> +              should be "vbuck1", ..., "vbuck4"
> +
> +          mtk,combined-regulator:
> +            $ref: "/schemas/types.yaml#/definitions/uint32-array"

Wouldn't a phandle make more sense. And we have coupled regulator 
binding that this may work for.

> +            description: |
> +              defines other bucks combined with this buck, must contain the following
> +              values MT6315_VBUCK1, MT6315_VBUCK2, MT6315_VBUCK3, MT6315_VBUCK4
> +
> +    unevaluatedProperties: false

'additionalProperties: false' would be better here.

> +
> +required:
> +  - compatible
> +  - reg
> +  - regulators
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    /* This example shows that buck2 and buck4 are combined into buck1. */
> +    #include <dt-bindings/regulator/mtk,mt6315.h>
> +
> +    mt6315@6 {

pmic@6

> +      compatible = "mediatek,mt6315_6-regulator";
> +      reg = <0x6 0 0xb 1>;
> +
> +      regulators {
> +        vbuck1 {
> +          regulator-compatible = "vbuck1";
> +          regulator-min-microvolt = <300000>;
> +          regulator-max-microvolt = <1193750>;
> +          regulator-enable-ramp-delay = <256>;
> +          regulator-allowed-modes = <0 1 2 4>;
> +          mtk,combined-regulator = <MT6315_VBUCK2 MT6315_VBUCK4>;
> +        };
> +
> +        vbuck3 {
> +          regulator-compatible = "vbuck3";
> +          regulator-min-microvolt = <300000>;
> +          regulator-max-microvolt = <1193750>;
> +          regulator-enable-ramp-delay = <256>;
> +          regulator-allowed-modes = <0 1 2 4>;
> +        };
> +      };
> +    };
> diff --git a/include/dt-bindings/regulator/mtk,mt6315.h b/include/dt-bindings/regulator/mtk,mt6315.h
> new file mode 100644
> index 000000000000..6ed9b2b121db
> --- /dev/null
> +++ b/include/dt-bindings/regulator/mtk,mt6315.h
> @@ -0,0 +1,17 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) 2020 MediaTek Inc.
> + * Author: Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>
> + */
> +
> +#ifndef _DT_BINDINGS_REGULATOR_MTK_MT6315_H
> +#define _DT_BINDINGS_REGULATOR_MTK_MT6315_H
> +
> +/* Regulator ID */
> +#define MT6315_VBUCK1	1
> +#define MT6315_VBUCK2	2
> +#define MT6315_VBUCK3	3
> +#define MT6315_VBUCK4	4

I don't find these defines to be that helpful.

> +#define MT6315_VBUCK_MAX	5
> +
> +#endif /* _DT_BINDINGS_REGULATOR_MTK_MT6315_H */
> -- 
> 2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ