hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/media/cec.h
....@@ -17,7 +17,6 @@
1717 #include <linux/timer.h>
1818 #include <linux/cec-funcs.h>
1919 #include <media/rc-core.h>
20
-#include <media/cec-notifier.h>
2120
2221 #define CEC_CAP_DEFAULTS (CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT | \
2322 CEC_CAP_PASSTHROUGH | CEC_CAP_RC)
....@@ -53,6 +52,7 @@
5352 struct cec_adapter;
5453 struct cec_data;
5554 struct cec_pin;
55
+struct cec_notifier;
5656
5757 struct cec_data {
5858 struct list_head list;
....@@ -144,6 +144,60 @@
144144 */
145145 #define CEC_MAX_MSG_TX_QUEUE_SZ (18 * 1)
146146
147
+/**
148
+ * struct cec_adapter - cec adapter structure
149
+ * @owner: module owner
150
+ * @name: name of the CEC adapter
151
+ * @devnode: device node for the /dev/cecX device
152
+ * @lock: mutex controlling access to this structure
153
+ * @rc: remote control device
154
+ * @transmit_queue: queue of pending transmits
155
+ * @transmit_queue_sz: number of pending transmits
156
+ * @wait_queue: queue of transmits waiting for a reply
157
+ * @transmitting: CEC messages currently being transmitted
158
+ * @transmit_in_progress: true if a transmit is in progress
159
+ * @kthread_config: kthread used to configure a CEC adapter
160
+ * @config_completion: used to signal completion of the config kthread
161
+ * @kthread: main CEC processing thread
162
+ * @kthread_waitq: main CEC processing wait_queue
163
+ * @ops: cec adapter ops
164
+ * @priv: cec driver's private data
165
+ * @capabilities: cec adapter capabilities
166
+ * @available_log_addrs: maximum number of available logical addresses
167
+ * @phys_addr: the current physical address
168
+ * @needs_hpd: if true, then the HDMI HotPlug Detect pin must be high
169
+ * in order to transmit or receive CEC messages. This is usually a HW
170
+ * limitation.
171
+ * @is_configuring: the CEC adapter is configuring (i.e. claiming LAs)
172
+ * @is_configured: the CEC adapter is configured (i.e. has claimed LAs)
173
+ * @cec_pin_is_high: if true then the CEC pin is high. Only used with the
174
+ * CEC pin framework.
175
+ * @adap_controls_phys_addr: if true, then the CEC adapter controls the
176
+ * physical address, i.e. the CEC hardware can detect HPD changes and
177
+ * read the EDID and is not dependent on an external HDMI driver.
178
+ * Drivers that need this can set this field to true after the
179
+ * cec_allocate_adapter() call.
180
+ * @last_initiator: the initiator of the last transmitted message.
181
+ * @monitor_all_cnt: number of filehandles monitoring all msgs
182
+ * @monitor_pin_cnt: number of filehandles monitoring pin changes
183
+ * @follower_cnt: number of filehandles in follower mode
184
+ * @cec_follower: filehandle of the exclusive follower
185
+ * @cec_initiator: filehandle of the exclusive initiator
186
+ * @passthrough: if true, then the exclusive follower is in
187
+ * passthrough mode.
188
+ * @log_addrs: current logical addresses
189
+ * @conn_info: current connector info
190
+ * @tx_timeouts: number of transmit timeouts
191
+ * @notifier: CEC notifier
192
+ * @pin: CEC pin status struct
193
+ * @cec_dir: debugfs cec directory
194
+ * @status_file: debugfs cec status file
195
+ * @error_inj_file: debugfs cec error injection file
196
+ * @sequence: transmit sequence counter
197
+ * @input_phys: remote control input_phys name
198
+ *
199
+ * This structure represents a cec adapter.
200
+ */
147201 struct cec_adapter {
148202 struct module *owner;
149203 char name[32];
....@@ -162,7 +216,6 @@
162216
163217 struct task_struct *kthread;
164218 wait_queue_head_t kthread_waitq;
165
- wait_queue_head_t waitq;
166219
167220 const struct cec_adap_ops *ops;
168221 void *priv;
....@@ -174,6 +227,7 @@
174227 bool is_configuring;
175228 bool is_configured;
176229 bool cec_pin_is_high;
230
+ bool adap_controls_phys_addr;
177231 u8 last_initiator;
178232 u32 monitor_all_cnt;
179233 u32 monitor_pin_cnt;
....@@ -182,6 +236,7 @@
182236 struct cec_fh *cec_initiator;
183237 bool passthrough;
184238 struct cec_log_addrs log_addrs;
239
+ struct cec_connector_info conn_info;
185240
186241 u32 tx_timeouts;
187242
....@@ -193,15 +248,10 @@
193248 #endif
194249
195250 struct dentry *cec_dir;
196
- struct dentry *status_file;
197
- struct dentry *error_inj_file;
198251
199
- u16 phys_addrs[15];
200252 u32 sequence;
201253
202
- char device_name[32];
203254 char input_phys[32];
204
- char input_drv[32];
205255 };
206256
207257 static inline void *cec_get_drvdata(const struct cec_adapter *adap)
....@@ -235,6 +285,7 @@
235285 ((pa) >> 12), ((pa) >> 8) & 0xf, ((pa) >> 4) & 0xf, (pa) & 0xf
236286
237287 struct edid;
288
+struct drm_connector;
238289
239290 #if IS_REACHABLE(CONFIG_CEC_CORE)
240291 struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
....@@ -249,6 +300,8 @@
249300 bool block);
250301 void cec_s_phys_addr_from_edid(struct cec_adapter *adap,
251302 const struct edid *edid);
303
+void cec_s_conn_info(struct cec_adapter *adap,
304
+ const struct cec_connector_info *conn_info);
252305 int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg,
253306 bool block);
254307
....@@ -333,6 +386,9 @@
333386 u16 cec_get_edid_phys_addr(const u8 *edid, unsigned int size,
334387 unsigned int *offset);
335388
389
+void cec_fill_conn_info_from_drm(struct cec_connector_info *conn_info,
390
+ const struct drm_connector *connector);
391
+
336392 #else
337393
338394 static inline int cec_register_adapter(struct cec_adapter *adap,
....@@ -367,6 +423,18 @@
367423 return CEC_PHYS_ADDR_INVALID;
368424 }
369425
426
+static inline void cec_s_conn_info(struct cec_adapter *adap,
427
+ const struct cec_connector_info *conn_info)
428
+{
429
+}
430
+
431
+static inline void
432
+cec_fill_conn_info_from_drm(struct cec_connector_info *conn_info,
433
+ const struct drm_connector *connector)
434
+{
435
+ memset(conn_info, 0, sizeof(*conn_info));
436
+}
437
+
370438 #endif
371439
372440 /**