Skip to content

Commit 9e7968c

Browse files
jhovoldgregkh
authored andcommitted
usb: typec: ps883x: fix missing accessibility check
Make sure that the retimer is accessible before registering to avoid having later consumer calls fail to configure it, something which, for example, can lead to a hotplugged display not being recognised: [drm:msm_dp_panel_read_sink_caps [msm]] *ERROR* read dpcd failed -110 Fixes: 257a087 ("usb: typec: Add support for Parade PS8830 Type-C Retimer") Cc: Abel Vesa <abel.vesa@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20250218152933.22992-3-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9f9de3e commit 9e7968c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/usb/typec/mux/ps883x.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ static int ps883x_retimer_probe(struct i2c_client *client)
291291
struct typec_switch_desc sw_desc = { };
292292
struct typec_retimer_desc rtmr_desc = { };
293293
struct ps883x_retimer *retimer;
294+
unsigned int val;
294295
int ret;
295296

296297
retimer = devm_kzalloc(dev, sizeof(*retimer), GFP_KERNEL);
@@ -360,6 +361,16 @@ static int ps883x_retimer_probe(struct i2c_client *client)
360361

361362
/* firmware initialization delay */
362363
msleep(60);
364+
365+
/* make sure device is accessible */
366+
ret = regmap_read(retimer->regmap, REG_USB_PORT_CONN_STATUS_0,
367+
&val);
368+
if (ret) {
369+
dev_err(dev, "failed to read conn_status_0: %d\n", ret);
370+
if (ret == -ENXIO)
371+
ret = -EIO;
372+
goto err_clk_disable;
373+
}
363374
}
364375

365376
sw_desc.drvdata = retimer;

0 commit comments

Comments
 (0)