blob: 32f7c695d7b5e5fe4918c9e90ccd3cd513a7afef [file] [log] [blame]
Hans Verkuilab15d242018-02-07 09:05:46 -05001/* SPDX-License-Identifier: GPL-2.0-only */
Hans Verkuila56960e2016-06-25 09:43:58 -03002/*
3 * cec - HDMI Consumer Electronics Control support header
4 *
5 * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
Hans Verkuila56960e2016-06-25 09:43:58 -03006 */
7
8#ifndef _MEDIA_CEC_H
9#define _MEDIA_CEC_H
10
11#include <linux/poll.h>
12#include <linux/fs.h>
13#include <linux/debugfs.h>
14#include <linux/device.h>
15#include <linux/cdev.h>
16#include <linux/kthread.h>
17#include <linux/timer.h>
18#include <linux/cec-funcs.h>
19#include <media/rc-core.h>
Dariusz Marcinkiewicz32a847f2019-06-20 05:17:18 -040020
Hans Verkuilee0c5032017-08-04 06:41:51 -040021#define CEC_CAP_DEFAULTS (CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT | \
22 CEC_CAP_PASSTHROUGH | CEC_CAP_RC)
23
Hans Verkuila56960e2016-06-25 09:43:58 -030024/**
25 * struct cec_devnode - cec device node
26 * @dev: cec device
27 * @cdev: cec character device
Hans Verkuila56960e2016-06-25 09:43:58 -030028 * @minor: device node minor number
29 * @registered: the device was correctly registered
30 * @unregistered: the device was unregistered
31 * @fhs_lock: lock to control access to the filehandle list
32 * @fhs: the list of open filehandles (cec_fh)
33 *
34 * This structure represents a cec-related device node.
35 *
36 * The @parent is a physical device. It must be set by core or device drivers
37 * before registering the node.
38 */
39struct cec_devnode {
40 /* sysfs */
41 struct device dev;
42 struct cdev cdev;
Hans Verkuila56960e2016-06-25 09:43:58 -030043
44 /* device info */
45 int minor;
46 bool registered;
47 bool unregistered;
Hans Verkuila56960e2016-06-25 09:43:58 -030048 struct list_head fhs;
Hans Verkuil62148f092016-08-02 08:11:00 -030049 struct mutex lock;
Hans Verkuila56960e2016-06-25 09:43:58 -030050};
51
52struct cec_adapter;
53struct cec_data;
Hans Verkuilea5c8ef2017-07-11 03:30:42 -030054struct cec_pin;
Dariusz Marcinkiewicz32a847f2019-06-20 05:17:18 -040055struct cec_notifier;
Hans Verkuila56960e2016-06-25 09:43:58 -030056
57struct cec_data {
58 struct list_head list;
59 struct list_head xfer_list;
60 struct cec_adapter *adap;
61 struct cec_msg msg;
62 struct cec_fh *fh;
63 struct delayed_work work;
64 struct completion c;
65 u8 attempts;
Hans Verkuila56960e2016-06-25 09:43:58 -030066 bool blocking;
67 bool completed;
68};
69
70struct cec_msg_entry {
71 struct list_head list;
72 struct cec_msg msg;
73};
74
Hans Verkuil6b2bbb02017-07-11 03:30:39 -030075struct cec_event_entry {
76 struct list_head list;
77 struct cec_event ev;
78};
79
80#define CEC_NUM_CORE_EVENTS 2
Hans Verkuil4786b0d2018-06-28 07:43:46 -040081#define CEC_NUM_EVENTS CEC_EVENT_PIN_5V_HIGH
Hans Verkuila56960e2016-06-25 09:43:58 -030082
83struct cec_fh {
84 struct list_head list;
85 struct list_head xfer_list;
86 struct cec_adapter *adap;
87 u8 mode_initiator;
88 u8 mode_follower;
89
90 /* Events */
91 wait_queue_head_t wait;
Hans Verkuila56960e2016-06-25 09:43:58 -030092 struct mutex lock;
Hans Verkuil6b2bbb02017-07-11 03:30:39 -030093 struct list_head events[CEC_NUM_EVENTS]; /* queued events */
Hans Verkuil6ec1cbf2018-03-06 16:20:00 -050094 u16 queued_events[CEC_NUM_EVENTS];
Hans Verkuil6b2bbb02017-07-11 03:30:39 -030095 unsigned int total_queued_events;
96 struct cec_event_entry core_events[CEC_NUM_CORE_EVENTS];
Hans Verkuila56960e2016-06-25 09:43:58 -030097 struct list_head msgs; /* queued messages */
98 unsigned int queued_msgs;
99};
100
101#define CEC_SIGNAL_FREE_TIME_RETRY 3
102#define CEC_SIGNAL_FREE_TIME_NEW_INITIATOR 5
103#define CEC_SIGNAL_FREE_TIME_NEXT_XFER 7
104
105/* The nominal data bit period is 2.4 ms */
106#define CEC_FREE_TIME_TO_USEC(ft) ((ft) * 2400)
107
108struct cec_adap_ops {
109 /* Low-level callbacks */
110 int (*adap_enable)(struct cec_adapter *adap, bool enable);
111 int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
Hans Verkuil48ea2e92017-11-05 07:36:36 -0500112 int (*adap_monitor_pin_enable)(struct cec_adapter *adap, bool enable);
Hans Verkuila56960e2016-06-25 09:43:58 -0300113 int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
114 int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
115 u32 signal_free_time, struct cec_msg *msg);
116 void (*adap_status)(struct cec_adapter *adap, struct seq_file *file);
Hans Verkuile6259b52017-07-11 03:30:36 -0300117 void (*adap_free)(struct cec_adapter *adap);
Hans Verkuila56960e2016-06-25 09:43:58 -0300118
Hans Verkuil9ca400c2017-10-31 09:55:09 -0400119 /* Error injection callbacks */
120 int (*error_inj_show)(struct cec_adapter *adap, struct seq_file *sf);
121 bool (*error_inj_parse_line)(struct cec_adapter *adap, char *line);
122
Hans Verkuila56960e2016-06-25 09:43:58 -0300123 /* High-level CEC message callback */
124 int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
125};
126
127/*
128 * The minimum message length you can receive (excepting poll messages) is 2.
129 * With a transfer rate of at most 36 bytes per second this makes 18 messages
130 * per second worst case.
131 *
Hans Verkuil11065f82016-07-17 11:40:05 -0300132 * We queue at most 3 seconds worth of received messages. The CEC specification
133 * requires that messages are replied to within a second, so 3 seconds should
134 * give more than enough margin. Since most messages are actually more than 2
135 * bytes, this is in practice a lot more than 3 seconds.
Hans Verkuila56960e2016-06-25 09:43:58 -0300136 */
Hans Verkuil11065f82016-07-17 11:40:05 -0300137#define CEC_MAX_MSG_RX_QUEUE_SZ (18 * 3)
138
139/*
140 * The transmit queue is limited to 1 second worth of messages (worst case).
141 * Messages can be transmitted by userspace and kernel space. But for both it
142 * makes no sense to have a lot of messages queued up. One second seems
143 * reasonable.
144 */
145#define CEC_MAX_MSG_TX_QUEUE_SZ (18 * 1)
Hans Verkuila56960e2016-06-25 09:43:58 -0300146
Hans Verkuile233f812020-06-20 12:16:41 +0200147/**
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 * @last_initiator: the initiator of the last transmitted message.
176 * @monitor_all_cnt: number of filehandles monitoring all msgs
177 * @monitor_pin_cnt: number of filehandles monitoring pin changes
178 * @follower_cnt: number of filehandles in follower mode
179 * @cec_follower: filehandle of the exclusive follower
180 * @cec_initiator: filehandle of the exclusive initiator
181 * @passthrough: if true, then the exclusive follower is in
182 * passthrough mode.
183 * @log_addrs: current logical addresses
184 * @conn_info: current connector info
185 * @tx_timeouts: number of transmit timeouts
186 * @notifier: CEC notifier
187 * @pin: CEC pin status struct
188 * @cec_dir: debugfs cec directory
189 * @status_file: debugfs cec status file
190 * @error_inj_file: debugfs cec error injection file
191 * @sequence: transmit sequence counter
192 * @input_phys: remote control input_phys name
193 *
194 * This structure represents a cec adapter.
195 */
Hans Verkuila56960e2016-06-25 09:43:58 -0300196struct cec_adapter {
197 struct module *owner;
198 char name[32];
199 struct cec_devnode devnode;
200 struct mutex lock;
201 struct rc_dev *rc;
202
203 struct list_head transmit_queue;
Hans Verkuil11065f82016-07-17 11:40:05 -0300204 unsigned int transmit_queue_sz;
Hans Verkuila56960e2016-06-25 09:43:58 -0300205 struct list_head wait_queue;
206 struct cec_data *transmitting;
Hans Verkuil32804fc2018-10-19 03:55:34 -0400207 bool transmit_in_progress;
Hans Verkuila56960e2016-06-25 09:43:58 -0300208
209 struct task_struct *kthread_config;
210 struct completion config_completion;
211
212 struct task_struct *kthread;
213 wait_queue_head_t kthread_waitq;
Hans Verkuila56960e2016-06-25 09:43:58 -0300214
215 const struct cec_adap_ops *ops;
216 void *priv;
217 u32 capabilities;
218 u8 available_log_addrs;
219
220 u16 phys_addr;
Hans Verkuilf902c1e2017-06-07 11:46:12 -0300221 bool needs_hpd;
Hans Verkuila56960e2016-06-25 09:43:58 -0300222 bool is_configuring;
223 bool is_configured;
Hans Verkuil28e11b12017-08-20 06:53:10 -0400224 bool cec_pin_is_high;
Hans Verkuil7d867a12018-10-05 08:00:21 -0400225 u8 last_initiator;
Hans Verkuila56960e2016-06-25 09:43:58 -0300226 u32 monitor_all_cnt;
Hans Verkuilb8d62f52017-07-11 03:30:41 -0300227 u32 monitor_pin_cnt;
Hans Verkuila56960e2016-06-25 09:43:58 -0300228 u32 follower_cnt;
229 struct cec_fh *cec_follower;
230 struct cec_fh *cec_initiator;
231 bool passthrough;
232 struct cec_log_addrs log_addrs;
Dariusz Marcinkiewicz32a847f2019-06-20 05:17:18 -0400233 struct cec_connector_info conn_info;
Hans Verkuila56960e2016-06-25 09:43:58 -0300234
Hans Verkuilbb789e02017-07-11 03:30:34 -0300235 u32 tx_timeouts;
236
Hans Verkuile94c3282017-05-28 05:58:04 -0300237#ifdef CONFIG_CEC_NOTIFIER
Hans Verkuile3a93ad2016-12-13 12:15:57 -0200238 struct cec_notifier *notifier;
239#endif
Hans Verkuilea5c8ef2017-07-11 03:30:42 -0300240#ifdef CONFIG_CEC_PIN
241 struct cec_pin *pin;
242#endif
Hans Verkuile3a93ad2016-12-13 12:15:57 -0200243
Hans Verkuila56960e2016-06-25 09:43:58 -0300244 struct dentry *cec_dir;
245 struct dentry *status_file;
Hans Verkuil9ca400c2017-10-31 09:55:09 -0400246 struct dentry *error_inj_file;
Hans Verkuila56960e2016-06-25 09:43:58 -0300247
Hans Verkuila56960e2016-06-25 09:43:58 -0300248 u32 sequence;
249
Hans Verkuila56960e2016-06-25 09:43:58 -0300250 char input_phys[32];
Hans Verkuila56960e2016-06-25 09:43:58 -0300251};
252
Jose Abreu0b0b97d2017-03-24 13:47:52 -0300253static inline void *cec_get_drvdata(const struct cec_adapter *adap)
254{
255 return adap->priv;
256}
257
Hans Verkuila56960e2016-06-25 09:43:58 -0300258static inline bool cec_has_log_addr(const struct cec_adapter *adap, u8 log_addr)
259{
260 return adap->log_addrs.log_addr_mask & (1 << log_addr);
261}
262
263static inline bool cec_is_sink(const struct cec_adapter *adap)
264{
265 return adap->phys_addr == 0;
266}
267
Hans Verkuilc8959a32017-11-22 04:12:39 -0500268/**
269 * cec_is_registered() - is the CEC adapter registered?
270 *
271 * @adap: the CEC adapter, may be NULL.
272 *
273 * Return: true if the adapter is registered, false otherwise.
274 */
275static inline bool cec_is_registered(const struct cec_adapter *adap)
276{
277 return adap && adap->devnode.registered;
278}
279
Hans Verkuilee7e98712017-04-17 07:54:37 -0300280#define cec_phys_addr_exp(pa) \
281 ((pa) >> 12), ((pa) >> 8) & 0xf, ((pa) >> 4) & 0xf, (pa) & 0xf
282
Hans Verkuil23111ec2017-06-07 11:46:08 -0300283struct edid;
Dariusz Marcinkiewicz32a847f2019-06-20 05:17:18 -0400284struct drm_connector;
Hans Verkuil23111ec2017-06-07 11:46:08 -0300285
Hans Verkuilf9f314f2017-06-08 15:37:44 -0300286#if IS_REACHABLE(CONFIG_CEC_CORE)
Hans Verkuila56960e2016-06-25 09:43:58 -0300287struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
Hans Verkuilf51e8082016-11-25 06:23:34 -0200288 void *priv, const char *name, u32 caps, u8 available_las);
289int cec_register_adapter(struct cec_adapter *adap, struct device *parent);
Hans Verkuila56960e2016-06-25 09:43:58 -0300290void cec_unregister_adapter(struct cec_adapter *adap);
291void cec_delete_adapter(struct cec_adapter *adap);
292
293int cec_s_log_addrs(struct cec_adapter *adap, struct cec_log_addrs *log_addrs,
294 bool block);
295void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr,
296 bool block);
Hans Verkuil23111ec2017-06-07 11:46:08 -0300297void cec_s_phys_addr_from_edid(struct cec_adapter *adap,
298 const struct edid *edid);
Dariusz Marcinkiewicz32a847f2019-06-20 05:17:18 -0400299void cec_s_conn_info(struct cec_adapter *adap,
300 const struct cec_connector_info *conn_info);
Hans Verkuila56960e2016-06-25 09:43:58 -0300301int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg,
302 bool block);
303
304/* Called by the adapter */
Hans Verkuil0861ad12017-07-11 03:30:35 -0300305void cec_transmit_done_ts(struct cec_adapter *adap, u8 status,
306 u8 arb_lost_cnt, u8 nack_cnt, u8 low_drive_cnt,
307 u8 error_cnt, ktime_t ts);
308
309static inline void cec_transmit_done(struct cec_adapter *adap, u8 status,
310 u8 arb_lost_cnt, u8 nack_cnt,
311 u8 low_drive_cnt, u8 error_cnt)
312{
313 cec_transmit_done_ts(adap, status, arb_lost_cnt, nack_cnt,
314 low_drive_cnt, error_cnt, ktime_get());
315}
Hans Verkuilc94cdc12017-06-07 11:46:10 -0300316/*
317 * Simplified version of cec_transmit_done for hardware that doesn't retry
318 * failed transmits. So this is always just one attempt in which case
319 * the status is sufficient.
320 */
Hans Verkuil0861ad12017-07-11 03:30:35 -0300321void cec_transmit_attempt_done_ts(struct cec_adapter *adap,
322 u8 status, ktime_t ts);
323
324static inline void cec_transmit_attempt_done(struct cec_adapter *adap,
325 u8 status)
326{
327 cec_transmit_attempt_done_ts(adap, status, ktime_get());
328}
329
330void cec_received_msg_ts(struct cec_adapter *adap,
331 struct cec_msg *msg, ktime_t ts);
332
333static inline void cec_received_msg(struct cec_adapter *adap,
334 struct cec_msg *msg)
335{
336 cec_received_msg_ts(adap, msg, ktime_get());
337}
Hans Verkuila56960e2016-06-25 09:43:58 -0300338
Hans Verkuilee7e98712017-04-17 07:54:37 -0300339/**
Hans Verkuil9a6b2a82017-08-15 15:26:25 -0400340 * cec_queue_pin_cec_event() - queue a CEC pin event with a given timestamp.
Hans Verkuilb8d62f52017-07-11 03:30:41 -0300341 *
342 * @adap: pointer to the cec adapter
Hans Verkuil9a6b2a82017-08-15 15:26:25 -0400343 * @is_high: when true the CEC pin is high, otherwise it is low
Hans Verkuil6ec1cbf2018-03-06 16:20:00 -0500344 * @dropped_events: when true some events were dropped
Hans Verkuilb8d62f52017-07-11 03:30:41 -0300345 * @ts: the timestamp for this event
346 *
347 */
Hans Verkuil6ec1cbf2018-03-06 16:20:00 -0500348void cec_queue_pin_cec_event(struct cec_adapter *adap, bool is_high,
349 bool dropped_events, ktime_t ts);
Hans Verkuilb8d62f52017-07-11 03:30:41 -0300350
351/**
Hans Verkuil333ef6b2017-08-15 10:07:25 -0400352 * cec_queue_pin_hpd_event() - queue a pin event with a given timestamp.
353 *
354 * @adap: pointer to the cec adapter
355 * @is_high: when true the HPD pin is high, otherwise it is low
356 * @ts: the timestamp for this event
357 *
358 */
359void cec_queue_pin_hpd_event(struct cec_adapter *adap, bool is_high, ktime_t ts);
360
361/**
Hans Verkuil4786b0d2018-06-28 07:43:46 -0400362 * cec_queue_pin_5v_event() - queue a pin event with a given timestamp.
363 *
364 * @adap: pointer to the cec adapter
365 * @is_high: when true the 5V pin is high, otherwise it is low
366 * @ts: the timestamp for this event
367 *
368 */
369void cec_queue_pin_5v_event(struct cec_adapter *adap, bool is_high, ktime_t ts);
370
371/**
Hans Verkuilee7e98712017-04-17 07:54:37 -0300372 * cec_get_edid_phys_addr() - find and return the physical address
373 *
374 * @edid: pointer to the EDID data
375 * @size: size in bytes of the EDID data
376 * @offset: If not %NULL then the location of the physical address
377 * bytes in the EDID will be returned here. This is set to 0
378 * if there is no physical address found.
379 *
380 * Return: the physical address or CEC_PHYS_ADDR_INVALID if there is none.
381 */
382u16 cec_get_edid_phys_addr(const u8 *edid, unsigned int size,
383 unsigned int *offset);
384
Dariusz Marcinkiewicz32a847f2019-06-20 05:17:18 -0400385void cec_fill_conn_info_from_drm(struct cec_connector_info *conn_info,
386 const struct drm_connector *connector);
387
Hans Verkuila56960e2016-06-25 09:43:58 -0300388#else
389
Hans Verkuilf51e8082016-11-25 06:23:34 -0200390static inline int cec_register_adapter(struct cec_adapter *adap,
391 struct device *parent)
Hans Verkuila56960e2016-06-25 09:43:58 -0300392{
393 return 0;
394}
395
396static inline void cec_unregister_adapter(struct cec_adapter *adap)
397{
398}
399
400static inline void cec_delete_adapter(struct cec_adapter *adap)
401{
402}
403
404static inline void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr,
405 bool block)
406{
407}
408
Hans Verkuil23111ec2017-06-07 11:46:08 -0300409static inline void cec_s_phys_addr_from_edid(struct cec_adapter *adap,
410 const struct edid *edid)
411{
412}
413
Hans Verkuilee7e98712017-04-17 07:54:37 -0300414static inline u16 cec_get_edid_phys_addr(const u8 *edid, unsigned int size,
415 unsigned int *offset)
416{
417 if (offset)
418 *offset = 0;
419 return CEC_PHYS_ADDR_INVALID;
420}
421
Dariusz Marcinkiewicz32a847f2019-06-20 05:17:18 -0400422static inline void cec_s_conn_info(struct cec_adapter *adap,
423 const struct cec_connector_info *conn_info)
424{
425}
426
427static inline void
428cec_fill_conn_info_from_drm(struct cec_connector_info *conn_info,
429 const struct drm_connector *connector)
430{
431 memset(conn_info, 0, sizeof(*conn_info));
432}
433
434#endif
435
Hans Verkuil13532782017-06-07 11:46:09 -0300436/**
437 * cec_phys_addr_invalidate() - set the physical address to INVALID
438 *
439 * @adap: the CEC adapter
440 *
441 * This is a simple helper function to invalidate the physical
442 * address.
443 */
444static inline void cec_phys_addr_invalidate(struct cec_adapter *adap)
445{
446 cec_s_phys_addr(adap, CEC_PHYS_ADDR_INVALID, false);
447}
448
Hans Verkuilb915bf572018-09-13 03:25:59 -0400449/**
450 * cec_get_edid_spa_location() - find location of the Source Physical Address
451 *
452 * @edid: the EDID
453 * @size: the size of the EDID
454 *
455 * This EDID is expected to be a CEA-861 compliant, which means that there are
456 * at least two blocks and one or more of the extensions blocks are CEA-861
457 * blocks.
458 *
459 * The returned location is guaranteed to be <= size-2.
460 *
461 * This is an inline function since it is used by both CEC and V4L2.
462 * Ideally this would go in a module shared by both, but it is overkill to do
463 * that for just a single function.
464 */
465static inline unsigned int cec_get_edid_spa_location(const u8 *edid,
466 unsigned int size)
467{
468 unsigned int blocks = size / 128;
469 unsigned int block;
470 u8 d;
471
472 /* Sanity check: at least 2 blocks and a multiple of the block size */
473 if (blocks < 2 || size % 128)
474 return 0;
475
476 /*
477 * If there are fewer extension blocks than the size, then update
478 * 'blocks'. It is allowed to have more extension blocks than the size,
479 * since some hardware can only read e.g. 256 bytes of the EDID, even
480 * though more blocks are present. The first CEA-861 extension block
481 * should normally be in block 1 anyway.
482 */
483 if (edid[0x7e] + 1 < blocks)
484 blocks = edid[0x7e] + 1;
485
486 for (block = 1; block < blocks; block++) {
487 unsigned int offset = block * 128;
488
489 /* Skip any non-CEA-861 extension blocks */
490 if (edid[offset] != 0x02 || edid[offset + 1] != 0x03)
491 continue;
492
493 /* search Vendor Specific Data Block (tag 3) */
494 d = edid[offset + 2] & 0x7f;
495 /* Check if there are Data Blocks */
496 if (d <= 4)
497 continue;
498 if (d > 4) {
499 unsigned int i = offset + 4;
500 unsigned int end = offset + d;
501
502 /* Note: 'end' is always < 'size' */
503 do {
504 u8 tag = edid[i] >> 5;
505 u8 len = edid[i] & 0x1f;
506
507 if (tag == 3 && len >= 5 && i + len <= end &&
508 edid[i + 1] == 0x03 &&
509 edid[i + 2] == 0x0c &&
510 edid[i + 3] == 0x00)
511 return i + 4;
512 i += len + 1;
513 } while (i < end);
514 }
515 }
516 return 0;
517}
518
Hans Verkuila56960e2016-06-25 09:43:58 -0300519#endif /* _MEDIA_CEC_H */