All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Pin-yen Lin <treapking@chromium.org>
Cc: "Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Benson Leung" <bleung@chromium.org>,
	"Daniel Scally" <djrscally@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"David Airlie" <airlied@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Guenter Roeck" <groeck@chromium.org>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Prashant Malani" <pmalani@chromium.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Xin Ji" <xji@analogixsemi.com>, "Marek Vasut" <marex@denx.de>,
	"Hsin-Yi Wang" <hsinyi@chromium.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Lyude Paul" <lyude@redhat.com>,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev,
	"Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	linux-kernel@vger.kernel.org,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Chen-Yu Tsai" <wenst@chromium.org>
Subject: Re: [PATCH v15 04/10] dt-bindings: display: bridge: anx7625: Add mode-switch support
Date: Wed, 19 Apr 2023 23:10:50 -0700	[thread overview]
Message-ID: <CAE-0n51Qy-KDGHOCr4Smpebq1fCURqvJ2RJz6KAtVpv5e+DSGA@mail.gmail.com> (raw)
In-Reply-To: <CAE-0n50atfmr-bFh5XtTCm4WpSijJGSe0B5JP8ni7CCYk7Bs5A@mail.gmail.com>

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.

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <swboyd@chromium.org>
To: Pin-yen Lin <treapking@chromium.org>
Cc: "Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	dri-devel@lists.freedesktop.org,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Guenter Roeck" <groeck@chromium.org>,
	"Marek Vasut" <marex@denx.de>,
	chrome-platform@lists.linux.dev, "Robert Foss" <rfoss@kernel.org>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	linux-acpi@vger.kernel.org, "Chen-Yu Tsai" <wenst@chromium.org>,
	devicetree@vger.kernel.org,
	"Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Hsin-Yi Wang" <hsinyi@chromium.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Xin Ji" <xji@analogixsemi.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	"Daniel Scally" <djrscally@gmail.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Prashant Malani" <pmalani@chromium.org>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v15 04/10] dt-bindings: display: bridge: anx7625: Add mode-switch support
Date: Wed, 19 Apr 2023 23:10:50 -0700	[thread overview]
Message-ID: <CAE-0n51Qy-KDGHOCr4Smpebq1fCURqvJ2RJz6KAtVpv5e+DSGA@mail.gmail.com> (raw)
In-Reply-To: <CAE-0n50atfmr-bFh5XtTCm4WpSijJGSe0B5JP8ni7CCYk7Bs5A@mail.gmail.com>

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.

  reply	other threads:[~2023-04-20  6:10 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31  9:11 [PATCH v15 00/10] Register Type-C mode-switch in DP bridge endpoints Pin-yen Lin
2023-03-31  9:11 ` Pin-yen Lin
2023-03-31  9:11 ` [PATCH v15 01/10] device property: Add remote endpoint to devcon matcher Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-04-07 21:54   ` Stephen Boyd
2023-04-07 21:54     ` Stephen Boyd
2023-03-31  9:11 ` [PATCH v15 02/10] platform/chrome: cros_ec_typec: Purge blocking switch devlinks Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-03-31  9:11 ` [PATCH v15 03/10] drm/display: Add Type-C switch helpers Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-03-31  9:11 ` [PATCH v15 04/10] dt-bindings: display: bridge: anx7625: Add mode-switch support Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-04-06 15:18   ` Rob Herring
2023-04-06 15:18     ` Rob Herring
2023-04-12  1:38   ` Stephen Boyd
2023-04-12  1:38     ` Stephen Boyd
2023-04-13  9:50     ` Pin-yen Lin
2023-04-13  9:50       ` Pin-yen Lin
2023-04-14  0:22       ` Stephen Boyd
2023-04-14  0:22         ` Stephen Boyd
2023-04-20  6:10         ` Stephen Boyd [this message]
2023-04-20  6:10           ` Stephen Boyd
2023-04-20  9:10           ` Pin-yen Lin
2023-04-20  9:10             ` Pin-yen Lin
2023-04-27  8:33             ` Pin-yen Lin
2023-04-27  8:33               ` Pin-yen Lin
2023-04-29  4:47             ` Stephen Boyd
2023-04-29  4:47               ` Stephen Boyd
2023-05-10  3:41               ` Pin-yen Lin
2023-05-10  3:41                 ` Pin-yen Lin
2023-05-11 17:30                 ` Stephen Boyd
2023-05-11 17:30                   ` Stephen Boyd
2023-05-30  5:15                   ` Pin-yen Lin
2023-05-30  5:15                     ` Pin-yen Lin
2023-05-30  6:25                 ` Jagan Teki
2023-05-30  6:25                   ` Jagan Teki
2023-03-31  9:11 ` [PATCH v15 05/10] drm/bridge: anx7625: Check for Type-C during panel registration Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-03-31  9:11 ` [PATCH v15 06/10] drm/bridge: Remove redundant i2c_client in anx7625/it6505 Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-03-31  9:11 ` [PATCH v15 07/10] drm/bridge: anx7625: Register Type C mode switches Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-03-31  9:11 ` [PATCH v15 08/10] dt-bindings: display: bridge: it6505: Add mode-switch support Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-04-06 15:15   ` Rob Herring
2023-04-06 15:15     ` Rob Herring
2023-04-06 15:50     ` Pin-yen Lin
2023-04-06 15:50       ` Pin-yen Lin
2023-03-31  9:11 ` [PATCH v15 09/10] drm/bridge: it6505: Fix Kconfig indentation Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin
2023-03-31  9:11 ` [PATCH v15 10/10] drm/bridge: it6505: Register Type C mode switches Pin-yen Lin
2023-03-31  9:11   ` Pin-yen Lin

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=CAE-0n51Qy-KDGHOCr4Smpebq1fCURqvJ2RJz6KAtVpv5e+DSGA@mail.gmail.com \
    --to=swboyd@chromium.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=djrscally@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=hsinyi@chromium.org \
    --cc=javierm@redhat.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=marex@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=nfraprado@collabora.com \
    --cc=pmalani@chromium.org \
    --cc=rafael@kernel.org \
    --cc=rfoss@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=treapking@chromium.org \
    --cc=tzimmermann@suse.de \
    --cc=wenst@chromium.org \
    --cc=xji@analogixsemi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.