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

usb: typec: tcpci_rt1711h: Unmask alert interrupts to fix functionality

During probe, the TCPC alert interrupts are getting masked to
avoid unwanted interrupts during chip setup: this is ok to do
but there is no unmasking happening at any later time, which
means that the chip will not raise any interrupt, essentially
making it not functional as, while internally it does perform
all of the intended functions, it won't signal anything to the
outside.

Unmask the alert interrupts to fix functionality.

Fixes: ce08eaeb6388 ("staging: typec: rt1711h typec chip driver")
Cc: stable <stable@kernel.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20250219114700.41700-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

AngeloGioacchino Del Regno and committed by
Greg Kroah-Hartman
d6b82daf 40e89ff5

+11
+11
drivers/usb/typec/tcpm/tcpci_rt1711h.c
··· 334 334 { 335 335 int ret; 336 336 struct rt1711h_chip *chip; 337 + const u16 alert_mask = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_DISCARDED | 338 + TCPC_ALERT_TX_FAILED | TCPC_ALERT_RX_HARD_RST | 339 + TCPC_ALERT_RX_STATUS | TCPC_ALERT_POWER_STATUS | 340 + TCPC_ALERT_CC_STATUS | TCPC_ALERT_RX_BUF_OVF | 341 + TCPC_ALERT_FAULT; 337 342 338 343 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 339 344 if (!chip) ··· 387 382 dev_name(chip->dev), chip); 388 383 if (ret < 0) 389 384 return ret; 385 + 386 + /* Enable alert interrupts */ 387 + ret = rt1711h_write16(chip, TCPC_ALERT_MASK, alert_mask); 388 + if (ret < 0) 389 + return ret; 390 + 390 391 enable_irq_wake(client->irq); 391 392 392 393 return 0;