Commit 36c791c1 authored by Hector Martin's avatar Hector Martin Committed by Greg Kroah-Hartman
Browse files

usb: typec: tipd: Update partner identity when power status was updated



Whenever the power status is changed make sure to also update the
partner identity to be able to detect changes once de-bouncing and mode
changes are added for CD321x.

Signed-off-by: default avatarHector Martin <marcan@marcan.st>
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-8-4e99c8649024@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7b1d3185
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -635,9 +635,16 @@ static irqreturn_t cd321x_interrupt(int irq, void *data)
	if (!tps6598x_read_status(tps, &status))
		goto err_unlock;

	if (event & APPLE_CD_REG_INT_POWER_STATUS_UPDATE)
	if (event & APPLE_CD_REG_INT_POWER_STATUS_UPDATE) {
		if (!tps6598x_read_power_status(tps))
			goto err_unlock;
		if (TPS_POWER_STATUS_PWROPMODE(tps->pwr_status) == TYPEC_PWR_MODE_PD) {
			if (tps6598x_read_partner_identity(tps)) {
				dev_err(tps->dev, "failed to read partner identity\n");
				tps->partner_identity = (struct usb_pd_identity) {0};
			}
		}
	}

	if (event & APPLE_CD_REG_INT_DATA_STATUS_UPDATE)
		if (!tps->data->read_data_status(tps))