]> www.infradead.org Git - users/willy/xarray.git/commitdiff
usb: typec: ucsi: Enable UCSI commands in debugfs
authorMadhu M <madhu.m@intel.com>
Sat, 18 Jan 2025 17:24:55 +0000 (22:54 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Feb 2025 15:27:30 +0000 (16:27 +0100)
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.

Signed-off-by: Madhu M <madhu.m@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250118172455.701348-2-madhu.m@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/debugfs.c
drivers/usb/typec/ucsi/ucsi.h

index 638ac41b4b01355c64a88782abb3e3fb07b18894..eae2b18a2d8ae45e3d1e3440ec0ac3e2fc6f27fe 100644 (file)
@@ -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));
index ebfd8a953a93bb621efdda46e36f6a4bf693bd18..17061c64cfb7c6ec53081a0293f7ae91f50d9a57 100644 (file)
@@ -121,7 +121,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)