blob: 2098943f4dd7c1c526204181f8602a49a9c9f2e3 [file] [log] [blame]
Sachin Bhayareeeb88892018-01-02 16:36:01 +05301/* Copyright (c) 2012, 2014-2015, 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_HDCP_H__
14#define __MDSS_HDMI_HDCP_H__
15
16#include "mdss_hdmi_util.h"
17#include <video/msm_hdmi_modes.h>
18#include <soc/qcom/scm.h>
19
20enum hdmi_hdcp_state {
21 HDCP_STATE_INACTIVE,
22 HDCP_STATE_AUTHENTICATING,
23 HDCP_STATE_AUTHENTICATED,
24 HDCP_STATE_AUTH_FAIL,
25 HDCP_STATE_AUTH_ENC_NONE,
26 HDCP_STATE_AUTH_ENC_1X,
27 HDCP_STATE_AUTH_ENC_2P2
28};
29
30struct hdmi_hdcp_init_data {
31 struct dss_io_data *core_io;
32 struct dss_io_data *qfprom_io;
33 struct dss_io_data *hdcp_io;
34 struct mutex *mutex;
35 struct kobject *sysfs_kobj;
36 struct workqueue_struct *workq;
37 void *cb_data;
38 void (*notify_status)(void *cb_data, enum hdmi_hdcp_state status);
39 struct hdmi_tx_ddc_ctrl *ddc_ctrl;
40 u32 phy_addr;
41 u32 hdmi_tx_ver;
42 struct msm_hdmi_mode_timing_info *timing;
43 bool tethered;
44};
45
46struct hdmi_hdcp_ops {
47 int (*hdmi_hdcp_isr)(void *ptr);
48 int (*hdmi_hdcp_reauthenticate)(void *input);
49 int (*hdmi_hdcp_authenticate)(void *hdcp_ctrl);
50 bool (*feature_supported)(void *input);
51 void (*hdmi_hdcp_off)(void *hdcp_ctrl);
52};
53
54void *hdmi_hdcp_init(struct hdmi_hdcp_init_data *init_data);
55void *hdmi_hdcp2p2_init(struct hdmi_hdcp_init_data *init_data);
56void hdmi_hdcp_deinit(void *input);
57void hdmi_hdcp2p2_deinit(void *input);
58
59struct hdmi_hdcp_ops *hdmi_hdcp_start(void *input);
60struct hdmi_hdcp_ops *hdmi_hdcp2p2_start(void *input);
61
62const char *hdcp_state_name(enum hdmi_hdcp_state hdcp_state);
63
64#endif /* __MDSS_HDMI_HDCP_H__ */