Skip to content

Commit 3592191

Browse files
committed
phy: qcom: qmp-combo: switch to DRM_AUX_BRIDGE
Switch to using the new DRM_AUX_BRIDGE helper to create the transparent DRM bridge device instead of handcoding corresponding functionality. Acked-by: Vinod Koul <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2a04739 commit 3592191

File tree

2 files changed

+3
-43
lines changed

2 files changed

+3
-43
lines changed

drivers/phy/qualcomm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ config PHY_QCOM_QMP_COMBO
6363
depends on DRM || DRM=n
6464
select GENERIC_PHY
6565
select MFD_SYSCON
66-
select DRM_PANEL_BRIDGE if DRM
66+
select DRM_AUX_BRIDGE if DRM_BRIDGE
6767
help
6868
Enable this to support the QMP Combo PHY transceiver that is used
6969
with USB3 and DisplayPort controllers on Qualcomm chips.

drivers/phy/qualcomm/phy-qcom-qmp-combo.c

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <linux/usb/typec.h>
2222
#include <linux/usb/typec_mux.h>
2323

24-
#include <drm/drm_bridge.h>
24+
#include <drm/bridge/aux-bridge.h>
2525

2626
#include <dt-bindings/phy/phy-qcom-qmp.h>
2727

@@ -1419,8 +1419,6 @@ struct qmp_combo {
14191419
struct clk_hw dp_link_hw;
14201420
struct clk_hw dp_pixel_hw;
14211421

1422-
struct drm_bridge bridge;
1423-
14241422
struct typec_switch_dev *sw;
14251423
enum typec_orientation orientation;
14261424
};
@@ -3191,44 +3189,6 @@ static int qmp_combo_typec_switch_register(struct qmp_combo *qmp)
31913189
}
31923190
#endif
31933191

3194-
#if IS_ENABLED(CONFIG_DRM)
3195-
static int qmp_combo_bridge_attach(struct drm_bridge *bridge,
3196-
enum drm_bridge_attach_flags flags)
3197-
{
3198-
struct qmp_combo *qmp = container_of(bridge, struct qmp_combo, bridge);
3199-
struct drm_bridge *next_bridge;
3200-
3201-
if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
3202-
return -EINVAL;
3203-
3204-
next_bridge = devm_drm_of_get_bridge(qmp->dev, qmp->dev->of_node, 0, 0);
3205-
if (IS_ERR(next_bridge)) {
3206-
dev_err(qmp->dev, "failed to acquire drm_bridge: %pe\n", next_bridge);
3207-
return PTR_ERR(next_bridge);
3208-
}
3209-
3210-
return drm_bridge_attach(bridge->encoder, next_bridge, bridge,
3211-
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
3212-
}
3213-
3214-
static const struct drm_bridge_funcs qmp_combo_bridge_funcs = {
3215-
.attach = qmp_combo_bridge_attach,
3216-
};
3217-
3218-
static int qmp_combo_dp_register_bridge(struct qmp_combo *qmp)
3219-
{
3220-
qmp->bridge.funcs = &qmp_combo_bridge_funcs;
3221-
qmp->bridge.of_node = qmp->dev->of_node;
3222-
3223-
return devm_drm_bridge_add(qmp->dev, &qmp->bridge);
3224-
}
3225-
#else
3226-
static int qmp_combo_dp_register_bridge(struct qmp_combo *qmp)
3227-
{
3228-
return 0;
3229-
}
3230-
#endif
3231-
32323192
static int qmp_combo_parse_dt_lecacy_dp(struct qmp_combo *qmp, struct device_node *np)
32333193
{
32343194
struct device *dev = qmp->dev;
@@ -3440,7 +3400,7 @@ static int qmp_combo_probe(struct platform_device *pdev)
34403400
if (ret)
34413401
return ret;
34423402

3443-
ret = qmp_combo_dp_register_bridge(qmp);
3403+
ret = drm_aux_bridge_register(dev);
34443404
if (ret)
34453405
return ret;
34463406

0 commit comments

Comments
 (0)