The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] usb: typec: ucsi: ccg: Log firmware version and hardware info at probe
@ 2026-06-30 13:01 Loic Poulain
  2026-07-03 12:36 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Loic Poulain @ 2026-06-30 13:01 UTC (permalink / raw)
  To: heikki.krogerus, gregkh
  Cc: linux-usb, linux-kernel, rdunlap, johan, akpm, andriy.shevchenko,
	pooja.katiyar, Loic Poulain

The CCG firmware version and silicon ID are read during probe but never
logged, making it difficult to identify the hardware and the firmware
running on the device.

Add dev_info messages to display the firmware version and silicon ID:

  ucsi_ccg 2-0008: CCG FW version: 3.9.0 build 0x0000
  ucsi_ccg 2-0008: CCG silicon_id:0x1234 mode:1

Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
---
 drivers/usb/typec/ucsi/ucsi_ccg.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 4463c1ae96bd..2715bb7b53aa 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -738,11 +738,21 @@ static int get_fw_info(struct ucsi_ccg *uc)
 	uc->fw_version = CCG_VERSION(uc->version[FW2].app.ver) |
 			CCG_VERSION_PATCH(uc->version[FW2].app.patch);
 
+	dev_info(uc->dev, "CCG FW version: %d.%d.%d build 0x%04x\n",
+		 (uc->version[FW2].app.ver & CCG_VERSION_MAJ_MASK) >> CCG_VERSION_MAJ_SHIFT,
+		 (uc->version[FW2].app.ver & CCG_VERSION_MIN_MASK) >> CCG_VERSION_MIN_SHIFT,
+		 uc->version[FW2].app.patch,
+		 le16_to_cpu(uc->version[FW2].app.build));
+
 	err = ccg_read(uc, CCGX_RAB_DEVICE_MODE, (u8 *)(&uc->info),
 		       sizeof(uc->info));
 	if (err < 0)
 		return err;
 
+	dev_info(uc->dev, "CCG silicon_id:0x%04x mode:%u\n",
+		 le16_to_cpu(uc->info.silicon_id),
+		 (uc->info.mode & CCG_DEVINFO_FWMODE_MASK) >> CCG_DEVINFO_FWMODE_SHIFT);
+
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-03 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 13:01 [PATCH] usb: typec: ucsi: ccg: Log firmware version and hardware info at probe Loic Poulain
2026-07-03 12:36 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox