usb: typec: ucsi: Add the UCSI commands in debugfs
authorMadhu M <madhu.m@intel.com>
Wed, 2 Apr 2025 07:08:17 +0000 (12:38 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2025 14:08:31 +0000 (16:08 +0200)
Added the UCSI commands UCSI_GET_CAM_SUPPORTED, UCSI_GET_PD_MESSAGE,
UCSI_GET_ATTENTION_VDO and UCSI_SET_USB 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/20250402070817.1016635-1-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 eae2b18a2d8ae45e3d1e3440ec0ac3e2fc6f27fe..92ebf1a2defd20c51fcc5c75035d72808ac6bbc1 100644 (file)
@@ -34,16 +34,20 @@ static int ucsi_cmd(void *data, u64 val)
        case UCSI_CONNECTOR_RESET:
        case UCSI_SET_SINK_PATH:
        case UCSI_SET_NEW_CAM:
+       case UCSI_SET_USB:
                ret = ucsi_send_command(ucsi, val, NULL, 0);
                break;
        case UCSI_GET_CAPABILITY:
        case UCSI_GET_CONNECTOR_CAPABILITY:
        case UCSI_GET_ALTERNATE_MODES:
+       case UCSI_GET_CAM_SUPPORTED:
        case UCSI_GET_CURRENT_CAM:
        case UCSI_GET_PDOS:
        case UCSI_GET_CABLE_PROPERTY:
        case UCSI_GET_CONNECTOR_STATUS:
        case UCSI_GET_ERROR_STATUS:
+       case UCSI_GET_PD_MESSAGE:
+       case UCSI_GET_ATTENTION_VDO:
        case UCSI_GET_CAM_CS:
        case UCSI_GET_LPM_PPM_INFO:
                ret = ucsi_send_command(ucsi, val,
index 3a2c1762bec1bfbc556e3a062f57a5469f62400b..72b9d5a429613de37ebb90d34fb19f1dc0e0e22d 100644 (file)
@@ -123,9 +123,11 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num);
 #define UCSI_GET_CONNECTOR_STATUS              0x12
 #define UCSI_GET_CONNECTOR_STATUS_SIZE         152
 #define UCSI_GET_ERROR_STATUS                  0x13
+#define UCSI_GET_ATTENTION_VDO                 0x16
 #define UCSI_GET_PD_MESSAGE                    0x15
 #define UCSI_GET_CAM_CS                        0x18
 #define UCSI_SET_SINK_PATH                     0x1c
+#define UCSI_SET_USB                           0x21
 #define UCSI_GET_LPM_PPM_INFO                  0x22
 
 #define UCSI_CONNECTOR_NUMBER(_num_)           ((u64)(_num_) << 16)