blob: 50e168af0d073abb41f515cee418263ae3c15653 [file] [log] [blame]
Sachin Bhayareeeb88892018-01-02 16:36:01 +05301/* Copyright (c) 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_PANEL_H__
14#define __MDSS_HDMI_PANEL_H__
15
16#include "mdss_panel.h"
17#include "mdss_hdmi_util.h"
18
19/**
20 * struct hdmi_panel_data - panel related data information
21 *
22 * @pinfo: pointer to mdss panel information
23 * @s3d_mode: 3d mode supported
24 * @vic: video indentification code
25 * @scan_info: scan information of the TV
26 * @s3d_support: set to true if 3d supported, false otherwize
27 * @content_type: type of content like game, cinema etc
28 * @infoframe: set to true if infoframes should be sent to sink
29 * @is_it_content: set to true if content is IT
30 * @scrambler: set to true if scrambler needs to be enabled
31 */
32struct hdmi_panel_data {
33 struct mdss_panel_info *pinfo;
34 u32 s3d_mode;
35 u32 vic;
36 u32 scan_info;
37 u8 content_type;
38 bool s3d_support;
39 bool infoframe;
40 bool is_it_content;
41 bool scrambler;
42};
43
44/**
45 * struct hdmi_panel_ops - panel operation for clients
46 *
47 * @on: pointer to a function which powers on the panel
48 * @off: pointer to a function which powers off the panel
49 * @vendor: pointer to a function which programs vendor specific infoframe
50 * @update_fps: pointer to a function which updates fps
51 * @get_vic: pointer to a function which get the vic from panel information.
52 */
53struct hdmi_panel_ops {
54 int (*on)(void *input);
55 int (*off)(void *input);
56 void (*vendor)(void *input);
57 int (*update_fps)(void *input, u32 fps);
58 int (*get_vic)(struct mdss_panel_info *pinfo,
59 struct hdmi_util_ds_data *ds_data);
60};
61
62/**
63 * struct hdmi_panel_init_data - initialization data for hdmi panel
64 *
65 * @io: pointer to logical memory of the hdmi tx core
66 * @ds_data: pointer to down stream data
67 * @panel_data: pointer to panel data
68 * @ddc: pointer to display data channel's data
69 * @ops: pointer to pnael ops to be filled by hdmi panel
70 * @timing: pointer to the timing details of current resolution
71 * @spd_vendor_name: pointer to spd vendor infoframe data
72 * @spd_product_description: pointer to spd product description infoframe data
73 * @version: hardware version of the hdmi tx
74 */
75struct hdmi_panel_init_data {
Sachin Bhayare5076e252018-01-18 14:56:45 +053076 struct mdss_io_data *io;
Sachin Bhayareeeb88892018-01-02 16:36:01 +053077 struct hdmi_util_ds_data *ds_data;
78 struct hdmi_panel_data *panel_data;
79 struct hdmi_tx_ddc_ctrl *ddc;
80 struct hdmi_panel_ops *ops;
81 struct msm_hdmi_mode_timing_info *timing;
82 u8 *spd_vendor_name;
83 u8 *spd_product_description;
84 u32 version;
85};
86
87/**
88 * hdmi_panel_init() - initializes hdmi panel
89 *
90 * initializes the hdmi panel, allocates the memory, assign the input
91 * data to local variables and provide the operation function pointers.
92 *
93 * @data: initialization data.
94 * return: hdmi panel data that need to be send with hdmi ops.
95 */
96void *hdmi_panel_init(struct hdmi_panel_init_data *data);
97
98/**
99 * hdmi_panel_deinit() - deinitializes hdmi panel
100 *
101 * releases memory and all resources.
102 *
103 * @input: hdmi panel data.
104 */
105void hdmi_panel_deinit(void *input);
106
107#endif /* __MDSS_HDMI_PANEL_H__ */