summaryrefslogtreecommitdiff
path: root/drivers/sound/sound.c
diff options
context:
space:
mode:
authorDani Krishna Mohan <krishna.md@samsung.com>2013-09-11 16:38:46 +0530
committerTom Rini <trini@ti.com>2013-09-24 09:10:33 -0400
commitd981d80d743623d50e10de77dfe013263aa0c866 (patch)
treea9067d2c9269a1d81d021125ee9b1d34f29bf044 /drivers/sound/sound.c
parentd7884e047d08447dfd1374e9fa2fdf7ab36e56f5 (diff)
downloadu-boot-imx-d981d80d743623d50e10de77dfe013263aa0c866.zip
u-boot-imx-d981d80d743623d50e10de77dfe013263aa0c866.tar.gz
u-boot-imx-d981d80d743623d50e10de77dfe013263aa0c866.tar.bz2
Sound: WM8994: Support I2S0 channel
This patch modifies the WM8994 codec to support I2S0 channel in codec slave mode Signed-off-by: Dani Krishna Mohan <krishna.md@samsung.com>
Diffstat (limited to 'drivers/sound/sound.c')
-rw-r--r--drivers/sound/sound.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/sound/sound.c b/drivers/sound/sound.c
index 6fcc75d..f3342f2 100644
--- a/drivers/sound/sound.c
+++ b/drivers/sound/sound.c
@@ -36,8 +36,7 @@ static int get_sound_i2s_values(struct i2stx_info *i2s, const void *blob)
int error = 0;
int base;
- node = fdtdec_next_compatible(blob, 0,
- COMPAT_SAMSUNG_EXYNOS5_SOUND);
+ node = fdt_path_offset(blob, "i2s");
if (node <= 0) {
debug("EXYNOS_SOUND: No node for sound in device tree\n");
return -1;
@@ -80,6 +79,11 @@ static int get_sound_i2s_values(struct i2stx_info *i2s, const void *blob)
node, "samsung,i2s-bit-clk-framesize", -1);
error |= i2s->bfs;
debug("bfs = %d\n", i2s->bfs);
+
+ i2s->id = fdtdec_get_int(blob, node, "samsung,i2s-id", -1);
+ error |= i2s->id;
+ debug("id = %d\n", i2s->id);
+
if (error == -1) {
debug("fail to get sound i2s node properties\n");
return -1;
@@ -92,6 +96,7 @@ static int get_sound_i2s_values(struct i2stx_info *i2s, const void *blob)
i2s->channels = I2S_CHANNELS;
i2s->rfs = I2S_RFS;
i2s->bfs = I2S_BFS;
+ i2s->id = 0;
#endif
return 0;
}
@@ -130,10 +135,10 @@ static int codec_init(const void *blob, struct i2stx_info *pi2s_tx)
#endif
if (!strcmp(codectype, "wm8994")) {
/* Check the codec type and initialise the same */
- ret = wm8994_init(blob, WM8994_AIF2,
- pi2s_tx->samplingrate,
- (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
- pi2s_tx->bitspersample, pi2s_tx->channels);
+ ret = wm8994_init(blob, pi2s_tx->id + 1,
+ pi2s_tx->samplingrate,
+ (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
+ pi2s_tx->bitspersample, pi2s_tx->channels);
} else if (!strcmp(codectype, "max98095")) {
ret = max98095_init(blob, pi2s_tx->samplingrate,
(pi2s_tx->samplingrate * (pi2s_tx->rfs)),