aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/cros_ec_commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mfd/cros_ec_commands.h')
-rw-r--r--include/linux/mfd/cros_ec_commands.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index 2b16e95b9bb8..2b96e630e3b6 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -291,6 +291,9 @@ enum host_event_code {
291 /* EC desires to change state of host-controlled USB mux */ 291 /* EC desires to change state of host-controlled USB mux */
292 EC_HOST_EVENT_USB_MUX = 28, 292 EC_HOST_EVENT_USB_MUX = 28,
293 293
294 /* EC RTC event occurred */
295 EC_HOST_EVENT_RTC = 26,
296
294 /* 297 /*
295 * The high bit of the event mask is not used as a host event code. If 298 * The high bit of the event mask is not used as a host event code. If
296 * it reads back as set, then the entire event mask should be 299 * it reads back as set, then the entire event mask should be
@@ -799,6 +802,8 @@ enum ec_feature_code {
799 EC_FEATURE_USB_MUX = 23, 802 EC_FEATURE_USB_MUX = 23,
800 /* Motion Sensor code has an internal software FIFO */ 803 /* Motion Sensor code has an internal software FIFO */
801 EC_FEATURE_MOTION_SENSE_FIFO = 24, 804 EC_FEATURE_MOTION_SENSE_FIFO = 24,
805 /* EC has RTC feature that can be controlled by host commands */
806 EC_FEATURE_RTC = 27,
802}; 807};
803 808
804#define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32)) 809#define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))
@@ -1709,6 +1714,9 @@ struct ec_response_rtc {
1709#define EC_CMD_RTC_SET_VALUE 0x46 1714#define EC_CMD_RTC_SET_VALUE 0x46
1710#define EC_CMD_RTC_SET_ALARM 0x47 1715#define EC_CMD_RTC_SET_ALARM 0x47
1711 1716
1717/* Pass as param to SET_ALARM to clear the current alarm */
1718#define EC_RTC_ALARM_CLEAR 0
1719
1712/*****************************************************************************/ 1720/*****************************************************************************/
1713/* Port80 log access */ 1721/* Port80 log access */
1714 1722
@@ -2904,16 +2912,33 @@ enum usb_pd_control_mux {
2904 USB_PD_CTRL_MUX_AUTO = 5, 2912 USB_PD_CTRL_MUX_AUTO = 5,
2905}; 2913};
2906 2914
2915enum usb_pd_control_swap {
2916 USB_PD_CTRL_SWAP_NONE = 0,
2917 USB_PD_CTRL_SWAP_DATA = 1,
2918 USB_PD_CTRL_SWAP_POWER = 2,
2919 USB_PD_CTRL_SWAP_VCONN = 3,
2920 USB_PD_CTRL_SWAP_COUNT
2921};
2922
2907struct ec_params_usb_pd_control { 2923struct ec_params_usb_pd_control {
2908 uint8_t port; 2924 uint8_t port;
2909 uint8_t role; 2925 uint8_t role;
2910 uint8_t mux; 2926 uint8_t mux;
2927 uint8_t swap;
2911} __packed; 2928} __packed;
2912 2929
2913#define PD_CTRL_RESP_ENABLED_COMMS (1 << 0) /* Communication enabled */ 2930#define PD_CTRL_RESP_ENABLED_COMMS (1 << 0) /* Communication enabled */
2914#define PD_CTRL_RESP_ENABLED_CONNECTED (1 << 1) /* Device connected */ 2931#define PD_CTRL_RESP_ENABLED_CONNECTED (1 << 1) /* Device connected */
2915#define PD_CTRL_RESP_ENABLED_PD_CAPABLE (1 << 2) /* Partner is PD capable */ 2932#define PD_CTRL_RESP_ENABLED_PD_CAPABLE (1 << 2) /* Partner is PD capable */
2916 2933
2934#define PD_CTRL_RESP_ROLE_POWER BIT(0) /* 0=SNK/1=SRC */
2935#define PD_CTRL_RESP_ROLE_DATA BIT(1) /* 0=UFP/1=DFP */
2936#define PD_CTRL_RESP_ROLE_VCONN BIT(2) /* Vconn status */
2937#define PD_CTRL_RESP_ROLE_DR_POWER BIT(3) /* Partner is dualrole power */
2938#define PD_CTRL_RESP_ROLE_DR_DATA BIT(4) /* Partner is dualrole data */
2939#define PD_CTRL_RESP_ROLE_USB_COMM BIT(5) /* Partner USB comm capable */
2940#define PD_CTRL_RESP_ROLE_EXT_POWERED BIT(6) /* Partner externally powerd */
2941
2917struct ec_response_usb_pd_control_v1 { 2942struct ec_response_usb_pd_control_v1 {
2918 uint8_t enabled; 2943 uint8_t enabled;
2919 uint8_t role; 2944 uint8_t role;