blob: 57a76645e806cc216c88f78bcde1160ea1b31342 [file] [log] [blame]
Sachin Bhayareeeb88892018-01-02 16:36:01 +05301/* Copyright (c) 2010-2013, 2015-2016, 2018, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __MDSS_HDMI_CEC_H__
14#define __MDSS_HDMI_CEC_H__
15
16#include "mdss_hdmi_util.h"
17#include "mdss_cec_core.h"
18
19#define RETRANSMIT_MAX_NUM 5
20
21/**
22 * struct hdmi_cec_init_data - data needed for initializing cec hw module
23 * @workq: pointer to workqueue
24 * @io: pointer to register access related data
25 * @pinfo: pointer to panel information data
26 * @cbs: pointer to cec abstract callback functions.
27 * @ops: pointer to cec hw operation functions.
28 *
29 * Defines the data needed to be provided while initializing cec hw module
30 */
31struct hdmi_cec_init_data {
32 struct workqueue_struct *workq;
33 struct dss_io_data *io;
34 struct mdss_panel_info *pinfo;
35 struct cec_cbs *cbs;
36 struct cec_ops *ops;
37};
38
39/**
40 * hdmi_cec_isr() - interrupt handler for cec hw module
41 * @cec_ctrl: pointer to cec hw module's data
42 *
43 * Return: irq error code
44 *
45 * The API can be called by HDMI Tx driver on receiving hw interrupts
46 * to let the CEC related interrupts handled by this module.
47 */
48int hdmi_cec_isr(void *cec_ctrl);
49
50/**
51 * hdmi_cec_init() - Initialize the CEC hw module
52 * @init_data: data needed to initialize the cec hw module
53 *
54 * Return: pointer to cec hw modules data that needs to be passed when
55 * calling cec hw modules API or error code.
56 *
57 * The API registers CEC HW modules with the client and provides HW
58 * specific operations.
59 */
60void *hdmi_cec_init(struct hdmi_cec_init_data *init_data);
61
62/**
63 * hdmi_cec_deinit() - de-initialize CEC HW module
64 * @data: CEC HW module data
65 *
66 * This API release all resources allocated.
67 */
68void hdmi_cec_deinit(void *data);
69
70/**
71 * hdmi_cec_is_wakeup_en() - checks cec wakeup state
72 * @cec_ctrl: pointer to cec hw module's data
73 *
74 * Return: cec wakeup state
75 *
76 * This API is used to query whether the cec wakeup functionality is
77 * enabled or not.
78 */
79bool hdmi_cec_is_wakeup_en(void *cec_ctrl);
80
81/**
82 * hdmi_cec_device_suspend() - updates cec with device suspend state
83 * @cec_ctrl: pointer to cec hw module's data
84 * @suspend: device suspend state
85 *
86 * This API is used to update the CEC HW module of the device's suspend
87 * state.
88 */
89void hdmi_cec_device_suspend(void *cec_ctrl, bool suspend);
90#endif /* __MDSS_HDMI_CEC_H__ */