aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-08-31 01:46:41 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-09-01 06:17:49 -0400
commit6d86577124bd674209954517a074a472456c758b (patch)
tree2f8d768d6e76adf7dd9090eed9dac3f3fc9b8716
parentc88e7b93a80bd46899c4cb09a9b2d52bb04d79bd (diff)
fbdev: sh-mobile: Add HDMI sound type selection
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/video/sh_mobile_hdmi.c21
-rw-r--r--include/video/sh_mobile_hdmi.h16
2 files changed, 36 insertions, 1 deletions
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
index 2fde08cc66bf..8a05c5b0b9b8 100644
--- a/drivers/video/sh_mobile_hdmi.c
+++ b/drivers/video/sh_mobile_hdmi.c
@@ -318,6 +318,9 @@ static void sh_hdmi_video_config(struct sh_hdmi *hdmi)
318 */ 318 */
319static void sh_hdmi_audio_config(struct sh_hdmi *hdmi) 319static void sh_hdmi_audio_config(struct sh_hdmi *hdmi)
320{ 320{
321 u8 data;
322 struct sh_mobile_hdmi_info *pdata = hdmi->dev->platform_data;
323
321 /* 324 /*
322 * [7:4] L/R data swap control 325 * [7:4] L/R data swap control
323 * [3:0] appropriate N[19:16] 326 * [3:0] appropriate N[19:16]
@@ -335,7 +338,23 @@ static void sh_hdmi_audio_config(struct sh_hdmi *hdmi)
335 * [6:5] set required down sampling rate if required 338 * [6:5] set required down sampling rate if required
336 * [4:3] set required audio source 339 * [4:3] set required audio source
337 */ 340 */
338 hdmi_write(hdmi, 0x00, HDMI_AUDIO_SETTING_1); 341 switch (pdata->flags & HDMI_SRC_MASK) {
342 default:
343 /* FALL THROUGH */
344 case HDMI_SRC_I2S:
345 data = (0x0 << 3);
346 break;
347 case HDMI_SRC_SPDIF:
348 data = (0x1 << 3);
349 break;
350 case HDMI_SRC_DSD:
351 data = (0x2 << 3);
352 break;
353 case HDMI_SRC_HBR:
354 data = (0x3 << 3);
355 break;
356 }
357 hdmi_write(hdmi, data, HDMI_AUDIO_SETTING_1);
339 358
340 /* [3:0] set sending channel number for channel status */ 359 /* [3:0] set sending channel number for channel status */
341 hdmi_write(hdmi, 0x40, HDMI_AUDIO_SETTING_2); 360 hdmi_write(hdmi, 0x40, HDMI_AUDIO_SETTING_2);
diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h
index 577cf18cce89..929c2d3147bc 100644
--- a/include/video/sh_mobile_hdmi.h
+++ b/include/video/sh_mobile_hdmi.h
@@ -14,9 +14,25 @@
14struct sh_mobile_lcdc_chan_cfg; 14struct sh_mobile_lcdc_chan_cfg;
15struct device; 15struct device;
16 16
17/*
18 * flags format
19 *
20 * 0x0000000A
21 *
22 * A: Audio source select
23 */
24
25/* Audio source select */
26#define HDMI_SRC_MASK (0xF << 0)
27#define HDMI_SRC_I2S (0 << 0) /* default */
28#define HDMI_SRC_SPDIF (1 << 0)
29#define HDMI_SRC_DSD (2 << 0)
30#define HDMI_SRC_HBR (3 << 0)
31
17struct sh_mobile_hdmi_info { 32struct sh_mobile_hdmi_info {
18 struct sh_mobile_lcdc_chan_cfg *lcd_chan; 33 struct sh_mobile_lcdc_chan_cfg *lcd_chan;
19 struct device *lcd_dev; 34 struct device *lcd_dev;
35 unsigned int flags;
20}; 36};
21 37
22#endif 38#endif