Commit fe61c99a authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ASoC: wm8753: fix mapping when MONOMIX is set to Stereo
  ASoC: some minor changes for AD1836 and AD1938 codec drivers
  ASoC: DaVinci: Fixes to McASP configuration
  ASoC: Blackfin I2S: fix resuming when device hasn't been used
  ASoC: Blackfin I2S: add lost platform_device parameter to resume function
  ASoC: fix typos in Blackfin headers
  ASoC: bf5xx-sport: the irq save/restore funcs take an unsigned long
  ASoC: Blackfin AC97: add a few missing multichannel define handling
parents 9fd815b5 877ae707
...@@ -277,7 +277,11 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai) ...@@ -277,7 +277,11 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
if (!dai->active) if (!dai->active)
return 0; 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); ret = sport_set_multichannel(sport, 16, 0x1F, 1);
#endif
if (ret) { if (ret) {
pr_err("SPORT is busy!\n"); pr_err("SPORT is busy!\n");
return -EBUSY; return -EBUSY;
...@@ -334,7 +338,11 @@ static int bf5xx_ac97_probe(struct platform_device *pdev, ...@@ -334,7 +338,11 @@ static int bf5xx_ac97_probe(struct platform_device *pdev,
goto sport_err; goto sport_err;
} }
/*SPORT works in TDM mode to simulate AC97 transfers*/ /*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); ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1);
#endif
if (ret) { if (ret) {
pr_err("SPORT is busy!\n"); pr_err("SPORT is busy!\n");
ret = -EBUSY; ret = -EBUSY;
......
/* /*
* linux/sound/arm/bf5xx-ac97.h * sound/soc/blackfin/bf5xx-ac97.h
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
......
...@@ -227,7 +227,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev, ...@@ -227,7 +227,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev,
return 0; 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__); pr_debug("%s enter\n", __func__);
peripheral_free_list(&sport_req[sport_num][0]); peripheral_free_list(&sport_req[sport_num][0]);
...@@ -236,36 +237,31 @@ static void bf5xx_i2s_remove(struct snd_soc_dai *dai) ...@@ -236,36 +237,31 @@ static void bf5xx_i2s_remove(struct snd_soc_dai *dai)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int bf5xx_i2s_suspend(struct snd_soc_dai *dai) 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); pr_debug("%s : sport %d\n", __func__, dai->id);
if (!dai->active)
return 0;
if (dai->capture.active) if (dai->capture.active)
sport_rx_stop(sport); sport_rx_stop(sport_handle);
if (dai->playback.active) if (dai->playback.active)
sport_tx_stop(sport); sport_tx_stop(sport_handle);
return 0; return 0;
} }
static int bf5xx_i2s_resume(struct snd_soc_dai *dai) static int bf5xx_i2s_resume(struct snd_soc_dai *dai)
{ {
int ret; int ret;
struct sport_device *sport =
(struct sport_device *)dai->private_data;
pr_debug("%s : sport %d\n", __func__, dai->id); 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) { if (ret) {
pr_err("SPORT is busy!\n"); pr_err("SPORT is busy!\n");
return -EBUSY; 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) { if (ret) {
pr_err("SPORT is busy!\n"); pr_err("SPORT is busy!\n");
return -EBUSY; return -EBUSY;
......
/* /*
* linux/sound/arm/bf5xx-i2s.h * sound/soc/blackfin/bf5xx-i2s.h
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
......
...@@ -326,7 +326,7 @@ static inline int sport_hook_tx_dummy(struct sport_device *sport) ...@@ -326,7 +326,7 @@ static inline int sport_hook_tx_dummy(struct sport_device *sport)
int sport_tx_start(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__, pr_debug("%s: tx_run:%d, rx_run:%d\n", __func__,
sport->tx_run, sport->rx_run); sport->tx_run, sport->rx_run);
if (sport->tx_run) if (sport->tx_run)
......
...@@ -251,8 +251,7 @@ static int __devexit ad1836_spi_remove(struct spi_device *spi) ...@@ -251,8 +251,7 @@ static int __devexit ad1836_spi_remove(struct spi_device *spi)
static struct spi_driver ad1836_spi_driver = { static struct spi_driver ad1836_spi_driver = {
.driver = { .driver = {
.name = "ad1836-spi", .name = "ad1836",
.bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = ad1836_spi_probe, .probe = ad1836_spi_probe,
......
...@@ -456,7 +456,6 @@ static int __devexit ad1938_spi_remove(struct spi_device *spi) ...@@ -456,7 +456,6 @@ static int __devexit ad1938_spi_remove(struct spi_device *spi)
static struct spi_driver ad1938_spi_driver = { static struct spi_driver ad1938_spi_driver = {
.driver = { .driver = {
.name = "ad1938", .name = "ad1938",
.bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = ad1938_spi_probe, .probe = ad1938_spi_probe,
...@@ -515,6 +514,7 @@ static int ad1938_register(struct ad1938_priv *ad1938) ...@@ -515,6 +514,7 @@ static int ad1938_register(struct ad1938_priv *ad1938)
codec->num_dai = 1; codec->num_dai = 1;
codec->write = ad1938_write_reg; codec->write = ad1938_write_reg;
codec->read = ad1938_read_reg_cache; 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_widgets);
INIT_LIST_HEAD(&codec->dapm_paths); INIT_LIST_HEAD(&codec->dapm_paths);
......
...@@ -595,6 +595,7 @@ static const struct snd_soc_dapm_route audio_map[] = { ...@@ -595,6 +595,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
/* Mono Capture mixer-mux */ /* Mono Capture mixer-mux */
{"Capture Right Mixer", "Stereo", "Capture Right 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 Left Mux"},
{"Capture Left Mixer", "Analogue Mix Left", "Capture Right Mux"}, {"Capture Left Mixer", "Analogue Mix Left", "Capture Right Mux"},
{"Capture Right Mixer", "Analogue Mix Right", "Capture Left Mux"}, {"Capture Right Mixer", "Analogue Mix Right", "Capture Left Mux"},
......
...@@ -512,34 +512,49 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev, ...@@ -512,34 +512,49 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
int channel_size) int channel_size)
{ {
u32 fmt = 0; u32 fmt = 0;
u32 mask, rotate;
switch (channel_size) { switch (channel_size) {
case DAVINCI_AUDIO_WORD_8: case DAVINCI_AUDIO_WORD_8:
fmt = 0x03; fmt = 0x03;
rotate = 6;
mask = 0x000000ff;
break; break;
case DAVINCI_AUDIO_WORD_12: case DAVINCI_AUDIO_WORD_12:
fmt = 0x05; fmt = 0x05;
rotate = 5;
mask = 0x00000fff;
break; break;
case DAVINCI_AUDIO_WORD_16: case DAVINCI_AUDIO_WORD_16:
fmt = 0x07; fmt = 0x07;
rotate = 4;
mask = 0x0000ffff;
break; break;
case DAVINCI_AUDIO_WORD_20: case DAVINCI_AUDIO_WORD_20:
fmt = 0x09; fmt = 0x09;
rotate = 3;
mask = 0x000fffff;
break; break;
case DAVINCI_AUDIO_WORD_24: case DAVINCI_AUDIO_WORD_24:
fmt = 0x0B; fmt = 0x0B;
rotate = 2;
mask = 0x00ffffff;
break; break;
case DAVINCI_AUDIO_WORD_28: case DAVINCI_AUDIO_WORD_28:
fmt = 0x0D; fmt = 0x0D;
rotate = 1;
mask = 0x0fffffff;
break; break;
case DAVINCI_AUDIO_WORD_32: case DAVINCI_AUDIO_WORD_32:
fmt = 0x0F; fmt = 0x0F;
rotate = 0;
mask = 0xffffffff;
break; break;
default: default:
...@@ -550,6 +565,13 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev, ...@@ -550,6 +565,13 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
RXSSZ(fmt), RXSSZ(0x0F)); RXSSZ(fmt), RXSSZ(0x0F));
mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
TXSSZ(fmt), TXSSZ(0x0F)); 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; return 0;
} }
...@@ -638,7 +660,6 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) ...@@ -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", printk(KERN_ERR "playback tdm slot %d not supported\n",
dev->tdm_slots); dev->tdm_slots);
mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, 0xFFFFFFFF);
mcasp_clr_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, FSXDUR); mcasp_clr_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, FSXDUR);
} else { } else {
/* bit stream is MSB first with no delay */ /* bit stream is MSB first with no delay */
...@@ -655,7 +676,6 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) ...@@ -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", printk(KERN_ERR "capture tdm slot %d not supported\n",
dev->tdm_slots); dev->tdm_slots);
mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG, 0xFFFFFFFF);
mcasp_clr_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG, FSRDUR); mcasp_clr_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG, FSRDUR);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment