Commit 04041fd7 authored by Hector Martin's avatar Hector Martin Committed by Greg Kroah-Hartman
Browse files

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: default avatarHector Martin <marcan@marcan.st>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: default avatarNeal Gompa <neal@gompa.dev>
Signed-off-by: default avatarSven Peter <sven@kernel.org>
Link: https://lore.kernel.org/r/20250914-apple-usb3-tipd-v1-10-4e99c8649024@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 77ed2f45
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -176,6 +176,7 @@ struct tps6598x {

	int wakeup;
	u32 status; /* status reg */
	u32 data_status;
	u16 pwr_status;
	struct delayed_work	wq_poll;

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

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