Skip to content

Commit 36c791c

Browse files
marcangregkh
authored andcommitted
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: Hector Martin <marcan@marcan.st> 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-8-4e99c8649024@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7b1d318 commit 36c791c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/usb/typec/tipd/core.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,16 @@ static irqreturn_t cd321x_interrupt(int irq, void *data)
635635
if (!tps6598x_read_status(tps, &status))
636636
goto err_unlock;
637637

638-
if (event & APPLE_CD_REG_INT_POWER_STATUS_UPDATE)
638+
if (event & APPLE_CD_REG_INT_POWER_STATUS_UPDATE) {
639639
if (!tps6598x_read_power_status(tps))
640640
goto err_unlock;
641+
if (TPS_POWER_STATUS_PWROPMODE(tps->pwr_status) == TYPEC_PWR_MODE_PD) {
642+
if (tps6598x_read_partner_identity(tps)) {
643+
dev_err(tps->dev, "failed to read partner identity\n");
644+
tps->partner_identity = (struct usb_pd_identity) {0};
645+
}
646+
}
647+
}
641648

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

0 commit comments

Comments
 (0)