Skip to content

Commit 77ed2f4

Browse files
marcangregkh
authored andcommitted
usb: typec: tipd: Use read_power_status function in probe
We need the initial power status to be able to reliably detect connector changes once we introduce de-bouncing for CD321x next. read_power_status takes care of this and also forwards the status to the trace subsystem so let's use that instead of open-coding it inside probe. Signed-off-by: Hector Martin <marcan@marcan.st> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Neal Gompa <neal@gompa.dev> Signed-off-by: Sven Peter <sven@kernel.org> Link: https://lore.kernel.org/r/20250914-apple-usb3-tipd-v1-9-4e99c8649024@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 36c791c commit 77ed2f4

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/usb/typec/tipd/core.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,11 +1549,8 @@ static int tps6598x_probe(struct i2c_client *client)
15491549
goto err_role_put;
15501550

15511551
if (status & TPS_STATUS_PLUG_PRESENT) {
1552-
ret = tps6598x_read16(tps, TPS_REG_POWER_STATUS, &tps->pwr_status);
1553-
if (ret < 0) {
1554-
dev_err(tps->dev, "failed to read power status: %d\n", ret);
1552+
if (!tps6598x_read_power_status(tps))
15551553
goto err_unregister_port;
1556-
}
15571554
ret = tps6598x_connect(tps, status);
15581555
if (ret)
15591556
dev_err(&client->dev, "failed to register partner\n");

0 commit comments

Comments
 (0)