hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/include/uapi/linux/cec.h
....@@ -144,6 +144,7 @@
144144
145145 /* cec_msg flags field */
146146 #define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)
147
+#define CEC_MSG_FL_RAW (1 << 1)
147148
148149 /* cec_msg tx/rx_status field */
149150 #define CEC_TX_STATUS_OK (1 << 0)
....@@ -316,6 +317,8 @@
316317 #define CEC_CAP_NEEDS_HPD (1 << 6)
317318 /* Hardware can monitor CEC pin transitions */
318319 #define CEC_CAP_MONITOR_PIN (1 << 7)
320
+/* CEC_ADAP_G_CONNECTOR_INFO is available */
321
+#define CEC_CAP_CONNECTOR_INFO (1 << 8)
319322
320323 /**
321324 * struct cec_caps - CEC capabilities structure.
....@@ -374,6 +377,34 @@
374377 /* CDC-Only device: supports only CDC messages */
375378 #define CEC_LOG_ADDRS_FL_CDC_ONLY (1 << 2)
376379
380
+/**
381
+ * struct cec_drm_connector_info - tells which drm connector is
382
+ * associated with the CEC adapter.
383
+ * @card_no: drm card number
384
+ * @connector_id: drm connector ID
385
+ */
386
+struct cec_drm_connector_info {
387
+ __u32 card_no;
388
+ __u32 connector_id;
389
+};
390
+
391
+#define CEC_CONNECTOR_TYPE_NO_CONNECTOR 0
392
+#define CEC_CONNECTOR_TYPE_DRM 1
393
+
394
+/**
395
+ * struct cec_connector_info - tells if and which connector is
396
+ * associated with the CEC adapter.
397
+ * @type: connector type (if any)
398
+ * @drm: drm connector info
399
+ */
400
+struct cec_connector_info {
401
+ __u32 type;
402
+ union {
403
+ struct cec_drm_connector_info drm;
404
+ __u32 raw[16];
405
+ };
406
+};
407
+
377408 /* Events */
378409
379410 /* Event that occurs when the adapter state changes */
....@@ -397,10 +428,17 @@
397428 * struct cec_event_state_change - used when the CEC adapter changes state.
398429 * @phys_addr: the current physical address
399430 * @log_addr_mask: the current logical address mask
431
+ * @have_conn_info: if non-zero, then HDMI connector information is available.
432
+ * This field is only valid if CEC_CAP_CONNECTOR_INFO is set. If that
433
+ * capability is set and @have_conn_info is zero, then that indicates
434
+ * that the HDMI connector device is not instantiated, either because
435
+ * the HDMI driver is still configuring the device or because the HDMI
436
+ * device was unbound.
400437 */
401438 struct cec_event_state_change {
402439 __u16 phys_addr;
403440 __u16 log_addr_mask;
441
+ __u16 have_conn_info;
404442 };
405443
406444 /**
....@@ -474,6 +512,15 @@
474512 */
475513 #define CEC_G_MODE _IOR('a', 8, __u32)
476514 #define CEC_S_MODE _IOW('a', 9, __u32)
515
+
516
+/* Get the connector info */
517
+#define CEC_ADAP_G_CONNECTOR_INFO _IOR('a', 10, struct cec_connector_info)
518
+
519
+/* set cec into standby mode */
520
+#define CEC_STANDBY _IOW('a', 10, __u8)
521
+
522
+/* set cec wake up function enable */
523
+#define CEC_FUNC_EN _IOW('a', 11, int)
477524
478525 /*
479526 * The remainder of this header defines all CEC messages and operands.
....@@ -819,6 +866,95 @@
819866 #define CEC_OP_MENU_STATE_DEACTIVATED 0x01
820867
821868 #define CEC_MSG_USER_CONTROL_PRESSED 0x44
869
+/* UI Command Operand (ui_cmd) */
870
+#define CEC_OP_UI_CMD_SELECT 0x00
871
+#define CEC_OP_UI_CMD_UP 0x01
872
+#define CEC_OP_UI_CMD_DOWN 0x02
873
+#define CEC_OP_UI_CMD_LEFT 0x03
874
+#define CEC_OP_UI_CMD_RIGHT 0x04
875
+#define CEC_OP_UI_CMD_RIGHT_UP 0x05
876
+#define CEC_OP_UI_CMD_RIGHT_DOWN 0x06
877
+#define CEC_OP_UI_CMD_LEFT_UP 0x07
878
+#define CEC_OP_UI_CMD_LEFT_DOWN 0x08
879
+#define CEC_OP_UI_CMD_DEVICE_ROOT_MENU 0x09
880
+#define CEC_OP_UI_CMD_DEVICE_SETUP_MENU 0x0a
881
+#define CEC_OP_UI_CMD_CONTENTS_MENU 0x0b
882
+#define CEC_OP_UI_CMD_FAVORITE_MENU 0x0c
883
+#define CEC_OP_UI_CMD_BACK 0x0d
884
+#define CEC_OP_UI_CMD_MEDIA_TOP_MENU 0x10
885
+#define CEC_OP_UI_CMD_MEDIA_CONTEXT_SENSITIVE_MENU 0x11
886
+#define CEC_OP_UI_CMD_NUMBER_ENTRY_MODE 0x1d
887
+#define CEC_OP_UI_CMD_NUMBER_11 0x1e
888
+#define CEC_OP_UI_CMD_NUMBER_12 0x1f
889
+#define CEC_OP_UI_CMD_NUMBER_0_OR_NUMBER_10 0x20
890
+#define CEC_OP_UI_CMD_NUMBER_1 0x21
891
+#define CEC_OP_UI_CMD_NUMBER_2 0x22
892
+#define CEC_OP_UI_CMD_NUMBER_3 0x23
893
+#define CEC_OP_UI_CMD_NUMBER_4 0x24
894
+#define CEC_OP_UI_CMD_NUMBER_5 0x25
895
+#define CEC_OP_UI_CMD_NUMBER_6 0x26
896
+#define CEC_OP_UI_CMD_NUMBER_7 0x27
897
+#define CEC_OP_UI_CMD_NUMBER_8 0x28
898
+#define CEC_OP_UI_CMD_NUMBER_9 0x29
899
+#define CEC_OP_UI_CMD_DOT 0x2a
900
+#define CEC_OP_UI_CMD_ENTER 0x2b
901
+#define CEC_OP_UI_CMD_CLEAR 0x2c
902
+#define CEC_OP_UI_CMD_NEXT_FAVORITE 0x2f
903
+#define CEC_OP_UI_CMD_CHANNEL_UP 0x30
904
+#define CEC_OP_UI_CMD_CHANNEL_DOWN 0x31
905
+#define CEC_OP_UI_CMD_PREVIOUS_CHANNEL 0x32
906
+#define CEC_OP_UI_CMD_SOUND_SELECT 0x33
907
+#define CEC_OP_UI_CMD_INPUT_SELECT 0x34
908
+#define CEC_OP_UI_CMD_DISPLAY_INFORMATION 0x35
909
+#define CEC_OP_UI_CMD_HELP 0x36
910
+#define CEC_OP_UI_CMD_PAGE_UP 0x37
911
+#define CEC_OP_UI_CMD_PAGE_DOWN 0x38
912
+#define CEC_OP_UI_CMD_POWER 0x40
913
+#define CEC_OP_UI_CMD_VOLUME_UP 0x41
914
+#define CEC_OP_UI_CMD_VOLUME_DOWN 0x42
915
+#define CEC_OP_UI_CMD_MUTE 0x43
916
+#define CEC_OP_UI_CMD_PLAY 0x44
917
+#define CEC_OP_UI_CMD_STOP 0x45
918
+#define CEC_OP_UI_CMD_PAUSE 0x46
919
+#define CEC_OP_UI_CMD_RECORD 0x47
920
+#define CEC_OP_UI_CMD_REWIND 0x48
921
+#define CEC_OP_UI_CMD_FAST_FORWARD 0x49
922
+#define CEC_OP_UI_CMD_EJECT 0x4a
923
+#define CEC_OP_UI_CMD_SKIP_FORWARD 0x4b
924
+#define CEC_OP_UI_CMD_SKIP_BACKWARD 0x4c
925
+#define CEC_OP_UI_CMD_STOP_RECORD 0x4d
926
+#define CEC_OP_UI_CMD_PAUSE_RECORD 0x4e
927
+#define CEC_OP_UI_CMD_ANGLE 0x50
928
+#define CEC_OP_UI_CMD_SUB_PICTURE 0x51
929
+#define CEC_OP_UI_CMD_VIDEO_ON_DEMAND 0x52
930
+#define CEC_OP_UI_CMD_ELECTRONIC_PROGRAM_GUIDE 0x53
931
+#define CEC_OP_UI_CMD_TIMER_PROGRAMMING 0x54
932
+#define CEC_OP_UI_CMD_INITIAL_CONFIGURATION 0x55
933
+#define CEC_OP_UI_CMD_SELECT_BROADCAST_TYPE 0x56
934
+#define CEC_OP_UI_CMD_SELECT_SOUND_PRESENTATION 0x57
935
+#define CEC_OP_UI_CMD_AUDIO_DESCRIPTION 0x58
936
+#define CEC_OP_UI_CMD_INTERNET 0x59
937
+#define CEC_OP_UI_CMD_3D_MODE 0x5a
938
+#define CEC_OP_UI_CMD_PLAY_FUNCTION 0x60
939
+#define CEC_OP_UI_CMD_PAUSE_PLAY_FUNCTION 0x61
940
+#define CEC_OP_UI_CMD_RECORD_FUNCTION 0x62
941
+#define CEC_OP_UI_CMD_PAUSE_RECORD_FUNCTION 0x63
942
+#define CEC_OP_UI_CMD_STOP_FUNCTION 0x64
943
+#define CEC_OP_UI_CMD_MUTE_FUNCTION 0x65
944
+#define CEC_OP_UI_CMD_RESTORE_VOLUME_FUNCTION 0x66
945
+#define CEC_OP_UI_CMD_TUNE_FUNCTION 0x67
946
+#define CEC_OP_UI_CMD_SELECT_MEDIA_FUNCTION 0x68
947
+#define CEC_OP_UI_CMD_SELECT_AV_INPUT_FUNCTION 0x69
948
+#define CEC_OP_UI_CMD_SELECT_AUDIO_INPUT_FUNCTION 0x6a
949
+#define CEC_OP_UI_CMD_POWER_TOGGLE_FUNCTION 0x6b
950
+#define CEC_OP_UI_CMD_POWER_OFF_FUNCTION 0x6c
951
+#define CEC_OP_UI_CMD_POWER_ON_FUNCTION 0x6d
952
+#define CEC_OP_UI_CMD_F1_BLUE 0x71
953
+#define CEC_OP_UI_CMD_F2_RED 0x72
954
+#define CEC_OP_UI_CMD_F3_GREEN 0x73
955
+#define CEC_OP_UI_CMD_F4_YELLOW 0x74
956
+#define CEC_OP_UI_CMD_F5 0x75
957
+#define CEC_OP_UI_CMD_DATA 0x76
822958 /* UI Broadcast Type Operand (ui_bcast_type) */
823959 #define CEC_OP_UI_BCAST_TYPE_TOGGLE_ALL 0x00
824960 #define CEC_OP_UI_BCAST_TYPE_TOGGLE_DIG_ANA 0x01