mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Cixi Geng <gengcixi@gmail.com>,
	gregkh@linuxfoundation.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, orsonzhai@gmail.com,
	baolin.wang7@gmail.com, zhang.lyra@gmail.com,
	heikki.krogerus@linux.intel.com
Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: usb: Add documentation for sc27xx typec controller
Date: Sat, 7 May 2022 18:52:28 +0200	[thread overview]
Message-ID: <64376af4-a4b0-9411-33c6-54c3f57e1fa2@linaro.org> (raw)
In-Reply-To: <20220507092953.2273879-2-gengcixi@gmail.com>

On 07/05/2022 11:29, Cixi Geng wrote:
> From: Cixi Geng <cixi.geng1@unisoc.com>
> 
> The Spreadtrum PMIC SC27xx integrated typec port controller.
> add the bindings to describe sc27xx typec controller.
> 
> Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
> ---
>  .../bindings/usb/sprd,sc27xx-typec.yaml       | 72 +++++++++++++++++++
>  1 file changed, 72 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/sprd,sc27xx-typec.yaml
> 
> diff --git a/Documentation/devicetree/bindings/usb/sprd,sc27xx-typec.yaml b/Documentation/devicetree/bindings/usb/sprd,sc27xx-typec.yaml
> new file mode 100644
> index 000000000000..6e49198c88da
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/sprd,sc27xx-typec.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright 2022 Unisoc Inc.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/sprd,sc27xx-typec.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: SC27XX Type-C port controller
> +
> +description:
> +  The UNISOC, also know as Spreadtrum, SC27XX is a USB Type-C port controller which
> +  supports role and plug orientation detection using the CC pins. It is
> +  compatible with the USB Type-C Cable and Connector Specification v1.2.
> +
> +maintainers:
> +  - Cixi Geng <gengcixi@gmail.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - sprd,sc2730-typec
> +      - sprd,sc2721-typec

Order alphabetically, please.

> +      - sprd,ump96xx-typec
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  sprd,mode:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      The Type-C port mode type

This does not look appropriate. You need to use usb-connector.yaml and
its power-role property. Check existing examples.

Even without usb-connector.yaml schema, you should not hard-code some
magical 32-bit unknown numbers without any documented meaning (bindings)...

> +
> +  nvmem-cells:
> +    maxItems: 2
> +    description:
> +      Reference to an nvmem node for the calibration data.
> +
> +  nvmem-cell-names:
> +    items:
> +      - const: typec_cc1_cal
> +      - const: typec_cc2_cal
> +
> +required:
> +  - compatible
> +  - reg
> +  - sprd,mode
> +  - nvmem-cells
> +  - nvmem-cell-names
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    pmic {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        pmic_typec: typec@380 {
> +                compatible = "sprd,sc2730-typec";
> +                interrupt-parent = <&sc2730_pmic>;
> +                interrupts = <8>;
> +                reg = <0x380>;

Put reg just after compatible.

> +                sprd,mode = <2>;
> +                nvmem-cells = <&typec_cc1_cal>, <&typec_cc2_cal>;
> +                nvmem-cell-names = "typec_cc1_cal", "typec_cc2_cal";
> +                status = "okay";

Examples do not have status. No point.

> +        };
> +    };
> +...


Best regards,
Krzysztof

  reply	other threads:[~2022-05-07 16:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-07  9:29 [PATCH 0/2] Add PMIC SC27XX " Cixi Geng
2022-05-07  9:29 ` [PATCH 1/2] dt-bindings: usb: Add documentation for sc27xx " Cixi Geng
2022-05-07 16:52   ` Krzysztof Kozlowski [this message]
2022-05-07  9:29 ` [PATCH 2/2] usb: typec: sprd: Support the SC27CC typec port controller Cixi Geng
2022-05-09 13:03   ` Heikki Krogerus
2022-05-13  9:00     ` Cixi Geng
2022-05-13 11:18       ` Heikki Krogerus

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=64376af4-a4b0-9411-33c6-54c3f57e1fa2@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=baolin.wang7@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gengcixi@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=zhang.lyra@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®