Skip to contentSkip to conversation

usb: typec: ucsi: Rename SET_UOM UCSI command to SET_CCOM

PATCH New [email protected] 1 participant 2 messages Jan 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 usb: typec: ucsi: Rename SET_UOM UCSI command to SET_CCOM

From: Madhu M <[email protected]>

Rename the SET_UOM UCSI command to SET_CCOM as per the UCSI 3.0 spec.

---
 drivers/usb/typec/ucsi/debugfs.c | 2 +-
 drivers/usb/typec/ucsi/trace.c   | 2 +-
 drivers/usb/typec/ucsi/ucsi.h    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/usb/typec/ucsi/debugfs.c +1 -1
index 83ff23086d79..638ac41b4b01 100644
@@ -28,7 +28,7 @@ static int ucsi_cmd(void *data, u64 val)
 	ucsi->debugfs->status = 0;
 
 	switch (UCSI_COMMAND(val)) {
-	case UCSI_SET_UOM:
+	case UCSI_SET_CCOM:
 	case UCSI_SET_UOR:
 	case UCSI_SET_PDR:
 	case UCSI_CONNECTOR_RESET:
drivers/usb/typec/ucsi/trace.c +1 -1
index cb62ad835761..596a9542d401 100644
@@ -12,7 +12,7 @@ static const char * const ucsi_cmd_strs[] = {
 	[UCSI_SET_NOTIFICATION_ENABLE]	= "SET_NOTIFICATION_ENABLE",
 	[UCSI_GET_CAPABILITY]		= "GET_CAPABILITY",
 	[UCSI_GET_CONNECTOR_CAPABILITY]	= "GET_CONNECTOR_CAPABILITY",
-	[UCSI_SET_UOM]			= "SET_UOM",
+	[UCSI_SET_CCOM]			= "SET_CCOM",
 	[UCSI_SET_UOR]			= "SET_UOR",
 	[UCSI_SET_PDM]			= "SET_PDM",
 	[UCSI_SET_PDR]			= "SET_PDR",
drivers/usb/typec/ucsi/ucsi.h +1 -1
index 5ff369c24a2f..431ab4a7e8d8 100644
@@ -105,7 +105,7 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num);
 #define UCSI_GET_CAPABILITY_SIZE		128
 #define UCSI_GET_CONNECTOR_CAPABILITY		0x07
 #define UCSI_GET_CONNECTOR_CAPABILITY_SIZE	32
-#define UCSI_SET_UOM				0x08
+#define UCSI_SET_CCOM				0x08
 #define UCSI_SET_UOR				0x09
 #define UCSI_SET_PDM				0x0a
 #define UCSI_SET_PDR				0x0b
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 2/2 usb: typec: ucsi: Enable UCSI commands in debugfs

From: Madhu M <[email protected]>

Enable the UCSI commands UCSI_SET_NEW_CAM, UCSI_GET_ERROR_STATUS, UCSI_GET_CAM_CS, and UCSI_GET_LPM_PPM_INFO support in debugfs to enhance PD/TypeC debugging capability.

---
 drivers/usb/typec/ucsi/debugfs.c | 4 ++++
 drivers/usb/typec/ucsi/ucsi.h    | 2 ++
 2 files changed, 6 insertions(+)
drivers/usb/typec/ucsi/debugfs.c +4 -0
index 638ac41b4b01..eae2b18a2d8a 100644
@@ -33,6 +33,7 @@ static int ucsi_cmd(void *data, u64 val)
 	case UCSI_SET_PDR:
 	case UCSI_CONNECTOR_RESET:
 	case UCSI_SET_SINK_PATH:
+	case UCSI_SET_NEW_CAM:
 		ret = ucsi_send_command(ucsi, val, NULL, 0);
 		break;
 	case UCSI_GET_CAPABILITY:
@@ -42,6 +43,9 @@ static int ucsi_cmd(void *data, u64 val)
 	case UCSI_GET_PDOS:
 	case UCSI_GET_CABLE_PROPERTY:
 	case UCSI_GET_CONNECTOR_STATUS:
+	case UCSI_GET_ERROR_STATUS:
+	case UCSI_GET_CAM_CS:
+	case UCSI_GET_LPM_PPM_INFO:
 		ret = ucsi_send_command(ucsi, val,
 					&ucsi->debugfs->response,
 					sizeof(ucsi->debugfs->response));
drivers/usb/typec/ucsi/ucsi.h +2 -0
index 431ab4a7e8d8..9d59ad217f7d 100644
@@ -120,7 +120,9 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num);
 #define UCSI_GET_CONNECTOR_STATUS_SIZE		152
 #define UCSI_GET_ERROR_STATUS			0x13
 #define UCSI_GET_PD_MESSAGE			0x15
+#define UCSI_GET_CAM_CS			0x18
 #define UCSI_SET_SINK_PATH			0x1c
+#define UCSI_GET_LPM_PPM_INFO			0x22
 
 #define UCSI_CONNECTOR_NUMBER(_num_)		((u64)(_num_) << 16)
 #define UCSI_COMMAND(_cmd_)			((_cmd_) & 0xff)
Signature · 1 line
2.34.1