From 46b56a6e1a2ea2e8c1498c22d563b7991c4eadbb Mon Sep 17 00:00:00 2001 From: Diogo Ivo Date: Fri, 4 Oct 2024 14:35:47 +0100 Subject: [PATCH] debug 6.10 --- drivers/usb/typec/ucsi/ucsi.c | 4 +++- drivers/usb/typec/ucsi/ucsi_acpi.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 2cc7aedd490f..9575086742a0 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -1272,8 +1272,10 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num) return; } - if (!test_and_set_bit(EVENT_PENDING, &ucsi->flags)) + if (!test_and_set_bit(EVENT_PENDING, &ucsi->flags)) { + printk("scheduling connector change\n"); schedule_work(&con->work); + } } EXPORT_SYMBOL_GPL(ucsi_connector_change); diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c index adf32ca0f761..ddcf7216a238 100644 --- a/drivers/usb/typec/ucsi/ucsi_acpi.c +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c @@ -58,6 +58,13 @@ static int ucsi_acpi_read(struct ucsi *ucsi, unsigned int offset, memcpy(val, ua->base + offset, val_len); + switch (offset) { + case UCSI_MESSAGE_IN: + uint64_t *msg_in = (uint64_t *)val; + printk("MESSAGE_IN: %llx %llx\n", msg_in[0], msg_in[1]); + break; + } + return 0; } @@ -69,6 +76,12 @@ static int ucsi_acpi_async_write(struct ucsi *ucsi, unsigned int offset, memcpy(ua->base + offset, val, val_len); ua->cmd = *(u64 *)val; + switch (offset) { + case UCSI_CONTROL: + printk("COMMAND: %llx\n", ua->cmd); + break; + } + return ucsi_acpi_dsm(ua, UCSI_DSM_FUNC_WRITE); } @@ -210,6 +223,8 @@ static void ucsi_acpi_notify(acpi_handle handle, u32 event, void *data) if (ret) return; + printk("%s: CCI: %x\n", __func__, cci); + if (UCSI_CCI_CONNECTOR(cci)) ucsi_connector_change(ua->ucsi, UCSI_CCI_CONNECTOR(cci)); -- 2.46.2