@@ -804,6 +804,8 @@ enum ec_feature_code {
804
804
EC_FEATURE_MOTION_SENSE_FIFO = 24 ,
805
805
/* EC has RTC feature that can be controlled by host commands */
806
806
EC_FEATURE_RTC = 27 ,
807
+ /* EC supports CEC commands */
808
+ EC_FEATURE_CEC = 35 ,
807
809
};
808
810
809
811
#define EC_FEATURE_MASK_0 (event_code ) (1UL << (event_code % 32))
@@ -2078,6 +2080,12 @@ enum ec_mkbp_event {
2078
2080
/* EC sent a sysrq command */
2079
2081
EC_MKBP_EVENT_SYSRQ = 6 ,
2080
2082
2083
+ /* Notify the AP that something happened on CEC */
2084
+ EC_MKBP_EVENT_CEC_EVENT = 8 ,
2085
+
2086
+ /* Send an incoming CEC message to the AP */
2087
+ EC_MKBP_EVENT_CEC_MESSAGE = 9 ,
2088
+
2081
2089
/* Number of MKBP events */
2082
2090
EC_MKBP_EVENT_COUNT ,
2083
2091
};
@@ -2845,6 +2853,79 @@ struct ec_params_reboot_ec {
2845
2853
#define EC_ACPI_MEM_VERSION_CURRENT 1
2846
2854
2847
2855
2856
+ /*****************************************************************************/
2857
+ /*
2858
+ * HDMI CEC commands
2859
+ *
2860
+ * These commands are for sending and receiving message via HDMI CEC
2861
+ */
2862
+ #define EC_MAX_CEC_MSG_LEN 16
2863
+
2864
+ /* CEC message from the AP to be written on the CEC bus */
2865
+ #define EC_CMD_CEC_WRITE_MSG 0x00B8
2866
+
2867
+ /**
2868
+ * struct ec_params_cec_write - Message to write to the CEC bus
2869
+ * @msg: message content to write to the CEC bus
2870
+ */
2871
+ struct ec_params_cec_write {
2872
+ uint8_t msg [EC_MAX_CEC_MSG_LEN ];
2873
+ } __packed ;
2874
+
2875
+ /* Set various CEC parameters */
2876
+ #define EC_CMD_CEC_SET 0x00BA
2877
+
2878
+ /**
2879
+ * struct ec_params_cec_set - CEC parameters set
2880
+ * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS
2881
+ * @val: in case cmd is CEC_CMD_ENABLE, this field can be 0 to disable CEC
2882
+ * or 1 to enable CEC functionality, in case cmd is CEC_CMD_LOGICAL_ADDRESS,
2883
+ * this field encodes the requested logical address between 0 and 15
2884
+ * or 0xff to unregister
2885
+ */
2886
+ struct ec_params_cec_set {
2887
+ uint8_t cmd ; /* enum cec_command */
2888
+ uint8_t val ;
2889
+ } __packed ;
2890
+
2891
+ /* Read various CEC parameters */
2892
+ #define EC_CMD_CEC_GET 0x00BB
2893
+
2894
+ /**
2895
+ * struct ec_params_cec_get - CEC parameters get
2896
+ * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS
2897
+ */
2898
+ struct ec_params_cec_get {
2899
+ uint8_t cmd ; /* enum cec_command */
2900
+ } __packed ;
2901
+
2902
+ /**
2903
+ * struct ec_response_cec_get - CEC parameters get response
2904
+ * @val: in case cmd was CEC_CMD_ENABLE, this field will 0 if CEC is
2905
+ * disabled or 1 if CEC functionality is enabled,
2906
+ * in case cmd was CEC_CMD_LOGICAL_ADDRESS, this will encode the
2907
+ * configured logical address between 0 and 15 or 0xff if unregistered
2908
+ */
2909
+ struct ec_response_cec_get {
2910
+ uint8_t val ;
2911
+ } __packed ;
2912
+
2913
+ /* CEC parameters command */
2914
+ enum ec_cec_command {
2915
+ /* CEC reading, writing and events enable */
2916
+ CEC_CMD_ENABLE ,
2917
+ /* CEC logical address */
2918
+ CEC_CMD_LOGICAL_ADDRESS ,
2919
+ };
2920
+
2921
+ /* Events from CEC to AP */
2922
+ enum mkbp_cec_event {
2923
+ /* Outgoing message was acknowledged by a follower */
2924
+ EC_MKBP_CEC_SEND_OK = BIT (0 ),
2925
+ /* Outgoing message was not acknowledged */
2926
+ EC_MKBP_CEC_SEND_FAILED = BIT (1 ),
2927
+ };
2928
+
2848
2929
/*****************************************************************************/
2849
2930
/*
2850
2931
* Special commands
0 commit comments