aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2013-08-06 05:26:55 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-10-09 05:42:03 -0400
commitf382d9eb82cac42b5d162cb498cd41245dfafb42 (patch)
tree466af4988df7a57e70de0b1316ebe91e18add757
parent9f192a92286c41c32b0929e60ac7136baa5bd2a8 (diff)
omapdss: HDMI: create a Wrapper library
HDMI wrapper is a block common to DSS in OMAP4, OMAP5 and DRA7x. Move the existing functions from ti_hdmi_4xxx_ip.c to a separate file. These funcs are called directly from the hdmi driver rather than hdmi_ip_ops funtion pointer calls. Add new wrapper funcs which can be used by other hdmi libraries like core, pll and phy. Move some of the enums, structs and funcs related to the wrapper from ti_hdmi_4xxx_ip.h to ti_hdmi.h. These will be shared amongst the omap4/5 hdmi platform drivers and other libraries. The old hdmi_wp_init() is removed since it didn't do anything. Timing parameters like interlace, hsync_level and vsync_level weren't copied correctly before. Those are copied correctly now. The DT/hwmod information for hdmi doesn't split the address space according to the required sub blocks. Keep the address offset and size information in the driver for now. This will be removed when the driver gets the information correctly from DT/hwmod. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/Makefile2
-rw-r--r--drivers/video/omap2/dss/dss_features.c5
-rw-r--r--drivers/video/omap2/dss/hdmi.c26
-rw-r--r--drivers/video/omap2/dss/hdmi_wp.c302
-rw-r--r--drivers/video/omap2/dss/ti_hdmi.h131
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c308
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h85
7 files changed, 479 insertions, 380 deletions
diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile
index 94832eb06a3d..56ce6bd36905 100644
--- a/drivers/video/omap2/dss/Makefile
+++ b/drivers/video/omap2/dss/Makefile
@@ -10,5 +10,5 @@ omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
10omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o 10omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
11omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o 11omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
12omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o 12omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
13omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi.o ti_hdmi_4xxx_ip.o 13omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi.o hdmi_wp.o ti_hdmi_4xxx_ip.o
14ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG 14ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index b9cfebb378a2..db359e8df503 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -799,15 +799,10 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
799 .read_edid = ti_hdmi_4xxx_read_edid, 799 .read_edid = ti_hdmi_4xxx_read_edid,
800 .pll_enable = ti_hdmi_4xxx_pll_enable, 800 .pll_enable = ti_hdmi_4xxx_pll_enable,
801 .pll_disable = ti_hdmi_4xxx_pll_disable, 801 .pll_disable = ti_hdmi_4xxx_pll_disable,
802 .video_enable = ti_hdmi_4xxx_wp_video_start,
803 .video_disable = ti_hdmi_4xxx_wp_video_stop,
804 .dump_wrapper = ti_hdmi_4xxx_wp_dump,
805 .dump_core = ti_hdmi_4xxx_core_dump, 802 .dump_core = ti_hdmi_4xxx_core_dump,
806 .dump_pll = ti_hdmi_4xxx_pll_dump, 803 .dump_pll = ti_hdmi_4xxx_pll_dump,
807 .dump_phy = ti_hdmi_4xxx_phy_dump, 804 .dump_phy = ti_hdmi_4xxx_phy_dump,
808#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) 805#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
809 .audio_enable = ti_hdmi_4xxx_wp_audio_enable,
810 .audio_disable = ti_hdmi_4xxx_wp_audio_disable,
811 .audio_start = ti_hdmi_4xxx_audio_start, 806 .audio_start = ti_hdmi_4xxx_audio_start,
812 .audio_stop = ti_hdmi_4xxx_audio_stop, 807 .audio_stop = ti_hdmi_4xxx_audio_stop,
813 .audio_config = ti_hdmi_4xxx_audio_config, 808 .audio_config = ti_hdmi_4xxx_audio_config,
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 82a964074993..f2475fc1b632 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -40,7 +40,6 @@
40#include "dss.h" 40#include "dss.h"
41#include "dss_features.h" 41#include "dss_features.h"
42 42
43#define HDMI_WP 0x0
44#define HDMI_CORE_SYS 0x400 43#define HDMI_CORE_SYS 0x400
45#define HDMI_CORE_AV 0x900 44#define HDMI_CORE_AV 0x900
46#define HDMI_PLLCTRL 0x200 45#define HDMI_PLLCTRL 0x200
@@ -529,7 +528,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
529 528
530 hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data); 529 hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data);
531 530
532 hdmi.ip_data.ops->video_disable(&hdmi.ip_data); 531 hdmi_wp_video_stop(&hdmi.ip_data.wp);
533 532
534 /* config the PLL and PHY hdmi_set_pll_pwrfirst */ 533 /* config the PLL and PHY hdmi_set_pll_pwrfirst */
535 r = hdmi.ip_data.ops->pll_enable(&hdmi.ip_data); 534 r = hdmi.ip_data.ops->pll_enable(&hdmi.ip_data);
@@ -552,7 +551,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
552 /* tv size */ 551 /* tv size */
553 dss_mgr_set_timings(mgr, p); 552 dss_mgr_set_timings(mgr, p);
554 553
555 r = hdmi.ip_data.ops->video_enable(&hdmi.ip_data); 554 r = hdmi_wp_video_start(&hdmi.ip_data.wp);
556 if (r) 555 if (r)
557 goto err_vid_enable; 556 goto err_vid_enable;
558 557
@@ -563,7 +562,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
563 return 0; 562 return 0;
564 563
565err_mgr_enable: 564err_mgr_enable:
566 hdmi.ip_data.ops->video_disable(&hdmi.ip_data); 565 hdmi_wp_video_stop(&hdmi.ip_data.wp);
567err_vid_enable: 566err_vid_enable:
568 hdmi.ip_data.ops->phy_disable(&hdmi.ip_data); 567 hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
569err_phy_enable: 568err_phy_enable:
@@ -579,7 +578,7 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev)
579 578
580 dss_mgr_disable(mgr); 579 dss_mgr_disable(mgr);
581 580
582 hdmi.ip_data.ops->video_disable(&hdmi.ip_data); 581 hdmi_wp_video_stop(&hdmi.ip_data.wp);
583 hdmi.ip_data.ops->phy_disable(&hdmi.ip_data); 582 hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
584 hdmi.ip_data.ops->pll_disable(&hdmi.ip_data); 583 hdmi.ip_data.ops->pll_disable(&hdmi.ip_data);
585 584
@@ -642,7 +641,7 @@ static void hdmi_dump_regs(struct seq_file *s)
642 return; 641 return;
643 } 642 }
644 643
645 hdmi.ip_data.ops->dump_wrapper(&hdmi.ip_data, s); 644 hdmi_wp_dump(&hdmi.ip_data.wp, s);
646 hdmi.ip_data.ops->dump_pll(&hdmi.ip_data, s); 645 hdmi.ip_data.ops->dump_pll(&hdmi.ip_data, s);
647 hdmi.ip_data.ops->dump_phy(&hdmi.ip_data, s); 646 hdmi.ip_data.ops->dump_phy(&hdmi.ip_data, s);
648 hdmi.ip_data.ops->dump_core(&hdmi.ip_data, s); 647 hdmi.ip_data.ops->dump_core(&hdmi.ip_data, s);
@@ -946,8 +945,7 @@ static int hdmi_audio_enable(struct omap_dss_device *dssdev)
946 goto err; 945 goto err;
947 } 946 }
948 947
949 948 r = hdmi_wp_audio_enable(&hdmi.ip_data.wp, true);
950 r = hdmi.ip_data.ops->audio_enable(&hdmi.ip_data);
951 if (r) 949 if (r)
952 goto err; 950 goto err;
953 951
@@ -961,7 +959,7 @@ err:
961 959
962static void hdmi_audio_disable(struct omap_dss_device *dssdev) 960static void hdmi_audio_disable(struct omap_dss_device *dssdev)
963{ 961{
964 hdmi.ip_data.ops->audio_disable(&hdmi.ip_data); 962 hdmi_wp_audio_enable(&hdmi.ip_data.wp, false);
965} 963}
966 964
967static int hdmi_audio_start(struct omap_dss_device *dssdev) 965static int hdmi_audio_start(struct omap_dss_device *dssdev)
@@ -1086,7 +1084,6 @@ static void __exit hdmi_uninit_output(struct platform_device *pdev)
1086/* HDMI HW IP initialisation */ 1084/* HDMI HW IP initialisation */
1087static int omapdss_hdmihw_probe(struct platform_device *pdev) 1085static int omapdss_hdmihw_probe(struct platform_device *pdev)
1088{ 1086{
1089 struct resource *res;
1090 int r; 1087 int r;
1091 1088
1092 hdmi.pdev = pdev; 1089 hdmi.pdev = pdev;
@@ -1094,12 +1091,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
1094 mutex_init(&hdmi.lock); 1091 mutex_init(&hdmi.lock);
1095 mutex_init(&hdmi.ip_data.lock); 1092 mutex_init(&hdmi.ip_data.lock);
1096 1093
1097 res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0); 1094 r = hdmi_wp_init(pdev, &hdmi.ip_data.wp);
1098 1095 if (r)
1099 /* Base address taken from platform */ 1096 return r;
1100 hdmi.ip_data.base_wp = devm_ioremap_resource(&pdev->dev, res);
1101 if (IS_ERR(hdmi.ip_data.base_wp))
1102 return PTR_ERR(hdmi.ip_data.base_wp);
1103 1097
1104 hdmi.ip_data.irq = platform_get_irq(pdev, 0); 1098 hdmi.ip_data.irq = platform_get_irq(pdev, 0);
1105 if (hdmi.ip_data.irq < 0) { 1099 if (hdmi.ip_data.irq < 0) {
diff --git a/drivers/video/omap2/dss/hdmi_wp.c b/drivers/video/omap2/dss/hdmi_wp.c
new file mode 100644
index 000000000000..1b6dbe1095a7
--- /dev/null
+++ b/drivers/video/omap2/dss/hdmi_wp.c
@@ -0,0 +1,302 @@
1/*
2 * HDMI wrapper
3 *
4 * Copyright (C) 2013 Texas Instruments Incorporated
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/delay.h>
13#include <linux/err.h>
14#include <linux/io.h>
15#include <linux/platform_device.h>
16#include <video/omapdss.h>
17
18#include "dss.h"
19#include "ti_hdmi.h"
20#include "ti_hdmi_4xxx_ip.h"
21
22static inline void hdmi_write_reg(void __iomem *base_addr, const u16 idx,
23 u32 val)
24{
25 __raw_writel(val, base_addr + idx);
26}
27
28static inline u32 hdmi_read_reg(void __iomem *base_addr, const u16 idx)
29{
30 return __raw_readl(base_addr + idx);
31}
32
33#define REG_FLD_MOD(base, idx, val, start, end) \
34 hdmi_write_reg(base, idx, FLD_MOD(hdmi_read_reg(base, idx),\
35 val, start, end))
36#define REG_GET(base, idx, start, end) \
37 FLD_GET(hdmi_read_reg(base, idx), start, end)
38
39static inline int hdmi_wait_for_bit_change(void __iomem *base_addr,
40 const u16 idx, int b2, int b1, u32 val)
41{
42 u32 t = 0;
43 while (val != REG_GET(base_addr, idx, b2, b1)) {
44 udelay(1);
45 if (t++ > 10000)
46 return !val;
47 }
48 return val;
49}
50
51void hdmi_wp_dump(struct hdmi_wp_data *wp, struct seq_file *s)
52{
53#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, hdmi_read_reg(wp->base, r))
54
55 DUMPREG(HDMI_WP_REVISION);
56 DUMPREG(HDMI_WP_SYSCONFIG);
57 DUMPREG(HDMI_WP_IRQSTATUS_RAW);
58 DUMPREG(HDMI_WP_IRQSTATUS);
59 DUMPREG(HDMI_WP_IRQENABLE_SET);
60 DUMPREG(HDMI_WP_IRQENABLE_CLR);
61 DUMPREG(HDMI_WP_IRQWAKEEN);
62 DUMPREG(HDMI_WP_PWR_CTRL);
63 DUMPREG(HDMI_WP_DEBOUNCE);
64 DUMPREG(HDMI_WP_VIDEO_CFG);
65 DUMPREG(HDMI_WP_VIDEO_SIZE);
66 DUMPREG(HDMI_WP_VIDEO_TIMING_H);
67 DUMPREG(HDMI_WP_VIDEO_TIMING_V);
68 DUMPREG(HDMI_WP_WP_CLK);
69 DUMPREG(HDMI_WP_AUDIO_CFG);
70 DUMPREG(HDMI_WP_AUDIO_CFG2);
71 DUMPREG(HDMI_WP_AUDIO_CTRL);
72 DUMPREG(HDMI_WP_AUDIO_DATA);
73}
74
75u32 hdmi_wp_get_irqstatus(struct hdmi_wp_data *wp)
76{
77 return hdmi_read_reg(wp->base, HDMI_WP_IRQSTATUS);
78}
79
80void hdmi_wp_set_irqstatus(struct hdmi_wp_data *wp, u32 irqstatus)
81{
82 hdmi_write_reg(wp->base, HDMI_WP_IRQSTATUS, irqstatus);
83 /* flush posted write */
84 hdmi_read_reg(wp->base, HDMI_WP_IRQSTATUS);
85}
86
87void hdmi_wp_set_irqenable(struct hdmi_wp_data *wp, u32 mask)
88{
89 hdmi_write_reg(wp->base, HDMI_WP_IRQENABLE_SET, mask);
90}
91
92void hdmi_wp_clear_irqenable(struct hdmi_wp_data *wp, u32 mask)
93{
94 hdmi_write_reg(wp->base, HDMI_WP_IRQENABLE_CLR, mask);
95}
96
97/* PHY_PWR_CMD */
98int hdmi_wp_set_phy_pwr(struct hdmi_wp_data *wp, enum hdmi_phy_pwr val)
99{
100 /* Return if already the state */
101 if (REG_GET(wp->base, HDMI_WP_PWR_CTRL, 5, 4) == val)
102 return 0;
103
104 /* Command for power control of HDMI PHY */
105 REG_FLD_MOD(wp->base, HDMI_WP_PWR_CTRL, val, 7, 6);
106
107 /* Status of the power control of HDMI PHY */
108 if (hdmi_wait_for_bit_change(wp->base, HDMI_WP_PWR_CTRL, 5, 4, val)
109 != val) {
110 pr_err("Failed to set PHY power mode to %d\n", val);
111 return -ETIMEDOUT;
112 }
113
114 return 0;
115}
116
117/* PLL_PWR_CMD */
118int hdmi_wp_set_pll_pwr(struct hdmi_wp_data *wp, enum hdmi_pll_pwr val)
119{
120 /* Command for power control of HDMI PLL */
121 REG_FLD_MOD(wp->base, HDMI_WP_PWR_CTRL, val, 3, 2);
122
123 /* wait till PHY_PWR_STATUS is set */
124 if (hdmi_wait_for_bit_change(wp->base, HDMI_WP_PWR_CTRL, 1, 0, val)
125 != val) {
126 pr_err("Failed to set PLL_PWR_STATUS\n");
127 return -ETIMEDOUT;
128 }
129
130 return 0;
131}
132
133int hdmi_wp_video_start(struct hdmi_wp_data *wp)
134{
135 REG_FLD_MOD(wp->base, HDMI_WP_VIDEO_CFG, true, 31, 31);
136
137 return 0;
138}
139
140void hdmi_wp_video_stop(struct hdmi_wp_data *wp)
141{
142 REG_FLD_MOD(wp->base, HDMI_WP_VIDEO_CFG, false, 31, 31);
143}
144
145void hdmi_wp_video_config_format(struct hdmi_wp_data *wp,
146 struct hdmi_video_format *video_fmt)
147{
148 u32 l = 0;
149
150 REG_FLD_MOD(wp->base, HDMI_WP_VIDEO_CFG, video_fmt->packing_mode,
151 10, 8);
152
153 l |= FLD_VAL(video_fmt->y_res, 31, 16);
154 l |= FLD_VAL(video_fmt->x_res, 15, 0);
155 hdmi_write_reg(wp->base, HDMI_WP_VIDEO_SIZE, l);
156}
157
158void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp,
159 struct omap_video_timings *timings)
160{
161 u32 r;
162 bool vsync_pol, hsync_pol;
163 pr_debug("Enter hdmi_wp_video_config_interface\n");
164
165 vsync_pol = timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH;
166 hsync_pol = timings->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH;
167
168 r = hdmi_read_reg(wp->base, HDMI_WP_VIDEO_CFG);
169 r = FLD_MOD(r, vsync_pol, 7, 7);
170 r = FLD_MOD(r, hsync_pol, 6, 6);
171 r = FLD_MOD(r, timings->interlace, 3, 3);
172 r = FLD_MOD(r, 1, 1, 0); /* HDMI_TIMING_MASTER_24BIT */
173 hdmi_write_reg(wp->base, HDMI_WP_VIDEO_CFG, r);
174}
175
176void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
177 struct omap_video_timings *timings)
178{
179 u32 timing_h = 0;
180 u32 timing_v = 0;
181
182 pr_debug("Enter hdmi_wp_video_config_timing\n");
183
184 timing_h |= FLD_VAL(timings->hbp, 31, 20);
185 timing_h |= FLD_VAL(timings->hfp, 19, 8);
186 timing_h |= FLD_VAL(timings->hsw, 7, 0);
187 hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_H, timing_h);
188
189 timing_v |= FLD_VAL(timings->vbp, 31, 20);
190 timing_v |= FLD_VAL(timings->vfp, 19, 8);
191 timing_v |= FLD_VAL(timings->vsw, 7, 0);
192 hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_V, timing_v);
193}
194
195void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
196 struct omap_video_timings *timings, struct hdmi_config *param)
197{
198 pr_debug("Enter hdmi_wp_video_init_format\n");
199
200 video_fmt->packing_mode = HDMI_PACK_10b_RGB_YUV444;
201 video_fmt->y_res = param->timings.y_res;
202 video_fmt->x_res = param->timings.x_res;
203
204 timings->hbp = param->timings.hbp;
205 timings->hfp = param->timings.hfp;
206 timings->hsw = param->timings.hsw;
207 timings->vbp = param->timings.vbp;
208 timings->vfp = param->timings.vfp;
209 timings->vsw = param->timings.vsw;
210 timings->vsync_level = param->timings.vsync_level;
211 timings->hsync_level = param->timings.hsync_level;
212 timings->interlace = param->timings.interlace;
213}
214
215#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
216void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp,
217 struct hdmi_audio_format *aud_fmt)
218{
219 u32 r;
220
221 DSSDBG("Enter hdmi_wp_audio_config_format\n");
222
223 r = hdmi_read_reg(wp->base, HDMI_WP_AUDIO_CFG);
224 r = FLD_MOD(r, aud_fmt->stereo_channels, 26, 24);
225 r = FLD_MOD(r, aud_fmt->active_chnnls_msk, 23, 16);
226 r = FLD_MOD(r, aud_fmt->en_sig_blk_strt_end, 5, 5);
227 r = FLD_MOD(r, aud_fmt->type, 4, 4);
228 r = FLD_MOD(r, aud_fmt->justification, 3, 3);
229 r = FLD_MOD(r, aud_fmt->sample_order, 2, 2);
230 r = FLD_MOD(r, aud_fmt->samples_per_word, 1, 1);
231 r = FLD_MOD(r, aud_fmt->sample_size, 0, 0);
232 hdmi_write_reg(wp->base, HDMI_WP_AUDIO_CFG, r);
233}
234
235void hdmi_wp_audio_config_dma(struct hdmi_wp_data *wp,
236 struct hdmi_audio_dma *aud_dma)
237{
238 u32 r;
239
240 DSSDBG("Enter hdmi_wp_audio_config_dma\n");
241
242 r = hdmi_read_reg(wp->base, HDMI_WP_AUDIO_CFG2);
243 r = FLD_MOD(r, aud_dma->transfer_size, 15, 8);
244 r = FLD_MOD(r, aud_dma->block_size, 7, 0);
245 hdmi_write_reg(wp->base, HDMI_WP_AUDIO_CFG2, r);
246
247 r = hdmi_read_reg(wp->base, HDMI_WP_AUDIO_CTRL);
248 r = FLD_MOD(r, aud_dma->mode, 9, 9);
249 r = FLD_MOD(r, aud_dma->fifo_threshold, 8, 0);
250 hdmi_write_reg(wp->base, HDMI_WP_AUDIO_CTRL, r);
251}
252
253int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable)
254{
255 REG_FLD_MOD(wp->base, HDMI_WP_AUDIO_CTRL, enable, 31, 31);
256
257 return 0;
258}
259
260int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable)
261{
262 REG_FLD_MOD(wp->base, HDMI_WP_AUDIO_CTRL, enable, 30, 30);
263
264 return 0;
265}
266#endif
267
268#define WP_SIZE 0x200
269
270int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
271{
272 struct resource *res;
273 struct resource temp_res;
274
275 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi_wp");
276 if (!res) {
277 DSSDBG("can't get WP mem resource by name\n");
278 /*
279 * if hwmod/DT doesn't have the memory resource information
280 * split into HDMI sub blocks by name, we try again by getting
281 * the platform's first resource. this code will be removed when
282 * the driver can get the mem resources by name
283 */
284 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
285 if (!res) {
286 DSSERR("can't get WP mem resource\n");
287 return -EINVAL;
288 }
289
290 temp_res.start = res->start;
291 temp_res.end = temp_res.start + WP_SIZE - 1;
292 res = &temp_res;
293 }
294
295 wp->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
296 if (!wp->base) {
297 DSSERR("can't ioremap HDMI WP\n");
298 return -ENOMEM;
299 }
300
301 return 0;
302}
diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h
index 45215f44617c..d16f28de1272 100644
--- a/drivers/video/omap2/dss/ti_hdmi.h
+++ b/drivers/video/omap2/dss/ti_hdmi.h
@@ -21,6 +21,8 @@
21#ifndef _TI_HDMI_H 21#ifndef _TI_HDMI_H
22#define _TI_HDMI_H 22#define _TI_HDMI_H
23 23
24#include <linux/platform_device.h>
25
24struct hdmi_ip_data; 26struct hdmi_ip_data;
25 27
26enum hdmi_pll_pwr { 28enum hdmi_pll_pwr {
@@ -30,6 +32,12 @@ enum hdmi_pll_pwr {
30 HDMI_PLLPWRCMD_BOTHON_NOPHYCLK = 3 32 HDMI_PLLPWRCMD_BOTHON_NOPHYCLK = 3
31}; 33};
32 34
35enum hdmi_phy_pwr {
36 HDMI_PHYPWRCMD_OFF = 0,
37 HDMI_PHYPWRCMD_LDOON = 1,
38 HDMI_PHYPWRCMD_TXON = 2
39};
40
33enum hdmi_core_hdmi_dvi { 41enum hdmi_core_hdmi_dvi {
34 HDMI_DVI = 0, 42 HDMI_DVI = 0,
35 HDMI_HDMI = 1 43 HDMI_HDMI = 1
@@ -42,11 +50,67 @@ enum hdmi_clk_refsel {
42 HDMI_REFSEL_SYSCLK = 3 50 HDMI_REFSEL_SYSCLK = 3
43}; 51};
44 52
53enum hdmi_packing_mode {
54 HDMI_PACK_10b_RGB_YUV444 = 0,
55 HDMI_PACK_24b_RGB_YUV444_YUV422 = 1,
56 HDMI_PACK_20b_YUV422 = 2,
57 HDMI_PACK_ALREADYPACKED = 7
58};
59
60enum hdmi_stereo_channels {
61 HDMI_AUDIO_STEREO_NOCHANNELS = 0,
62 HDMI_AUDIO_STEREO_ONECHANNEL = 1,
63 HDMI_AUDIO_STEREO_TWOCHANNELS = 2,
64 HDMI_AUDIO_STEREO_THREECHANNELS = 3,
65 HDMI_AUDIO_STEREO_FOURCHANNELS = 4
66};
67
68enum hdmi_audio_type {
69 HDMI_AUDIO_TYPE_LPCM = 0,
70 HDMI_AUDIO_TYPE_IEC = 1
71};
72
73enum hdmi_audio_justify {
74 HDMI_AUDIO_JUSTIFY_LEFT = 0,
75 HDMI_AUDIO_JUSTIFY_RIGHT = 1
76};
77
78enum hdmi_audio_sample_order {
79 HDMI_AUDIO_SAMPLE_RIGHT_FIRST = 0,
80 HDMI_AUDIO_SAMPLE_LEFT_FIRST = 1
81};
82
83enum hdmi_audio_samples_perword {
84 HDMI_AUDIO_ONEWORD_ONESAMPLE = 0,
85 HDMI_AUDIO_ONEWORD_TWOSAMPLES = 1
86};
87
88enum hdmi_audio_sample_size {
89 HDMI_AUDIO_SAMPLE_16BITS = 0,
90 HDMI_AUDIO_SAMPLE_24BITS = 1
91};
92
93enum hdmi_audio_transf_mode {
94 HDMI_AUDIO_TRANSF_DMA = 0,
95 HDMI_AUDIO_TRANSF_IRQ = 1
96};
97
98enum hdmi_audio_blk_strt_end_sig {
99 HDMI_AUDIO_BLOCK_SIG_STARTEND_ON = 0,
100 HDMI_AUDIO_BLOCK_SIG_STARTEND_OFF = 1
101};
102
45struct hdmi_cm { 103struct hdmi_cm {
46 int code; 104 int code;
47 int mode; 105 int mode;
48}; 106};
49 107
108struct hdmi_video_format {
109 enum hdmi_packing_mode packing_mode;
110 u32 y_res; /* Line per panel */
111 u32 x_res; /* pixel per line */
112};
113
50struct hdmi_config { 114struct hdmi_config {
51 struct omap_video_timings timings; 115 struct omap_video_timings timings;
52 struct hdmi_cm cm; 116 struct hdmi_cm cm;
@@ -63,6 +127,24 @@ struct hdmi_pll_info {
63 enum hdmi_clk_refsel refsel; 127 enum hdmi_clk_refsel refsel;
64}; 128};
65 129
130struct hdmi_audio_format {
131 enum hdmi_stereo_channels stereo_channels;
132 u8 active_chnnls_msk;
133 enum hdmi_audio_type type;
134 enum hdmi_audio_justify justification;
135 enum hdmi_audio_sample_order sample_order;
136 enum hdmi_audio_samples_perword samples_per_word;
137 enum hdmi_audio_sample_size sample_size;
138 enum hdmi_audio_blk_strt_end_sig en_sig_blk_strt_end;
139};
140
141struct hdmi_audio_dma {
142 u8 transfer_size;
143 u8 block_size;
144 enum hdmi_audio_transf_mode mode;
145 u16 fifo_threshold;
146};
147
66struct ti_hdmi_ip_ops { 148struct ti_hdmi_ip_ops {
67 149
68 void (*video_configure)(struct hdmi_ip_data *ip_data); 150 void (*video_configure)(struct hdmi_ip_data *ip_data);
@@ -77,12 +159,6 @@ struct ti_hdmi_ip_ops {
77 159
78 void (*pll_disable)(struct hdmi_ip_data *ip_data); 160 void (*pll_disable)(struct hdmi_ip_data *ip_data);
79 161
80 int (*video_enable)(struct hdmi_ip_data *ip_data);
81
82 void (*video_disable)(struct hdmi_ip_data *ip_data);
83
84 void (*dump_wrapper)(struct hdmi_ip_data *ip_data, struct seq_file *s);
85
86 void (*dump_core)(struct hdmi_ip_data *ip_data, struct seq_file *s); 162 void (*dump_core)(struct hdmi_ip_data *ip_data, struct seq_file *s);
87 163
88 void (*dump_pll)(struct hdmi_ip_data *ip_data, struct seq_file *s); 164 void (*dump_pll)(struct hdmi_ip_data *ip_data, struct seq_file *s);
@@ -90,10 +166,6 @@ struct ti_hdmi_ip_ops {
90 void (*dump_phy)(struct hdmi_ip_data *ip_data, struct seq_file *s); 166 void (*dump_phy)(struct hdmi_ip_data *ip_data, struct seq_file *s);
91 167
92#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) 168#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
93 int (*audio_enable)(struct hdmi_ip_data *ip_data);
94
95 void (*audio_disable)(struct hdmi_ip_data *ip_data);
96
97 int (*audio_start)(struct hdmi_ip_data *ip_data); 169 int (*audio_start)(struct hdmi_ip_data *ip_data);
98 170
99 void (*audio_stop)(struct hdmi_ip_data *ip_data); 171 void (*audio_stop)(struct hdmi_ip_data *ip_data);
@@ -147,8 +219,13 @@ struct hdmi_core_infoframe_avi {
147 u16 db12_13_pixel_sofright; 219 u16 db12_13_pixel_sofright;
148}; 220};
149 221
222struct hdmi_wp_data {
223 void __iomem *base;
224};
225
150struct hdmi_ip_data { 226struct hdmi_ip_data {
151 void __iomem *base_wp; /* HDMI wrapper */ 227 struct hdmi_wp_data wp;
228
152 unsigned long core_sys_offset; 229 unsigned long core_sys_offset;
153 unsigned long core_av_offset; 230 unsigned long core_av_offset;
154 unsigned long pll_offset; 231 unsigned long pll_offset;
@@ -162,22 +239,44 @@ struct hdmi_ip_data {
162 /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */ 239 /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */
163 struct mutex lock; 240 struct mutex lock;
164}; 241};
242
243/* HDMI wrapper funcs */
244int hdmi_wp_video_start(struct hdmi_wp_data *wp);
245void hdmi_wp_video_stop(struct hdmi_wp_data *wp);
246void hdmi_wp_dump(struct hdmi_wp_data *wp, struct seq_file *s);
247u32 hdmi_wp_get_irqstatus(struct hdmi_wp_data *wp);
248void hdmi_wp_set_irqstatus(struct hdmi_wp_data *wp, u32 irqstatus);
249void hdmi_wp_set_irqenable(struct hdmi_wp_data *wp, u32 mask);
250void hdmi_wp_clear_irqenable(struct hdmi_wp_data *wp, u32 mask);
251int hdmi_wp_set_phy_pwr(struct hdmi_wp_data *wp, enum hdmi_phy_pwr val);
252int hdmi_wp_set_pll_pwr(struct hdmi_wp_data *wp, enum hdmi_pll_pwr val);
253void hdmi_wp_video_config_format(struct hdmi_wp_data *wp,
254 struct hdmi_video_format *video_fmt);
255void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp,
256 struct omap_video_timings *timings);
257void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
258 struct omap_video_timings *timings);
259void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
260 struct omap_video_timings *timings, struct hdmi_config *param);
261int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp);
262
165int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data); 263int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data);
166void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data); 264void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data);
167int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, u8 *edid, int len); 265int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, u8 *edid, int len);
168int ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data);
169void ti_hdmi_4xxx_wp_video_stop(struct hdmi_ip_data *ip_data);
170int ti_hdmi_4xxx_pll_enable(struct hdmi_ip_data *ip_data); 266int ti_hdmi_4xxx_pll_enable(struct hdmi_ip_data *ip_data);
171void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data); 267void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data);
172void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data); 268void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data);
173void ti_hdmi_4xxx_wp_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
174void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s); 269void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
175void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s); 270void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
176void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s); 271void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
177#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) 272#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
178int hdmi_compute_acr(u32 sample_freq, u32 *n, u32 *cts); 273int hdmi_compute_acr(u32 sample_freq, u32 *n, u32 *cts);
179int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data); 274int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable);
180void ti_hdmi_4xxx_wp_audio_disable(struct hdmi_ip_data *ip_data); 275int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable);
276void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp,
277 struct hdmi_audio_format *aud_fmt);
278void hdmi_wp_audio_config_dma(struct hdmi_wp_data *wp,
279 struct hdmi_audio_dma *aud_dma);
181int ti_hdmi_4xxx_audio_start(struct hdmi_ip_data *ip_data); 280int ti_hdmi_4xxx_audio_start(struct hdmi_ip_data *ip_data);
182void ti_hdmi_4xxx_audio_stop(struct hdmi_ip_data *ip_data); 281void ti_hdmi_4xxx_audio_stop(struct hdmi_ip_data *ip_data);
183int ti_hdmi_4xxx_audio_config(struct hdmi_ip_data *ip_data, 282int ti_hdmi_4xxx_audio_config(struct hdmi_ip_data *ip_data,
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index fd4172b41c46..d4b8883ecac0 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -52,43 +52,44 @@ static inline u32 hdmi_read_reg(void __iomem *base_addr,
52 return __raw_readl(base_addr + idx); 52 return __raw_readl(base_addr + idx);
53} 53}
54 54
55static inline void __iomem *hdmi_wp_base(struct hdmi_ip_data *ip_data) 55#define REG_FLD_MOD(base, idx, val, start, end) \
56 hdmi_write_reg(base, idx, FLD_MOD(hdmi_read_reg(base, idx),\
57 val, start, end))
58#define REG_GET(base, idx, start, end) \
59 FLD_GET(hdmi_read_reg(base, idx), start, end)
60
61static inline int hdmi_wait_for_bit_change(void __iomem *base_addr,
62 const u16 idx, int b2, int b1, u32 val)
56{ 63{
57 return ip_data->base_wp; 64 u32 t = 0;
65 while (val != REG_GET(base_addr, idx, b2, b1)) {
66 udelay(1);
67 if (t++ > 10000)
68 return !val;
69 }
70 return val;
58} 71}
59 72
60static inline void __iomem *hdmi_phy_base(struct hdmi_ip_data *ip_data) 73static inline void __iomem *hdmi_phy_base(struct hdmi_ip_data *ip_data)
61{ 74{
62 return ip_data->base_wp + ip_data->phy_offset; 75 return ip_data->wp.base + ip_data->phy_offset;
63} 76}
64 77
65static inline void __iomem *hdmi_pll_base(struct hdmi_ip_data *ip_data) 78static inline void __iomem *hdmi_pll_base(struct hdmi_ip_data *ip_data)
66{ 79{
67 return ip_data->base_wp + ip_data->pll_offset; 80 return ip_data->wp.base + ip_data->pll_offset;
68} 81}
69 82
70static inline void __iomem *hdmi_av_base(struct hdmi_ip_data *ip_data) 83static inline void __iomem *hdmi_av_base(struct hdmi_ip_data *ip_data)
71{ 84{
72 return ip_data->base_wp + ip_data->core_av_offset; 85 return ip_data->wp.base + ip_data->core_av_offset;
73} 86}
74 87
75static inline void __iomem *hdmi_core_sys_base(struct hdmi_ip_data *ip_data) 88static inline void __iomem *hdmi_core_sys_base(struct hdmi_ip_data *ip_data)
76{ 89{
77 return ip_data->base_wp + ip_data->core_sys_offset; 90 return ip_data->wp.base + ip_data->core_sys_offset;
78} 91}
79 92
80static inline int hdmi_wait_for_bit_change(void __iomem *base_addr,
81 const u16 idx,
82 int b2, int b1, u32 val)
83{
84 u32 t = 0;
85 while (val != REG_GET(base_addr, idx, b2, b1)) {
86 udelay(1);
87 if (t++ > 10000)
88 return !val;
89 }
90 return val;
91}
92 93
93static int hdmi_pll_init(struct hdmi_ip_data *ip_data) 94static int hdmi_pll_init(struct hdmi_ip_data *ip_data)
94{ 95{
@@ -156,41 +157,6 @@ static int hdmi_pll_init(struct hdmi_ip_data *ip_data)
156 return 0; 157 return 0;
157} 158}
158 159
159/* PHY_PWR_CMD */
160static int hdmi_set_phy_pwr(struct hdmi_ip_data *ip_data, enum hdmi_phy_pwr val)
161{
162 /* Return if already the state */
163 if (REG_GET(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, 5, 4) == val)
164 return 0;
165
166 /* Command for power control of HDMI PHY */
167 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, val, 7, 6);
168
169 /* Status of the power control of HDMI PHY */
170 if (hdmi_wait_for_bit_change(hdmi_wp_base(ip_data),
171 HDMI_WP_PWR_CTRL, 5, 4, val) != val) {
172 pr_err("Failed to set PHY power mode to %d\n", val);
173 return -ETIMEDOUT;
174 }
175
176 return 0;
177}
178
179/* PLL_PWR_CMD */
180static int hdmi_set_pll_pwr(struct hdmi_ip_data *ip_data, enum hdmi_pll_pwr val)
181{
182 /* Command for power control of HDMI PLL */
183 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, val, 3, 2);
184
185 /* wait till PHY_PWR_STATUS is set */
186 if (hdmi_wait_for_bit_change(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL,
187 1, 0, val) != val) {
188 pr_err("Failed to set PLL_PWR_STATUS\n");
189 return -ETIMEDOUT;
190 }
191
192 return 0;
193}
194 160
195static int hdmi_pll_reset(struct hdmi_ip_data *ip_data) 161static int hdmi_pll_reset(struct hdmi_ip_data *ip_data)
196{ 162{
@@ -211,11 +177,11 @@ int ti_hdmi_4xxx_pll_enable(struct hdmi_ip_data *ip_data)
211{ 177{
212 u16 r = 0; 178 u16 r = 0;
213 179
214 r = hdmi_set_pll_pwr(ip_data, HDMI_PLLPWRCMD_ALLOFF); 180 r = hdmi_wp_set_pll_pwr(&ip_data->wp, HDMI_PLLPWRCMD_ALLOFF);
215 if (r) 181 if (r)
216 return r; 182 return r;
217 183
218 r = hdmi_set_pll_pwr(ip_data, HDMI_PLLPWRCMD_BOTHON_ALLCLKS); 184 r = hdmi_wp_set_pll_pwr(&ip_data->wp, HDMI_PLLPWRCMD_BOTHON_ALLCLKS);
219 if (r) 185 if (r)
220 return r; 186 return r;
221 187
@@ -232,19 +198,16 @@ int ti_hdmi_4xxx_pll_enable(struct hdmi_ip_data *ip_data)
232 198
233void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data) 199void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data)
234{ 200{
235 hdmi_set_pll_pwr(ip_data, HDMI_PLLPWRCMD_ALLOFF); 201 hdmi_wp_set_pll_pwr(&ip_data->wp, HDMI_PLLPWRCMD_ALLOFF);
236} 202}
237 203
238static irqreturn_t hdmi_irq_handler(int irq, void *data) 204static irqreturn_t hdmi_irq_handler(int irq, void *data)
239{ 205{
240 struct hdmi_ip_data *ip_data = data; 206 struct hdmi_ip_data *ip_data = data;
241 void __iomem *wp_base = hdmi_wp_base(ip_data);
242 u32 irqstatus; 207 u32 irqstatus;
243 208
244 irqstatus = hdmi_read_reg(wp_base, HDMI_WP_IRQSTATUS); 209 irqstatus = hdmi_wp_get_irqstatus(&ip_data->wp);
245 hdmi_write_reg(wp_base, HDMI_WP_IRQSTATUS, irqstatus); 210 hdmi_wp_set_irqstatus(&ip_data->wp, irqstatus);
246 /* flush posted write */
247 hdmi_read_reg(wp_base, HDMI_WP_IRQSTATUS);
248 211
249 if ((irqstatus & HDMI_IRQ_LINK_CONNECT) && 212 if ((irqstatus & HDMI_IRQ_LINK_CONNECT) &&
250 irqstatus & HDMI_IRQ_LINK_DISCONNECT) { 213 irqstatus & HDMI_IRQ_LINK_DISCONNECT) {
@@ -254,18 +217,16 @@ static irqreturn_t hdmi_irq_handler(int irq, void *data)
254 * raises connect interrupt if a cable is connected, or nothing 217 * raises connect interrupt if a cable is connected, or nothing
255 * if cable is not connected. 218 * if cable is not connected.
256 */ 219 */
257 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_OFF); 220 hdmi_wp_set_phy_pwr(&ip_data->wp, HDMI_PHYPWRCMD_OFF);
258 221
259 hdmi_write_reg(wp_base, HDMI_WP_IRQSTATUS, 222 hdmi_wp_set_irqstatus(&ip_data->wp, HDMI_IRQ_LINK_CONNECT |
260 HDMI_IRQ_LINK_CONNECT | HDMI_IRQ_LINK_DISCONNECT); 223 HDMI_IRQ_LINK_DISCONNECT);
261 /* flush posted write */
262 hdmi_read_reg(wp_base, HDMI_WP_IRQSTATUS);
263 224
264 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_LDOON); 225 hdmi_wp_set_phy_pwr(&ip_data->wp, HDMI_PHYPWRCMD_LDOON);
265 } else if (irqstatus & HDMI_IRQ_LINK_CONNECT) { 226 } else if (irqstatus & HDMI_IRQ_LINK_CONNECT) {
266 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_TXON); 227 hdmi_wp_set_phy_pwr(&ip_data->wp, HDMI_PHYPWRCMD_TXON);
267 } else if (irqstatus & HDMI_IRQ_LINK_DISCONNECT) { 228 } else if (irqstatus & HDMI_IRQ_LINK_DISCONNECT) {
268 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_LDOON); 229 hdmi_wp_set_phy_pwr(&ip_data->wp, HDMI_PHYPWRCMD_LDOON);
269 } 230 }
270 231
271 return IRQ_HANDLED; 232 return IRQ_HANDLED;
@@ -274,15 +235,15 @@ static irqreturn_t hdmi_irq_handler(int irq, void *data)
274int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data) 235int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data)
275{ 236{
276 u16 r = 0; 237 u16 r = 0;
238 u32 irqstatus;
277 void __iomem *phy_base = hdmi_phy_base(ip_data); 239 void __iomem *phy_base = hdmi_phy_base(ip_data);
278 240
279 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_IRQENABLE_CLR, 241 hdmi_wp_clear_irqenable(&ip_data->wp, 0xffffffff);
280 0xffffffff);
281 242
282 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_IRQSTATUS, 243 irqstatus = hdmi_wp_get_irqstatus(&ip_data->wp);
283 HDMI_IRQ_LINK_CONNECT | HDMI_IRQ_LINK_DISCONNECT); 244 hdmi_wp_set_irqstatus(&ip_data->wp, irqstatus);
284 245
285 r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_LDOON); 246 r = hdmi_wp_set_phy_pwr(&ip_data->wp, HDMI_PHYPWRCMD_LDOON);
286 if (r) 247 if (r)
287 return r; 248 return r;
288 249
@@ -311,12 +272,12 @@ int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data)
311 IRQF_ONESHOT, "OMAP HDMI", ip_data); 272 IRQF_ONESHOT, "OMAP HDMI", ip_data);
312 if (r) { 273 if (r) {
313 DSSERR("HDMI IRQ request failed\n"); 274 DSSERR("HDMI IRQ request failed\n");
314 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_OFF); 275 hdmi_wp_set_phy_pwr(&ip_data->wp, HDMI_PHYPWRCMD_OFF);
315 return r; 276 return r;
316 } 277 }
317 278
318 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_IRQENABLE_SET, 279 hdmi_wp_set_irqenable(&ip_data->wp,
319 HDMI_IRQ_LINK_CONNECT | HDMI_IRQ_LINK_DISCONNECT); 280 HDMI_IRQ_LINK_CONNECT | HDMI_IRQ_LINK_DISCONNECT);
320 281
321 return 0; 282 return 0;
322} 283}
@@ -325,7 +286,7 @@ void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data)
325{ 286{
326 free_irq(ip_data->irq, ip_data); 287 free_irq(ip_data->irq, ip_data);
327 288
328 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_OFF); 289 hdmi_wp_set_phy_pwr(&ip_data->wp, HDMI_PHYPWRCMD_OFF);
329} 290}
330 291
331static int hdmi_core_ddc_init(struct hdmi_ip_data *ip_data) 292static int hdmi_core_ddc_init(struct hdmi_ip_data *ip_data)
@@ -679,99 +640,7 @@ static void hdmi_core_av_packet_config(struct hdmi_ip_data *ip_data,
679 (repeat_cfg.generic_pkt_repeat)); 640 (repeat_cfg.generic_pkt_repeat));
680} 641}
681 642
682static void hdmi_wp_init(struct omap_video_timings *timings,
683 struct hdmi_video_format *video_fmt)
684{
685 pr_debug("Enter hdmi_wp_init\n");
686
687 timings->hbp = 0;
688 timings->hfp = 0;
689 timings->hsw = 0;
690 timings->vbp = 0;
691 timings->vfp = 0;
692 timings->vsw = 0;
693
694 video_fmt->packing_mode = HDMI_PACK_10b_RGB_YUV444;
695 video_fmt->y_res = 0;
696 video_fmt->x_res = 0;
697
698}
699
700int ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data)
701{
702 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, true, 31, 31);
703 return 0;
704}
705
706void ti_hdmi_4xxx_wp_video_stop(struct hdmi_ip_data *ip_data)
707{
708 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, false, 31, 31);
709}
710
711static void hdmi_wp_video_init_format(struct hdmi_video_format *video_fmt,
712 struct omap_video_timings *timings, struct hdmi_config *param)
713{
714 pr_debug("Enter hdmi_wp_video_init_format\n");
715
716 video_fmt->y_res = param->timings.y_res;
717 video_fmt->x_res = param->timings.x_res;
718
719 timings->hbp = param->timings.hbp;
720 timings->hfp = param->timings.hfp;
721 timings->hsw = param->timings.hsw;
722 timings->vbp = param->timings.vbp;
723 timings->vfp = param->timings.vfp;
724 timings->vsw = param->timings.vsw;
725}
726
727static void hdmi_wp_video_config_format(struct hdmi_ip_data *ip_data,
728 struct hdmi_video_format *video_fmt)
729{
730 u32 l = 0;
731
732 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG,
733 video_fmt->packing_mode, 10, 8);
734
735 l |= FLD_VAL(video_fmt->y_res, 31, 16);
736 l |= FLD_VAL(video_fmt->x_res, 15, 0);
737 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_SIZE, l);
738}
739
740static void hdmi_wp_video_config_interface(struct hdmi_ip_data *ip_data)
741{
742 u32 r;
743 bool vsync_pol, hsync_pol;
744 pr_debug("Enter hdmi_wp_video_config_interface\n");
745
746 vsync_pol = ip_data->cfg.timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH;
747 hsync_pol = ip_data->cfg.timings.hsync_level == OMAPDSS_SIG_ACTIVE_HIGH;
748
749 r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG);
750 r = FLD_MOD(r, vsync_pol, 7, 7);
751 r = FLD_MOD(r, hsync_pol, 6, 6);
752 r = FLD_MOD(r, ip_data->cfg.timings.interlace, 3, 3);
753 r = FLD_MOD(r, 1, 1, 0); /* HDMI_TIMING_MASTER_24BIT */
754 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, r);
755}
756
757static void hdmi_wp_video_config_timing(struct hdmi_ip_data *ip_data,
758 struct omap_video_timings *timings)
759{
760 u32 timing_h = 0;
761 u32 timing_v = 0;
762
763 pr_debug("Enter hdmi_wp_video_config_timing\n");
764 643
765 timing_h |= FLD_VAL(timings->hbp, 31, 20);
766 timing_h |= FLD_VAL(timings->hfp, 19, 8);
767 timing_h |= FLD_VAL(timings->hsw, 7, 0);
768 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_TIMING_H, timing_h);
769
770 timing_v |= FLD_VAL(timings->vbp, 31, 20);
771 timing_v |= FLD_VAL(timings->vfp, 19, 8);
772 timing_v |= FLD_VAL(timings->vsw, 7, 0);
773 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_TIMING_V, timing_v);
774}
775 644
776void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data) 645void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data)
777{ 646{
@@ -784,20 +653,18 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data)
784 struct hdmi_core_packet_enable_repeat repeat_cfg; 653 struct hdmi_core_packet_enable_repeat repeat_cfg;
785 struct hdmi_config *cfg = &ip_data->cfg; 654 struct hdmi_config *cfg = &ip_data->cfg;
786 655
787 hdmi_wp_init(&video_timing, &video_format);
788
789 hdmi_core_init(&v_core_cfg, avi_cfg, &repeat_cfg); 656 hdmi_core_init(&v_core_cfg, avi_cfg, &repeat_cfg);
790 657
791 hdmi_wp_video_init_format(&video_format, &video_timing, cfg); 658 hdmi_wp_init_vid_fmt_timings(&video_format, &video_timing, cfg);
792 659
793 hdmi_wp_video_config_timing(ip_data, &video_timing); 660 hdmi_wp_video_config_timing(&ip_data->wp, &video_timing);
794 661
795 /* video config */ 662 /* video config */
796 video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422; 663 video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422;
797 664
798 hdmi_wp_video_config_format(ip_data, &video_format); 665 hdmi_wp_video_config_format(&ip_data->wp, &video_format);
799 666
800 hdmi_wp_video_config_interface(ip_data); 667 hdmi_wp_video_config_interface(&ip_data->wp, &video_timing);
801 668
802 /* 669 /*
803 * configure core video part 670 * configure core video part
@@ -850,31 +717,6 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data)
850 hdmi_core_av_packet_config(ip_data, repeat_cfg); 717 hdmi_core_av_packet_config(ip_data, repeat_cfg);
851} 718}
852 719
853void ti_hdmi_4xxx_wp_dump(struct hdmi_ip_data *ip_data, struct seq_file *s)
854{
855#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r,\
856 hdmi_read_reg(hdmi_wp_base(ip_data), r))
857
858 DUMPREG(HDMI_WP_REVISION);
859 DUMPREG(HDMI_WP_SYSCONFIG);
860 DUMPREG(HDMI_WP_IRQSTATUS_RAW);
861 DUMPREG(HDMI_WP_IRQSTATUS);
862 DUMPREG(HDMI_WP_IRQENABLE_SET);
863 DUMPREG(HDMI_WP_IRQENABLE_CLR);
864 DUMPREG(HDMI_WP_IRQWAKEEN);
865 DUMPREG(HDMI_WP_PWR_CTRL);
866 DUMPREG(HDMI_WP_DEBOUNCE);
867 DUMPREG(HDMI_WP_VIDEO_CFG);
868 DUMPREG(HDMI_WP_VIDEO_SIZE);
869 DUMPREG(HDMI_WP_VIDEO_TIMING_H);
870 DUMPREG(HDMI_WP_VIDEO_TIMING_V);
871 DUMPREG(HDMI_WP_WP_CLK);
872 DUMPREG(HDMI_WP_AUDIO_CFG);
873 DUMPREG(HDMI_WP_AUDIO_CFG2);
874 DUMPREG(HDMI_WP_AUDIO_CTRL);
875 DUMPREG(HDMI_WP_AUDIO_DATA);
876}
877
878void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s) 720void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s)
879{ 721{
880#define DUMPPLL(r) seq_printf(s, "%-35s %08x\n", #r,\ 722#define DUMPPLL(r) seq_printf(s, "%-35s %08x\n", #r,\
@@ -1071,43 +913,6 @@ void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s)
1071} 913}
1072 914
1073#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) 915#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
1074static void ti_hdmi_4xxx_wp_audio_config_format(struct hdmi_ip_data *ip_data,
1075 struct hdmi_audio_format *aud_fmt)
1076{
1077 u32 r;
1078
1079 DSSDBG("Enter hdmi_wp_audio_config_format\n");
1080
1081 r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CFG);
1082 r = FLD_MOD(r, aud_fmt->stereo_channels, 26, 24);
1083 r = FLD_MOD(r, aud_fmt->active_chnnls_msk, 23, 16);
1084 r = FLD_MOD(r, aud_fmt->en_sig_blk_strt_end, 5, 5);
1085 r = FLD_MOD(r, aud_fmt->type, 4, 4);
1086 r = FLD_MOD(r, aud_fmt->justification, 3, 3);
1087 r = FLD_MOD(r, aud_fmt->sample_order, 2, 2);
1088 r = FLD_MOD(r, aud_fmt->samples_per_word, 1, 1);
1089 r = FLD_MOD(r, aud_fmt->sample_size, 0, 0);
1090 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CFG, r);
1091}
1092
1093static void ti_hdmi_4xxx_wp_audio_config_dma(struct hdmi_ip_data *ip_data,
1094 struct hdmi_audio_dma *aud_dma)
1095{
1096 u32 r;
1097
1098 DSSDBG("Enter hdmi_wp_audio_config_dma\n");
1099
1100 r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CFG2);
1101 r = FLD_MOD(r, aud_dma->transfer_size, 15, 8);
1102 r = FLD_MOD(r, aud_dma->block_size, 7, 0);
1103 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CFG2, r);
1104
1105 r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CTRL);
1106 r = FLD_MOD(r, aud_dma->mode, 9, 9);
1107 r = FLD_MOD(r, aud_dma->fifo_threshold, 8, 0);
1108 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CTRL, r);
1109}
1110
1111static void ti_hdmi_4xxx_core_audio_config(struct hdmi_ip_data *ip_data, 916static void ti_hdmi_4xxx_core_audio_config(struct hdmi_ip_data *ip_data,
1112 struct hdmi_core_audio_config *cfg) 917 struct hdmi_core_audio_config *cfg)
1113{ 918{
@@ -1424,8 +1229,8 @@ int ti_hdmi_4xxx_audio_config(struct hdmi_ip_data *ip_data,
1424 audio_format.en_sig_blk_strt_end = HDMI_AUDIO_BLOCK_SIG_STARTEND_ON; 1229 audio_format.en_sig_blk_strt_end = HDMI_AUDIO_BLOCK_SIG_STARTEND_ON;
1425 1230
1426 /* configure DMA and audio FIFO format*/ 1231 /* configure DMA and audio FIFO format*/
1427 ti_hdmi_4xxx_wp_audio_config_dma(ip_data, &audio_dma); 1232 hdmi_wp_audio_config_dma(&ip_data->wp, &audio_dma);
1428 ti_hdmi_4xxx_wp_audio_config_format(ip_data, &audio_format); 1233 hdmi_wp_audio_config_format(&ip_data->wp, &audio_format);
1429 1234
1430 /* configure the core*/ 1235 /* configure the core*/
1431 ti_hdmi_4xxx_core_audio_config(ip_data, &core); 1236 ti_hdmi_4xxx_core_audio_config(ip_data, &core);
@@ -1436,25 +1241,13 @@ int ti_hdmi_4xxx_audio_config(struct hdmi_ip_data *ip_data,
1436 return 0; 1241 return 0;
1437} 1242}
1438 1243
1439int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data)
1440{
1441 REG_FLD_MOD(hdmi_wp_base(ip_data),
1442 HDMI_WP_AUDIO_CTRL, true, 31, 31);
1443 return 0;
1444}
1445
1446void ti_hdmi_4xxx_wp_audio_disable(struct hdmi_ip_data *ip_data)
1447{
1448 REG_FLD_MOD(hdmi_wp_base(ip_data),
1449 HDMI_WP_AUDIO_CTRL, false, 31, 31);
1450}
1451
1452int ti_hdmi_4xxx_audio_start(struct hdmi_ip_data *ip_data) 1244int ti_hdmi_4xxx_audio_start(struct hdmi_ip_data *ip_data)
1453{ 1245{
1454 REG_FLD_MOD(hdmi_av_base(ip_data), 1246 REG_FLD_MOD(hdmi_av_base(ip_data),
1455 HDMI_CORE_AV_AUD_MODE, true, 0, 0); 1247 HDMI_CORE_AV_AUD_MODE, true, 0, 0);
1456 REG_FLD_MOD(hdmi_wp_base(ip_data), 1248
1457 HDMI_WP_AUDIO_CTRL, true, 30, 30); 1249 hdmi_wp_audio_core_req_enable(&ip_data->wp, true);
1250
1458 return 0; 1251 return 0;
1459} 1252}
1460 1253
@@ -1462,8 +1255,8 @@ void ti_hdmi_4xxx_audio_stop(struct hdmi_ip_data *ip_data)
1462{ 1255{
1463 REG_FLD_MOD(hdmi_av_base(ip_data), 1256 REG_FLD_MOD(hdmi_av_base(ip_data),
1464 HDMI_CORE_AV_AUD_MODE, false, 0, 0); 1257 HDMI_CORE_AV_AUD_MODE, false, 0, 0);
1465 REG_FLD_MOD(hdmi_wp_base(ip_data), 1258
1466 HDMI_WP_AUDIO_CTRL, false, 30, 30); 1259 hdmi_wp_audio_core_req_enable(&ip_data->wp, false);
1467} 1260}
1468 1261
1469int ti_hdmi_4xxx_audio_get_dma_port(u32 *offset, u32 *size) 1262int ti_hdmi_4xxx_audio_get_dma_port(u32 *offset, u32 *size)
@@ -1474,4 +1267,5 @@ int ti_hdmi_4xxx_audio_get_dma_port(u32 *offset, u32 *size)
1474 *size = 4; 1267 *size = 4;
1475 return 0; 1268 return 0;
1476} 1269}
1270
1477#endif 1271#endif
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h
index b25269c64123..dc49713a894b 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h
@@ -226,18 +226,6 @@
226#define HDMI_TXPHY_POWER_CTRL 0x8 226#define HDMI_TXPHY_POWER_CTRL 0x8
227#define HDMI_TXPHY_PAD_CFG_CTRL 0xC 227#define HDMI_TXPHY_PAD_CFG_CTRL 0xC
228 228
229#define REG_FLD_MOD(base, idx, val, start, end) \
230 hdmi_write_reg(base, idx, FLD_MOD(hdmi_read_reg(base, idx),\
231 val, start, end))
232#define REG_GET(base, idx, start, end) \
233 FLD_GET(hdmi_read_reg(base, idx), start, end)
234
235enum hdmi_phy_pwr {
236 HDMI_PHYPWRCMD_OFF = 0,
237 HDMI_PHYPWRCMD_LDOON = 1,
238 HDMI_PHYPWRCMD_TXON = 2
239};
240
241enum hdmi_core_inputbus_width { 229enum hdmi_core_inputbus_width {
242 HDMI_INPUT_8BIT = 0, 230 HDMI_INPUT_8BIT = 0,
243 HDMI_INPUT_10BIT = 1, 231 HDMI_INPUT_10BIT = 1,
@@ -328,13 +316,6 @@ enum hdmi_core_infoframe {
328 HDMI_INFOFRAME_AVI_DB5PR_10 = 9, 316 HDMI_INFOFRAME_AVI_DB5PR_10 = 9,
329}; 317};
330 318
331enum hdmi_packing_mode {
332 HDMI_PACK_10b_RGB_YUV444 = 0,
333 HDMI_PACK_24b_RGB_YUV444_YUV422 = 1,
334 HDMI_PACK_20b_YUV422 = 2,
335 HDMI_PACK_ALREADYPACKED = 7
336};
337
338enum hdmi_core_audio_layout { 319enum hdmi_core_audio_layout {
339 HDMI_AUDIO_LAYOUT_2CH = 0, 320 HDMI_AUDIO_LAYOUT_2CH = 0,
340 HDMI_AUDIO_LAYOUT_8CH = 1 321 HDMI_AUDIO_LAYOUT_8CH = 1
@@ -345,49 +326,6 @@ enum hdmi_core_cts_mode {
345 HDMI_AUDIO_CTS_MODE_SW = 1 326 HDMI_AUDIO_CTS_MODE_SW = 1
346}; 327};
347 328
348enum hdmi_stereo_channels {
349 HDMI_AUDIO_STEREO_NOCHANNELS = 0,
350 HDMI_AUDIO_STEREO_ONECHANNEL = 1,
351 HDMI_AUDIO_STEREO_TWOCHANNELS = 2,
352 HDMI_AUDIO_STEREO_THREECHANNELS = 3,
353 HDMI_AUDIO_STEREO_FOURCHANNELS = 4
354};
355
356enum hdmi_audio_type {
357 HDMI_AUDIO_TYPE_LPCM = 0,
358 HDMI_AUDIO_TYPE_IEC = 1
359};
360
361enum hdmi_audio_justify {
362 HDMI_AUDIO_JUSTIFY_LEFT = 0,
363 HDMI_AUDIO_JUSTIFY_RIGHT = 1
364};
365
366enum hdmi_audio_sample_order {
367 HDMI_AUDIO_SAMPLE_RIGHT_FIRST = 0,
368 HDMI_AUDIO_SAMPLE_LEFT_FIRST = 1
369};
370
371enum hdmi_audio_samples_perword {
372 HDMI_AUDIO_ONEWORD_ONESAMPLE = 0,
373 HDMI_AUDIO_ONEWORD_TWOSAMPLES = 1
374};
375
376enum hdmi_audio_sample_size {
377 HDMI_AUDIO_SAMPLE_16BITS = 0,
378 HDMI_AUDIO_SAMPLE_24BITS = 1
379};
380
381enum hdmi_audio_transf_mode {
382 HDMI_AUDIO_TRANSF_DMA = 0,
383 HDMI_AUDIO_TRANSF_IRQ = 1
384};
385
386enum hdmi_audio_blk_strt_end_sig {
387 HDMI_AUDIO_BLOCK_SIG_STARTEND_ON = 0,
388 HDMI_AUDIO_BLOCK_SIG_STARTEND_OFF = 1
389};
390
391enum hdmi_audio_i2s_config { 329enum hdmi_audio_i2s_config {
392 HDMI_AUDIO_I2S_MSB_SHIFTED_FIRST = 0, 330 HDMI_AUDIO_I2S_MSB_SHIFTED_FIRST = 0,
393 HDMI_AUDIO_I2S_LSB_SHIFTED_FIRST = 1, 331 HDMI_AUDIO_I2S_LSB_SHIFTED_FIRST = 1,
@@ -434,29 +372,6 @@ struct hdmi_core_packet_enable_repeat {
434 u32 generic_pkt_repeat; 372 u32 generic_pkt_repeat;
435}; 373};
436 374
437struct hdmi_video_format {
438 enum hdmi_packing_mode packing_mode;
439 u32 y_res; /* Line per panel */
440 u32 x_res; /* pixel per line */
441};
442
443struct hdmi_audio_format {
444 enum hdmi_stereo_channels stereo_channels;
445 u8 active_chnnls_msk;
446 enum hdmi_audio_type type;
447 enum hdmi_audio_justify justification;
448 enum hdmi_audio_sample_order sample_order;
449 enum hdmi_audio_samples_perword samples_per_word;
450 enum hdmi_audio_sample_size sample_size;
451 enum hdmi_audio_blk_strt_end_sig en_sig_blk_strt_end;
452};
453
454struct hdmi_audio_dma {
455 u8 transfer_size;
456 u8 block_size;
457 enum hdmi_audio_transf_mode mode;
458 u16 fifo_threshold;
459};
460 375
461struct hdmi_core_audio_i2s_config { 376struct hdmi_core_audio_i2s_config {
462 u8 in_length_bits; 377 u8 in_length_bits;