summaryrefslogtreecommitdiffstats
path: root/drivers/sound/sound.c
diff options
context:
space:
mode:
authorDani Krishna Mohan <krishna.md@samsung.com>2013-09-11 16:38:50 +0530
committerTom Rini <trini@ti.com>2013-09-24 09:10:33 -0400
commit6b40852da5c8dd710f9d61204affff3c6a3c9d22 (patch)
treee2d4c08d9916605c397fb98ee4becf7f3512a9c9 /drivers/sound/sound.c
parent5fb5b1554172167a4295880ac71439aa3e88f2b8 (diff)
downloadu-boot-6b40852da5c8dd710f9d61204affff3c6a3c9d22.tar.gz
u-boot-6b40852da5c8dd710f9d61204affff3c6a3c9d22.tar.xz
u-boot-6b40852da5c8dd710f9d61204affff3c6a3c9d22.zip
Sound: MAX98095: Support I2S0 channel
This patch modifies the MAX98095 audio 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, 9 insertions, 8 deletions
diff --git a/drivers/sound/sound.c b/drivers/sound/sound.c
index f3342f23f1..9b8ce5a9ef 100644
--- a/drivers/sound/sound.c
+++ b/drivers/sound/sound.c
@@ -116,7 +116,7 @@ static int codec_init(const void *blob, struct i2stx_info *pi2s_tx)
int node;
/* Get the node from FDT for sound */
- 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");
debug("node = %d\n", node);
@@ -136,13 +136,14 @@ static int codec_init(const void *blob, struct i2stx_info *pi2s_tx)
if (!strcmp(codectype, "wm8994")) {
/* Check the codec type and initialise the same */
ret = wm8994_init(blob, pi2s_tx->id + 1,
- pi2s_tx->samplingrate,
- (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
- pi2s_tx->bitspersample, pi2s_tx->channels);
+ 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)),
- pi2s_tx->bitspersample);
+ ret = max98095_init(blob, pi2s_tx->id + 1,
+ pi2s_tx->samplingrate,
+ (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
+ pi2s_tx->bitspersample);
} else {
debug("%s: Unknown codec type %s\n", __func__, codectype);
return -1;
@@ -235,7 +236,7 @@ int sound_play(uint32_t msec, uint32_t frequency)
}
sound_prepare_buffer((unsigned short *)data,
- data_size / sizeof(unsigned short), frequency);
+ data_size / sizeof(unsigned short), frequency);
while (msec >= 1000) {
ret = i2s_transfer_tx_data(&g_i2stx_pri, data,