4 * HDMI driver definition for TI OMAP4, DM81xx, DM38xx Processor.
6 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published by
10 * the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
27 HDMI_PLLPWRCMD_ALLOFF = 0,
28 HDMI_PLLPWRCMD_PLLONLY = 1,
29 HDMI_PLLPWRCMD_BOTHON_ALLCLKS = 2,
30 HDMI_PLLPWRCMD_BOTHON_NOPHYCLK = 3
33 enum hdmi_core_hdmi_dvi {
38 enum hdmi_clk_refsel {
42 HDMI_REFSEL_SYSCLK = 3
45 struct hdmi_video_timings {
58 /* HDMI timing structure */
60 struct hdmi_video_timings timings;
71 struct hdmi_timings timings;
76 /* HDMI PLL structure */
77 struct hdmi_pll_info {
84 enum hdmi_clk_refsel refsel;
87 struct ti_hdmi_ip_ops {
89 void (*video_configure)(struct hdmi_ip_data *ip_data);
91 int (*phy_enable)(struct hdmi_ip_data *ip_data);
93 void (*phy_disable)(struct hdmi_ip_data *ip_data);
95 int (*read_edid)(struct hdmi_ip_data *ip_data, u8 *edid, int len);
97 bool (*detect)(struct hdmi_ip_data *ip_data);
99 int (*pll_enable)(struct hdmi_ip_data *ip_data);
101 void (*pll_disable)(struct hdmi_ip_data *ip_data);
103 void (*video_enable)(struct hdmi_ip_data *ip_data, bool start);
105 void (*dump_wrapper)(struct hdmi_ip_data *ip_data, struct seq_file *s);
107 void (*dump_core)(struct hdmi_ip_data *ip_data, struct seq_file *s);
109 void (*dump_pll)(struct hdmi_ip_data *ip_data, struct seq_file *s);
111 void (*dump_phy)(struct hdmi_ip_data *ip_data, struct seq_file *s);
113 #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
114 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
115 void (*audio_enable)(struct hdmi_ip_data *ip_data, bool start);
120 struct hdmi_ip_data {
121 void __iomem *base_wp; /* HDMI wrapper */
122 unsigned long core_sys_offset;
123 unsigned long core_av_offset;
124 unsigned long pll_offset;
125 unsigned long phy_offset;
126 const struct ti_hdmi_ip_ops *ops;
127 struct hdmi_config cfg;
128 struct hdmi_pll_info pll_data;
130 /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */
134 int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data);
135 void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data);
136 int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, u8 *edid, int len);
137 bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data);
138 void ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data, bool start);
139 int ti_hdmi_4xxx_pll_enable(struct hdmi_ip_data *ip_data);
140 void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data);
141 void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data);
142 void ti_hdmi_4xxx_wp_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
143 void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
144 void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
145 void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
146 #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
147 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
148 void ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data, bool enable);