Skip to content

Commit 04041fd

Browse files
marcangregkh
authored andcommitted
usb: typec: tipd: Read data status in probe and cache its value
Just like for power status we also need to keep track of data status to be able to detect mode changes once we introduce de-bouncing for CD321x. Read it during probe and keep a cached copy of its value. 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-10-4e99c8649024@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 77ed2f4 commit 04041fd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/usb/typec/tipd/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ struct tps6598x {
176176

177177
int wakeup;
178178
u32 status; /* status reg */
179+
u32 data_status;
179180
u16 pwr_status;
180181
struct delayed_work wq_poll;
181182

@@ -538,6 +539,7 @@ static bool tps6598x_read_data_status(struct tps6598x *tps)
538539
dev_err(tps->dev, "failed to read data status: %d\n", ret);
539540
return false;
540541
}
542+
tps->data_status = data_status;
541543

542544
if (tps->data->trace_data_status)
543545
tps->data->trace_data_status(data_status);
@@ -1551,6 +1553,8 @@ static int tps6598x_probe(struct i2c_client *client)
15511553
if (status & TPS_STATUS_PLUG_PRESENT) {
15521554
if (!tps6598x_read_power_status(tps))
15531555
goto err_unregister_port;
1556+
if (!tps->data->read_data_status(tps))
1557+
goto err_unregister_port;
15541558
ret = tps6598x_connect(tps, status);
15551559
if (ret)
15561560
dev_err(&client->dev, "failed to register partner\n");

0 commit comments

Comments
 (0)