summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Neri <ricardo.neri@ti.com>2011-01-13 20:11:19 -0600
committerSebastien Jan <s-jan@ti.com>2011-01-20 17:11:12 +0100
commitf0be5091747179b7bed1e6bc9fe4eac109ca2124 (patch)
tree350476f4fca2c9af95eb6ebf4db46a2952a7beee
parent138f9996bf2b1f0145f57a798ed9fa4627ac6c9e (diff)
ASoC: OMAP4: Configure audio sample rate of HDMI IP
This patch is to use the utility functions from HDMI library to configure the sample rate used for HDMI output. Supported rates are 32, 44.1 and 48kHz, which are mandatory in HDMI 1.3a. Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
-rw-r--r--sound/soc/omap/omap-hdmi.c19
-rw-r--r--sound/soc/omap/sdp4430.c3
2 files changed, 20 insertions, 2 deletions
diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c
index 7375cff67db6..83707ff71087 100644
--- a/sound/soc/omap/omap-hdmi.c
+++ b/sound/soc/omap/omap-hdmi.c
@@ -35,7 +35,8 @@
#include "omap-hdmi.h"
#define CONFIG_HDMI_NO_IP_MODULE
-#define OMAP_HDMI_RATES (SNDRV_PCM_RATE_48000)
+#define OMAP_HDMI_RATES (SNDRV_PCM_RATE_32000 | \
+ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
/* Currently, we support only 16b samples at HDMI */
#define OMAP_HDMI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE)
@@ -137,6 +138,21 @@ static int omap_hdmi_dai_hw_params(struct snd_pcm_substream *substream,
default:
err = -EINVAL;
}
+
+#ifdef CONFIG_HDMI_NO_IP_MODULE
+ err = hdmi_configure_audio_sample_rate(params_rate(params));
+ if (err < 0)
+ return err;
+ err = hdmi_configure_audio();
+ if (err < 0)
+ return err;
+#else
+ err = hdmi_audio_core.config_audio_sample_rate(HDMI_WP,
+ params_rate(params));
+ if (err < 0)
+ return err;
+#endif
+
omap_hdmi_dai_dma_params.packet_size = 0x20;
snd_soc_dai_set_dma_data(dai, substream,
@@ -224,6 +240,7 @@ void hdmi_audio_core_stub_init(void)
hdmi_audio_core.set_wait_pwr = NULL;
hdmi_audio_core.set_wait_srst = NULL;
hdmi_audio_core.read_edid = NULL;
+ hdmi_audio_core.config_audio_sample_rate = NULL;
hdmi_audio_core.ip_init = audio_stub_lib_init;
hdmi_audio_core.ip_exit = audio_stub_lib_exit;
hdmi_audio_core.module_loaded = 0;
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index 62bf2f4f07f5..b1b19092a37a 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -408,7 +408,8 @@ static struct snd_soc_dai_driver dai[] = {
.stream_name = "Playback",
.channels_min = 2,
.channels_max = 8,
- .rates = SNDRV_PCM_RATE_48000,
+ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
},
},