From 79dfc9687661c13ef95eb4c2226f3db4ccab52c9 Mon Sep 17 00:00:00 2001 From: Cliff Cai Date: Wed, 16 Sep 2009 20:25:08 -0400 Subject: ASoC: Blackfin AC97: add a few missing multichannel define handling Somewhere along the line, most of SND_BF5XX_MULTICHAN_SUPPORT handling was merged, but two places were missed (the probe/resume functions). Restore handling of this option so it gets initialized properly. Signed-off-by: Cliff Cai Signed-off-by: Mike Frysinger Signed-off-by: Mark Brown --- sound/soc/blackfin/bf5xx-ac97.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sound') diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c index 2758b9017a7..e6932297873 100644 --- a/sound/soc/blackfin/bf5xx-ac97.c +++ b/sound/soc/blackfin/bf5xx-ac97.c @@ -277,7 +277,11 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai) if (!dai->active) return 0; +#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT) + ret = sport_set_multichannel(sport, 16, 0x3FF, 1); +#else ret = sport_set_multichannel(sport, 16, 0x1F, 1); +#endif if (ret) { pr_err("SPORT is busy!\n"); return -EBUSY; @@ -334,7 +338,11 @@ static int bf5xx_ac97_probe(struct platform_device *pdev, goto sport_err; } /*SPORT works in TDM mode to simulate AC97 transfers*/ +#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT) + ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 1); +#else ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1); +#endif if (ret) { pr_err("SPORT is busy!\n"); ret = -EBUSY; -- cgit v1.2.3 From d75150d7c49db42021b8f966d2cbdc215a530208 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 16 Sep 2009 20:25:09 -0400 Subject: ASoC: bf5xx-sport: the irq save/restore funcs take an unsigned long Signed-off-by: Mike Frysinger Signed-off-by: Mark Brown --- sound/soc/blackfin/bf5xx-sport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/blackfin/bf5xx-sport.c b/sound/soc/blackfin/bf5xx-sport.c index 469ce7fab20..99051ff0954 100644 --- a/sound/soc/blackfin/bf5xx-sport.c +++ b/sound/soc/blackfin/bf5xx-sport.c @@ -326,7 +326,7 @@ static inline int sport_hook_tx_dummy(struct sport_device *sport) int sport_tx_start(struct sport_device *sport) { - unsigned flags; + unsigned long flags; pr_debug("%s: tx_run:%d, rx_run:%d\n", __func__, sport->tx_run, sport->rx_run); if (sport->tx_run) -- cgit v1.2.3 From 7d156a25bd3e8e6ff74faf02faecb5fc5fb4839e Mon Sep 17 00:00:00 2001 From: Barry Song Date: Wed, 16 Sep 2009 20:25:10 -0400 Subject: ASoC: fix typos in Blackfin headers Signed-off-by: Barry Song Signed-off-by: Mike Frysinger Signed-off-by: Mark Brown --- sound/soc/blackfin/bf5xx-ac97.h | 2 +- sound/soc/blackfin/bf5xx-i2s.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/blackfin/bf5xx-ac97.h b/sound/soc/blackfin/bf5xx-ac97.h index 3f2a911fe0c..a1f97dd809d 100644 --- a/sound/soc/blackfin/bf5xx-ac97.h +++ b/sound/soc/blackfin/bf5xx-ac97.h @@ -1,5 +1,5 @@ /* - * linux/sound/arm/bf5xx-ac97.h + * sound/soc/blackfin/bf5xx-ac97.h * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/sound/soc/blackfin/bf5xx-i2s.h b/sound/soc/blackfin/bf5xx-i2s.h index 7107d1a0b06..264ecdcba35 100644 --- a/sound/soc/blackfin/bf5xx-i2s.h +++ b/sound/soc/blackfin/bf5xx-i2s.h @@ -1,5 +1,5 @@ /* - * linux/sound/arm/bf5xx-i2s.h + * sound/soc/blackfin/bf5xx-i2s.h * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as -- cgit v1.2.3 From fab19bae0c2951ed8bc517a53848b027fead293d Mon Sep 17 00:00:00 2001 From: Barry Song Date: Wed, 16 Sep 2009 20:25:11 -0400 Subject: ASoC: Blackfin I2S: add lost platform_device parameter to resume function Commit dc7d7b830ee1 trimmed the platform_device parameter from all of the suspend functions, but it also accidentally removed it from the resume function in the Blackfin I2S driver. So restore it. Signed-off-by: Barry Song Signed-off-by: Mike Frysinger Signed-off-by: Mark Brown --- sound/soc/blackfin/bf5xx-i2s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c index 876abade27e..19539c68c05 100644 --- a/sound/soc/blackfin/bf5xx-i2s.c +++ b/sound/soc/blackfin/bf5xx-i2s.c @@ -227,7 +227,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev, return 0; } -static void bf5xx_i2s_remove(struct snd_soc_dai *dai) +static void bf5xx_i2s_remove(struct platform_device *pdev, + struct snd_soc_dai *dai) { pr_debug("%s enter\n", __func__); peripheral_free_list(&sport_req[sport_num][0]); -- cgit v1.2.3 From ad80efc469f56d41f3f4adc1b2c86bf65689ebeb Mon Sep 17 00:00:00 2001 From: Cliff Cai Date: Wed, 16 Sep 2009 20:25:12 -0400 Subject: ASoC: Blackfin I2S: fix resuming when device hasn't been used If the sound system hasn't been utilized yet and we suspend, then we attempt to save/restore using state that doesn't exist. So use a global handle instead to reconfigure properly. Signed-off-by: Cliff Cai Signed-off-by: Mike Frysinger Signed-off-by: Mark Brown --- sound/soc/blackfin/bf5xx-i2s.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'sound') diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c index 19539c68c05..1e9d161c76c 100644 --- a/sound/soc/blackfin/bf5xx-i2s.c +++ b/sound/soc/blackfin/bf5xx-i2s.c @@ -237,36 +237,31 @@ static void bf5xx_i2s_remove(struct platform_device *pdev, #ifdef CONFIG_PM static int bf5xx_i2s_suspend(struct snd_soc_dai *dai) { - struct sport_device *sport = - (struct sport_device *)dai->private_data; pr_debug("%s : sport %d\n", __func__, dai->id); - if (!dai->active) - return 0; + if (dai->capture.active) - sport_rx_stop(sport); + sport_rx_stop(sport_handle); if (dai->playback.active) - sport_tx_stop(sport); + sport_tx_stop(sport_handle); return 0; } static int bf5xx_i2s_resume(struct snd_soc_dai *dai) { int ret; - struct sport_device *sport = - (struct sport_device *)dai->private_data; pr_debug("%s : sport %d\n", __func__, dai->id); - if (!dai->active) - return 0; - ret = sport_config_rx(sport, RFSR | RCKFE, RSFSE|0x1f, 0, 0); + ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1, + bf5xx_i2s.rcr2, 0, 0); if (ret) { pr_err("SPORT is busy!\n"); return -EBUSY; } - ret = sport_config_tx(sport, TFSR | TCKFE, TSFSE|0x1f, 0, 0); + ret = sport_config_tx(sport_handle, bf5xx_i2s.tcr1, + bf5xx_i2s.tcr2, 0, 0); if (ret) { pr_err("SPORT is busy!\n"); return -EBUSY; -- cgit v1.2.3 From 0c31cf3e4af79ea18bbd365b07ef0de207673894 Mon Sep 17 00:00:00 2001 From: Chaithrika U S Date: Tue, 15 Sep 2009 18:13:29 -0400 Subject: ASoC: DaVinci: Fixes to McASP configuration McASP register settings are not correct for DSP mode of operation. There is a channel swap initally. This patch provides fixes to the register values for proper working. Tested on DA830/OMAP-L137 EVM, DM6467 EVM. Signed-off-by: Chaithrika U S Signed-off-by: Mark Brown --- sound/soc/davinci/davinci-mcasp.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index eca22d7829d..7a06c0a8666 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -512,34 +512,49 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev, int channel_size) { u32 fmt = 0; + u32 mask, rotate; switch (channel_size) { case DAVINCI_AUDIO_WORD_8: fmt = 0x03; + rotate = 6; + mask = 0x000000ff; break; case DAVINCI_AUDIO_WORD_12: fmt = 0x05; + rotate = 5; + mask = 0x00000fff; break; case DAVINCI_AUDIO_WORD_16: fmt = 0x07; + rotate = 4; + mask = 0x0000ffff; break; case DAVINCI_AUDIO_WORD_20: fmt = 0x09; + rotate = 3; + mask = 0x000fffff; break; case DAVINCI_AUDIO_WORD_24: fmt = 0x0B; + rotate = 2; + mask = 0x00ffffff; break; case DAVINCI_AUDIO_WORD_28: fmt = 0x0D; + rotate = 1; + mask = 0x0fffffff; break; case DAVINCI_AUDIO_WORD_32: fmt = 0x0F; + rotate = 0; + mask = 0xffffffff; break; default: @@ -550,6 +565,13 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev, RXSSZ(fmt), RXSSZ(0x0F)); mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXSSZ(fmt), TXSSZ(0x0F)); + mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXROT(rotate), + TXROT(7)); + mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, RXROT(rotate), + RXROT(7)); + mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, mask); + mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG, mask); + return 0; } @@ -638,7 +660,6 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) printk(KERN_ERR "playback tdm slot %d not supported\n", dev->tdm_slots); - mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, 0xFFFFFFFF); mcasp_clr_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, FSXDUR); } else { /* bit stream is MSB first with no delay */ @@ -655,7 +676,6 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) printk(KERN_ERR "capture tdm slot %d not supported\n", dev->tdm_slots); - mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG, 0xFFFFFFFF); mcasp_clr_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG, FSRDUR); } } -- cgit v1.2.3 From 98235a4bb01f288c82f7b878996e507f6159fd69 Mon Sep 17 00:00:00 2001 From: Barry Song <21cnbao@gmail.com> Date: Mon, 21 Sep 2009 11:20:51 +0800 Subject: ASoC: some minor changes for AD1836 and AD1938 codec drivers 1. delete redundant assignment to bus field in spi_driver structure 2. fix lost assignment to set_bias_level entry in ad1938 codec dai 3. change spi driver name of ad1836 from "ad1836-spi" to "ad1836" Signed-off-by: Barry Song Signed-off-by: Mark Brown --- sound/soc/codecs/ad1836.c | 3 +-- sound/soc/codecs/ad1938.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c index 01343dc984f..c48485f2c55 100644 --- a/sound/soc/codecs/ad1836.c +++ b/sound/soc/codecs/ad1836.c @@ -251,8 +251,7 @@ static int __devexit ad1836_spi_remove(struct spi_device *spi) static struct spi_driver ad1836_spi_driver = { .driver = { - .name = "ad1836-spi", - .bus = &spi_bus_type, + .name = "ad1836", .owner = THIS_MODULE, }, .probe = ad1836_spi_probe, diff --git a/sound/soc/codecs/ad1938.c b/sound/soc/codecs/ad1938.c index 9a049a1995a..34b30efc3cb 100644 --- a/sound/soc/codecs/ad1938.c +++ b/sound/soc/codecs/ad1938.c @@ -456,7 +456,6 @@ static int __devexit ad1938_spi_remove(struct spi_device *spi) static struct spi_driver ad1938_spi_driver = { .driver = { .name = "ad1938", - .bus = &spi_bus_type, .owner = THIS_MODULE, }, .probe = ad1938_spi_probe, @@ -515,6 +514,7 @@ static int ad1938_register(struct ad1938_priv *ad1938) codec->num_dai = 1; codec->write = ad1938_write_reg; codec->read = ad1938_read_reg_cache; + codec->set_bias_level = ad1938_set_bias_level; INIT_LIST_HEAD(&codec->dapm_widgets); INIT_LIST_HEAD(&codec->dapm_paths); -- cgit v1.2.3 From 877ae70763fa0b19ffbe25e7e119fc96f52fbbd3 Mon Sep 17 00:00:00 2001 From: Phil Vandry Date: Mon, 21 Sep 2009 11:36:08 -0400 Subject: ASoC: wm8753: fix mapping when MONOMIX is set to Stereo When MONOMIX is set to Stereo, Left PGA was not powered on but should be. Add a mapping from Capture Left Mux to Capture Left Mixer to fix the issue. Signed-off-by: Phil Vandry Signed-off-by: Mark Brown --- sound/soc/codecs/wm8753.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index d80d414cfbb..5ad677ce80d 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c @@ -595,6 +595,7 @@ static const struct snd_soc_dapm_route audio_map[] = { /* Mono Capture mixer-mux */ {"Capture Right Mixer", "Stereo", "Capture Right Mux"}, + {"Capture Left Mixer", "Stereo", "Capture Left Mux"}, {"Capture Left Mixer", "Analogue Mix Left", "Capture Left Mux"}, {"Capture Left Mixer", "Analogue Mix Left", "Capture Right Mux"}, {"Capture Right Mixer", "Analogue Mix Right", "Capture Left Mux"}, -- cgit v1.2.3