[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE-0n51Qy-KDGHOCr4Smpebq1fCURqvJ2RJz6KAtVpv5e+DSGA@mail.gmail.com>
Date: Wed, 19 Apr 2023 23:10:50 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Pin-yen Lin <treapking@...omium.org>
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Benson Leung <bleung@...omium.org>,
Daniel Scally <djrscally@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Guenter Roeck <groeck@...omium.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Jonas Karlman <jonas@...boo.se>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Prashant Malani <pmalani@...omium.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Robert Foss <rfoss@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Xin Ji <xji@...logixsemi.com>, Marek Vasut <marex@...x.de>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Lyude Paul <lyude@...hat.com>, devicetree@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linux-acpi@...r.kernel.org,
chrome-platform@...ts.linux.dev,
NĂcolas F . R . A . Prado
<nfraprado@...labora.com>,
Javier Martinez Canillas <javierm@...hat.com>,
linux-kernel@...r.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Chen-Yu Tsai <wenst@...omium.org>
Subject: Re: [PATCH v15 04/10] dt-bindings: display: bridge: anx7625: Add
mode-switch support
Quoting Stephen Boyd (2023-04-13 17:22:46)
> Quoting Pin-yen Lin (2023-04-13 02:50:44)
> >
> > Actually the `mode-switch` property here is mainly because
> > `fwnode_typec_mux_get`[1] and `typec_mux_match`[2] only return matches
> > when the property is present. I am not sure what side effects would be
> > if I remove the ID-matching condition in `typec_mux_match`, so I added
> > the property here.
> >
> > Is it feasible to remove the `mode-switch` property here given the
> > existing implementation of the Type-C framework?
>
> Omitting the mode-switch property would require changes to the type-c
> framework.
>
> I'm wondering if we can have this anx driver register mode switches for
> however many endpoints exist in the output port all the time when the
> aux-bus node doesn't exist. Then the type-c framework can walk from the
> usb-c-connector to each connected node looking for a device that is both
> a drm_bridge and a mode-switch. When it finds that combination, it knows
> that the mode-switch has been found. This hinges on the idea that a
> device that would have the mode-switch property is a drm_bridge and
> would register a mode-switch with the type-c framework.
>
> It may be a little complicated though, because we would only register
> one drm_bridge for the input to this anx device. The type-c walking code
> would need to look at the graph endpoint, and find the parent device to
> see if it is a drm_bridge.
I've been thinking more about this. I think we should only have the
'mode-switch' property possible when the USB input pins (port@2) are
connected and the DPI input pins are connected (port@0). Probably you
don't have that case though?
In your case, this device should register either one or two drm_bridges
that connect to whatever downstream is actually muxing the 2 DP lanes
with the USB SS lanes onto the usb-c-connector. If that is the EC for
ChromeOS, then the EC should have a binding that accepts some number of
input ports for DP. The EC would act as a drm_bridge, or in this case
probably two bridges, and also as two type-c switches for each
drm_bridge corresponding to the usb-c-connector nodes. When DP is on the
cable, the type-c switch/mux would signal to the drm_bridge that the
display is 'connected' via DRM_BRIDGE_OP_DETECT and struct
drm_bridge_funcs::detect(). Then the drm_bridge in this anx part would
implement struct drm_bridge_funcs::atomic_enable() and configure the
crosspoint switch the right way depending on the reg property of the
output node in port@1.
Because you don't have the part that implements the orientation-switch,
you don't need to implement the code for it. I think simply adding
support in the binding for mode-switch and orientation-switch if this is
directly wired to a usb-c-connector should be sufficient. Those
properties would be at the top-level and not part of the graph binding.
Powered by blists - more mailing lists