Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Hector Martin and committed by
Greg Kroah-Hartman
04041fd7 77ed2f45

+4
+4
drivers/usb/typec/tipd/core.c
··· 176 176 177 177 int wakeup; 178 178 u32 status; /* status reg */ 179 + u32 data_status; 179 180 u16 pwr_status; 180 181 struct delayed_work wq_poll; 181 182 ··· 539 538 dev_err(tps->dev, "failed to read data status: %d\n", ret); 540 539 return false; 541 540 } 541 + tps->data_status = data_status; 542 542 543 543 if (tps->data->trace_data_status) 544 544 tps->data->trace_data_status(data_status); ··· 1552 1550 1553 1551 if (status & TPS_STATUS_PLUG_PRESENT) { 1554 1552 if (!tps6598x_read_power_status(tps)) 1553 + goto err_unregister_port; 1554 + if (!tps->data->read_data_status(tps)) 1555 1555 goto err_unregister_port; 1556 1556 ret = tps6598x_connect(tps, status); 1557 1557 if (ret)