Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * cec-priv.h - HDMI Consumer Electronics Control internal header
0004  *
0005  * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
0006  */
0007 
0008 #ifndef _CEC_PRIV_H
0009 #define _CEC_PRIV_H
0010 
0011 #include <linux/cec-funcs.h>
0012 #include <media/cec-notifier.h>
0013 
0014 #define dprintk(lvl, fmt, arg...)                   \
0015     do {                                \
0016         if (lvl <= cec_debug)                   \
0017             pr_info("cec-%s: " fmt, adap->name, ## arg);    \
0018     } while (0)
0019 
0020 #define call_op(adap, op, arg...)                   \
0021     ((adap->ops->op && !adap->devnode.unregistered) ?       \
0022      adap->ops->op(adap, ## arg) : 0)
0023 
0024 #define call_void_op(adap, op, arg...)                  \
0025     do {                                \
0026         if (adap->ops->op && !adap->devnode.unregistered)   \
0027             adap->ops->op(adap, ## arg);            \
0028     } while (0)
0029 
0030 /* devnode to cec_adapter */
0031 #define to_cec_adapter(node) container_of(node, struct cec_adapter, devnode)
0032 
0033 static inline bool msg_is_raw(const struct cec_msg *msg)
0034 {
0035     return msg->flags & CEC_MSG_FL_RAW;
0036 }
0037 
0038 /* cec-core.c */
0039 extern int cec_debug;
0040 int cec_get_device(struct cec_devnode *devnode);
0041 void cec_put_device(struct cec_devnode *devnode);
0042 
0043 /* cec-adap.c */
0044 int cec_monitor_all_cnt_inc(struct cec_adapter *adap);
0045 void cec_monitor_all_cnt_dec(struct cec_adapter *adap);
0046 int cec_monitor_pin_cnt_inc(struct cec_adapter *adap);
0047 void cec_monitor_pin_cnt_dec(struct cec_adapter *adap);
0048 int cec_adap_status(struct seq_file *file, void *priv);
0049 int cec_thread_func(void *_adap);
0050 void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block);
0051 int __cec_s_log_addrs(struct cec_adapter *adap,
0052               struct cec_log_addrs *log_addrs, bool block);
0053 int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
0054             struct cec_fh *fh, bool block);
0055 void cec_queue_event_fh(struct cec_fh *fh,
0056             const struct cec_event *new_ev, u64 ts);
0057 
0058 /* cec-api.c */
0059 extern const struct file_operations cec_devnode_fops;
0060 
0061 #endif