Skip to content

Commit f47f537

Browse files
committed
Revert "Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP""
This commit was accidentally reverted instead of another commit, and therefore needs to be reinstated. This reverts commit 8c9c40e. Fixes: 8c9c40e ("Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP"") Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e09523a commit f47f537

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

drivers/gpu/drm/bridge/ti-sn65dsi86.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <drm/drm_atomic_helper.h>
3030
#include <drm/drm_bridge.h>
3131
#include <drm/drm_bridge_connector.h>
32+
#include <drm/drm_edid.h>
3233
#include <drm/drm_mipi_dsi.h>
3334
#include <drm/drm_of.h>
3435
#include <drm/drm_panel.h>
@@ -68,6 +69,7 @@
6869
#define BPP_18_RGB BIT(0)
6970
#define SN_HPD_DISABLE_REG 0x5C
7071
#define HPD_DISABLE BIT(0)
72+
#define HPD_DEBOUNCED_STATE BIT(4)
7173
#define SN_GPIO_IO_REG 0x5E
7274
#define SN_GPIO_INPUT_SHIFT 4
7375
#define SN_GPIO_OUTPUT_SHIFT 0
@@ -1158,10 +1160,33 @@ static void ti_sn_bridge_atomic_post_disable(struct drm_bridge *bridge,
11581160
pm_runtime_put_sync(pdata->dev);
11591161
}
11601162

1163+
static enum drm_connector_status ti_sn_bridge_detect(struct drm_bridge *bridge)
1164+
{
1165+
struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge);
1166+
int val = 0;
1167+
1168+
pm_runtime_get_sync(pdata->dev);
1169+
regmap_read(pdata->regmap, SN_HPD_DISABLE_REG, &val);
1170+
pm_runtime_put_autosuspend(pdata->dev);
1171+
1172+
return val & HPD_DEBOUNCED_STATE ? connector_status_connected
1173+
: connector_status_disconnected;
1174+
}
1175+
1176+
static struct edid *ti_sn_bridge_get_edid(struct drm_bridge *bridge,
1177+
struct drm_connector *connector)
1178+
{
1179+
struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge);
1180+
1181+
return drm_get_edid(connector, &pdata->aux.ddc);
1182+
}
1183+
11611184
static const struct drm_bridge_funcs ti_sn_bridge_funcs = {
11621185
.attach = ti_sn_bridge_attach,
11631186
.detach = ti_sn_bridge_detach,
11641187
.mode_valid = ti_sn_bridge_mode_valid,
1188+
.get_edid = ti_sn_bridge_get_edid,
1189+
.detect = ti_sn_bridge_detect,
11651190
.atomic_pre_enable = ti_sn_bridge_atomic_pre_enable,
11661191
.atomic_enable = ti_sn_bridge_atomic_enable,
11671192
.atomic_disable = ti_sn_bridge_atomic_disable,
@@ -1257,6 +1282,9 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev,
12571282
pdata->bridge.type = pdata->next_bridge->type == DRM_MODE_CONNECTOR_DisplayPort
12581283
? DRM_MODE_CONNECTOR_DisplayPort : DRM_MODE_CONNECTOR_eDP;
12591284

1285+
if (pdata->bridge.type == DRM_MODE_CONNECTOR_DisplayPort)
1286+
pdata->bridge.ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT;
1287+
12601288
drm_bridge_add(&pdata->bridge);
12611289

12621290
ret = ti_sn_attach_host(pdata);

0 commit comments

Comments
 (0)