[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240819223834.2049862-9-swboyd@chromium.org>
Date: Mon, 19 Aug 2024 15:38:22 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: chrome-platform@...ts.linux.dev
Cc: linux-kernel@...r.kernel.org,
patches@...ts.linux.dev,
devicetree@...r.kernel.org,
Douglas Anderson <dianders@...omium.org>,
Pin-yen Lin <treapking@...omium.org>,
Andrzej Hajda <andrzej.hajda@...el.com>,
Benson Leung <bleung@...omium.org>,
Conor Dooley <conor+dt@...nel.org>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...il.com>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
dri-devel@...ts.freedesktop.org,
Guenter Roeck <groeck@...omium.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Jonas Karlman <jonas@...boo.se>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Lee Jones <lee@...nel.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Neil Armstrong <neil.armstrong@...aro.org>,
Prashant Malani <pmalani@...omium.org>,
Robert Foss <rfoss@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Tzung-Bi Shih <tzungbi@...nel.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Daniel Scally <djrscally@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Ivan Orlov <ivan.orlov0322@...il.com>,
linux-acpi@...r.kernel.org,
linux-usb@...r.kernel.org,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Vinod Koul <vkoul@...nel.org>
Subject: [PATCH v3 08/17] drm/bridge: dp_typec: Add "no-hpd" support
Add support for HPD coming from somewhere else in the drm_bridge chain.
Skip signaling HPD sate when "no-hpd" is present in the DT node backing
the dp_typec bridge.
Add this support because some EC firmwares on Trogdor/Strongbad boards
don't properly indicate the state of the DP HPD level on a type-c port.
The EC only indicates that DP mode is entered or exited for a type-c
port. The HPD level is expressed to the DP controller via a pin on the
AP that the EC drives high or low when the type-c port partner (i.e.
monitor) asserts or deasserts HPD.
Cc: Prashant Malani <pmalani@...omium.org>
Cc: Benson Leung <bleung@...omium.org>
Cc: Tzung-Bi Shih <tzungbi@...nel.org>
Cc: <chrome-platform@...ts.linux.dev>
Cc: Pin-yen Lin <treapking@...omium.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Signed-off-by: Stephen Boyd <swboyd@...omium.org>
---
drivers/gpu/drm/bridge/aux-hpd-bridge.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/aux-hpd-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-bridge.c
index 3d33f7936cbc..adafda4f128f 100644
--- a/drivers/gpu/drm/bridge/aux-hpd-bridge.c
+++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c
@@ -22,6 +22,7 @@ static DEFINE_IDA(drm_aux_hpd_bridge_ida);
struct drm_aux_hpd_bridge_data {
struct drm_bridge bridge;
struct device *dev;
+ bool no_hpd;
};
enum dp_lane {
@@ -354,6 +355,8 @@ void drm_aux_hpd_bridge_notify(struct device *dev, enum drm_connector_status sta
if (!data)
return;
+ if (data->no_hpd)
+ return;
drm_bridge_hpd_notify(&data->bridge, status);
}
@@ -662,6 +665,7 @@ static int drm_aux_hpd_bridge_probe(struct auxiliary_device *auxdev,
return -ENOMEM;
bridge = &hpd_data->bridge;
bridge->funcs = &drm_aux_hpd_bridge_funcs;
+ bridge->ops = DRM_BRIDGE_OP_HPD;
} else if (id->driver_data == DRM_AUX_TYPEC_BRIDGE) {
typec_data = devm_kzalloc(dev, sizeof(*typec_data), GFP_KERNEL);
if (!typec_data)
@@ -670,6 +674,9 @@ static int drm_aux_hpd_bridge_probe(struct auxiliary_device *auxdev,
bridge = &hpd_data->bridge;
bridge->funcs = &drm_dp_typec_bridge_funcs;
typec_bridge_dev = to_drm_dp_typec_bridge_dev(dev);
+ hpd_data->no_hpd = of_property_read_bool(np, "no-hpd");
+ if (!hpd_data->no_hpd)
+ bridge->ops = DRM_BRIDGE_OP_HPD;
memcpy(typec_data->dp_lanes, dp_lanes, sizeof(typec_data->dp_lanes));
ret = drm_dp_typec_bridge_probe_typec_ports(typec_data, typec_bridge_dev, np);
if (ret)
@@ -679,8 +686,7 @@ static int drm_aux_hpd_bridge_probe(struct auxiliary_device *auxdev,
}
hpd_data->dev = dev;
- bridge->of_node = dev_get_platdata(dev);
- bridge->ops = DRM_BRIDGE_OP_HPD;
+ bridge->of_node = np;
bridge->type = DRM_MODE_CONNECTOR_DisplayPort;
auxiliary_set_drvdata(auxdev, hpd_data);
--
https://chromeos.dev
Powered by blists - more mailing lists