devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prashant Malani <pmalani@chromium.org>
To: Rob Herring <robh@kernel.org>
Cc: linux-kernel@vger.kernel.org, heikki.krogerus@linux.intel.com,
	twawrzynczak@chromium.org, Benson Leung <bleung@chromium.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Guenter Roeck <groeck@chromium.org>
Subject: Re: [PATCH 1/2] dt-bindings: chrome: Add cros-ec-typec mux props
Date: Mon, 11 May 2020 13:46:35 -0700	[thread overview]
Message-ID: <20200511204635.GC136540@google.com> (raw)
In-Reply-To: <20200511192800.GA28762@bogus>

Hi Rob,

Thank you for reviewing the patch. Kindly see my comments inline:

On Mon, May 11, 2020 at 02:28:00PM -0500, Rob Herring wrote:
> On Wed, Apr 22, 2020 at 03:22:39PM -0700, Prashant Malani wrote:
> > Add properties for mode, orientation and USB data role switches for
> > Type C connectors. When available, these will allow the Type C connector
> > class port driver to configure the various switches according to USB PD
> > information (like orientation, alt mode etc.) provided by the Chrome OS
> > EC controller.
> > 
> > Signed-off-by: Prashant Malani <pmalani@chromium.org>
> > ---
> >  .../bindings/chrome/google,cros-ec-typec.yaml | 27 ++++++++++++++++++-
> >  1 file changed, 26 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml b/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml
> > index 6d7396ab8bee..b5814640aa32 100644
> > --- a/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml
> > +++ b/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml
> > @@ -21,7 +21,21 @@ properties:
> >      const: google,cros-ec-typec
> >  
> >    connector:
> > -    $ref: /schemas/connector/usb-connector.yaml#
> > +    allOf:
> > +      - $ref: /schemas/connector/usb-connector.yaml#
> > +      - type: object
> > +        properties:
> 
> These don't seem CrOS EC specific, so why document them as such. 

Are you referring to the "mode-switch", "orientation-switch" and
"usb-role-switch" properties? If so, then yes, they aren't Cros EC
specific. The Type C connector class framework requires the nodes to be
named like this, and the cros-ec-typec driver uses this framework, hence
the description here (the Type C connector class framework doesn't have
any bindings).

Would it be better to add in the description string that Type Connector
class expects these switches to be named this way? :

" Reference to a DT node for the USB Type C Multiplexer controlling the
data lines routing for this connector. This switch is assumed registered
with the Type C connector class framework, which requires it to be named
this way."
> 
> > +          mode-switch:
> > +            description: Reference to a DT node for the USB Type C Multiplexer
> > +              controlling the data lines routing for this connector.
> 
> This is for alternate mode muxing I presume.

Yes, that's right.
> 
> We already have a mux-control binding. Why not use that here?

Heikki might be able to offer more insight into why this is the case,
since the connector class framework seems to expect a phandle and for
the device driver to implement a "set" command. Heikki, would you happen to know?

> 
> > +
> > +          orientation-switch:
> > +            description: Reference to a DT node for the USB Type C orientation
> > +              switch for this connector.
> 
> What's in this node?

Similar to the other "-switch", this will contain a phandle to a device
which can control orientation settings for the Type C Mux. The connector
class API assumes the switches are named this way. For example:

orientation-switch:
https://elixir.bootlin.com/linux/v5.7-rc2/source/drivers/usb/typec/mux.c#L64

mode-switch:
https://elixir.bootlin.com/linux/v5.7-rc2/source/drivers/usb/typec/mux.c#L258

> 
> > +
> > +          usb-role-switch:
> > +            description: Reference to a DT node for the USB Data role switch
> > +              for this connector.
> >  
> >  required:
> >    - compatible
> > @@ -49,6 +63,17 @@ examples:
> >              data-role = "dual";
> >              try-power-role = "source";
> >            };
> > +
> > +          connector@1 {
> > +            compatible = "usb-c-connector";
> > +            reg = <1>;
> > +            power-role = "dual";
> > +            data-role = "host";
> > +            try-power-role = "source";
> > +            mode-switch = <&typec_mux>;
> > +            orientation-switch = <&typec_orientation_switch>;
> > +            usb-role-switch = <&typec_mux>;
> > +          };
> >          };
> >        };
> >      };
> > -- 
> > 2.26.1.301.g55bc3eb7cb9-goog
> > 

  reply	other threads:[~2020-05-11 20:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22 22:22 [PATCH 1/2] dt-bindings: chrome: Add cros-ec-typec mux props Prashant Malani
2020-04-22 22:22 ` [PATCH 2/2] platform/chrome: typec: Register Type C switches Prashant Malani
2020-04-24 11:36   ` Heikki Krogerus
2020-04-29 22:22   ` Enric Balletbo i Serra
2020-04-29 23:02     ` Prashant Malani
2020-04-29 23:20       ` Enric Balletbo i Serra
2020-04-29 22:25   ` Enric Balletbo i Serra
2020-05-18  7:19     ` Prashant Malani
2020-04-23  2:59 ` [PATCH 1/2] dt-bindings: chrome: Add cros-ec-typec mux props Prashant Malani
2020-04-29 22:13 ` Enric Balletbo i Serra
2020-05-06 18:06 ` Benson Leung
2020-05-11 18:03 ` Prashant Malani
2020-05-11 19:28 ` Rob Herring
2020-05-11 20:46   ` Prashant Malani [this message]
2020-05-12 13:41     ` Heikki Krogerus
2020-05-14 18:16       ` Prashant Malani
2020-05-29 21:54       ` Rob Herring
2020-05-29 23:30         ` Prashant Malani
2020-06-09 20:30           ` Rob Herring
2020-06-09 23:57             ` Prashant Malani
2020-06-10 15:33               ` Heikki Krogerus
2020-06-10 16:53                 ` Rob Herring
2020-06-10 17:48                   ` Prashant Malani
2020-06-11 20:00                     ` Rob Herring
2020-06-12 17:34                       ` Prashant Malani
2020-06-15 13:22                         ` Heikki Krogerus
2020-06-18 18:59                           ` Prashant Malani
2020-06-29 20:41                         ` Prashant Malani
2020-07-10  8:51                           ` Prashant Malani
2020-07-17 18:04                             ` Prashant Malani
2020-06-12 12:46                   ` Heikki Krogerus
2020-06-12 14:20                     ` Rob Herring
2020-06-15 10:24                       ` 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=20200511204635.GC136540@google.com \
    --to=pmalani@chromium.org \
    --cc=bleung@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=twawrzynczak@chromium.org \
    /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;
as well as URLs for NNTP newsgroup(s).