Commit 05e205429d3f73ad4f9f0d84e8a95e978237d6fd

Authored by Takashi Iwai

Merge branch 'fix/asoc' into for-linus

Showing 11 changed files Side-by-side Diff

sound/soc/atmel/atmel_ssc_dai.c
... ... @@ -848,9 +848,10 @@
848 848 if (IS_ERR(ssc))
849 849 pr_warn("Unable to parent ASoC SSC DAI on SSC: %ld\n",
850 850 PTR_ERR(ssc));
851   - else
  851 + else {
852 852 ssc_pdev->dev.parent = &(ssc->pdev->dev);
853   - ssc_free(ssc);
  853 + ssc_free(ssc);
  854 + }
854 855  
855 856 ret = platform_device_add(ssc_pdev);
856 857 if (ret < 0)
sound/soc/blackfin/bf5xx-ad1836.c
... ... @@ -75,7 +75,7 @@
75 75 .cpu_dai_name = "bfin-tdm.0",
76 76 .codec_dai_name = "ad1836-hifi",
77 77 .platform_name = "bfin-tdm-pcm-audio",
78   - .codec_name = "ad1836.0",
  78 + .codec_name = "spi0.4",
79 79 .ops = &bf5xx_ad1836_ops,
80 80 },
81 81 {
... ... @@ -84,7 +84,7 @@
84 84 .cpu_dai_name = "bfin-tdm.1",
85 85 .codec_dai_name = "ad1836-hifi",
86 86 .platform_name = "bfin-tdm-pcm-audio",
87   - .codec_name = "ad1836.0",
  87 + .codec_name = "spi0.4",
88 88 .ops = &bf5xx_ad1836_ops,
89 89 },
90 90 };
sound/soc/codecs/ad1836.c
... ... @@ -145,22 +145,22 @@
145 145 /* bit size */
146 146 switch (params_format(params)) {
147 147 case SNDRV_PCM_FORMAT_S16_LE:
148   - word_len = 3;
  148 + word_len = AD1836_WORD_LEN_16;
149 149 break;
150 150 case SNDRV_PCM_FORMAT_S20_3LE:
151   - word_len = 1;
  151 + word_len = AD1836_WORD_LEN_20;
152 152 break;
153 153 case SNDRV_PCM_FORMAT_S24_LE:
154 154 case SNDRV_PCM_FORMAT_S32_LE:
155   - word_len = 0;
  155 + word_len = AD1836_WORD_LEN_24;
156 156 break;
157 157 }
158 158  
159   - snd_soc_update_bits(codec, AD1836_DAC_CTRL1,
160   - AD1836_DAC_WORD_LEN_MASK, word_len);
  159 + snd_soc_update_bits(codec, AD1836_DAC_CTRL1, AD1836_DAC_WORD_LEN_MASK,
  160 + word_len << AD1836_DAC_WORD_LEN_OFFSET);
161 161  
162   - snd_soc_update_bits(codec, AD1836_ADC_CTRL2,
163   - AD1836_ADC_WORD_LEN_MASK, word_len);
  162 + snd_soc_update_bits(codec, AD1836_ADC_CTRL2, AD1836_ADC_WORD_LEN_MASK,
  163 + word_len << AD1836_ADC_WORD_OFFSET);
164 164  
165 165 return 0;
166 166 }
sound/soc/codecs/ad1836.h
... ... @@ -25,6 +25,7 @@
25 25 #define AD1836_DAC_SERFMT_PCK256 (0x4 << 5)
26 26 #define AD1836_DAC_SERFMT_PCK128 (0x5 << 5)
27 27 #define AD1836_DAC_WORD_LEN_MASK 0x18
  28 +#define AD1836_DAC_WORD_LEN_OFFSET 3
28 29  
29 30 #define AD1836_DAC_CTRL2 1
30 31 #define AD1836_DACL1_MUTE 0
... ... @@ -51,6 +52,7 @@
51 52 #define AD1836_ADCL2_MUTE 2
52 53 #define AD1836_ADCR2_MUTE 3
53 54 #define AD1836_ADC_WORD_LEN_MASK 0x30
  55 +#define AD1836_ADC_WORD_OFFSET 5
54 56 #define AD1836_ADC_SERFMT_MASK (7 << 6)
55 57 #define AD1836_ADC_SERFMT_PCK256 (0x4 << 6)
56 58 #define AD1836_ADC_SERFMT_PCK128 (0x5 << 6)
... ... @@ -59,6 +61,10 @@
59 61 #define AD1836_ADC_CTRL3 14
60 62  
61 63 #define AD1836_NUM_REGS 16
  64 +
  65 +#define AD1836_WORD_LEN_24 0x0
  66 +#define AD1836_WORD_LEN_20 0x1
  67 +#define AD1836_WORD_LEN_16 0x2
62 68  
63 69 #endif
sound/soc/codecs/wm8804.c
... ... @@ -680,20 +680,25 @@
680 680 #define WM8804_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
681 681 SNDRV_PCM_FMTBIT_S24_LE)
682 682  
  683 +#define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
  684 + SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \
  685 + SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | \
  686 + SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000)
  687 +
683 688 static struct snd_soc_dai_driver wm8804_dai = {
684 689 .name = "wm8804-spdif",
685 690 .playback = {
686 691 .stream_name = "Playback",
687 692 .channels_min = 2,
688 693 .channels_max = 2,
689   - .rates = SNDRV_PCM_RATE_8000_192000,
  694 + .rates = WM8804_RATES,
690 695 .formats = WM8804_FORMATS,
691 696 },
692 697 .capture = {
693 698 .stream_name = "Capture",
694 699 .channels_min = 2,
695 700 .channels_max = 2,
696   - .rates = SNDRV_PCM_RATE_8000_192000,
  701 + .rates = WM8804_RATES,
697 702 .formats = WM8804_FORMATS,
698 703 },
699 704 .ops = &wm8804_dai_ops,
sound/soc/codecs/wm8915.c
... ... @@ -1839,7 +1839,7 @@
1839 1839 int old;
1840 1840  
1841 1841 /* Disable SYSCLK while we reconfigure */
1842   - old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1);
  1842 + old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1) & WM8915_SYSCLK_ENA;
1843 1843 snd_soc_update_bits(codec, WM8915_AIF_CLOCKING_1,
1844 1844 WM8915_SYSCLK_ENA, 0);
1845 1845  
... ... @@ -2038,6 +2038,7 @@
2038 2038 break;
2039 2039 case WM8915_FLL_MCLK2:
2040 2040 reg = 1;
  2041 + break;
2041 2042 case WM8915_FLL_DACLRCLK1:
2042 2043 reg = 2;
2043 2044 break;
sound/soc/codecs/wm8962.c
... ... @@ -1999,12 +1999,12 @@
1999 1999 return 0;
2000 2000  
2001 2001 /* If the left PGA is enabled hit that VU bit... */
2002   - if (reg_cache[WM8962_PWR_MGMT_2] & WM8962_HPOUTL_PGA_ENA)
  2002 + if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTL_PGA_ENA)
2003 2003 return snd_soc_write(codec, WM8962_HPOUTL_VOLUME,
2004 2004 reg_cache[WM8962_HPOUTL_VOLUME]);
2005 2005  
2006 2006 /* ...otherwise the right. The VU is stereo. */
2007   - if (reg_cache[WM8962_PWR_MGMT_2] & WM8962_HPOUTR_PGA_ENA)
  2007 + if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTR_PGA_ENA)
2008 2008 return snd_soc_write(codec, WM8962_HPOUTR_VOLUME,
2009 2009 reg_cache[WM8962_HPOUTR_VOLUME]);
2010 2010  
sound/soc/fsl/fsl_dma.c
... ... @@ -310,7 +310,7 @@
310 310 * should allocate a DMA buffer only for the streams that are valid.
311 311 */
312 312  
313   - if (dai->driver->playback.channels_min) {
  313 + if (pcm->streams[0].substream) {
314 314 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
315 315 fsl_dma_hardware.buffer_bytes_max,
316 316 &pcm->streams[0].substream->dma_buffer);
317 317  
318 318  
... ... @@ -320,13 +320,13 @@
320 320 }
321 321 }
322 322  
323   - if (dai->driver->capture.channels_min) {
  323 + if (pcm->streams[1].substream) {
324 324 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
325 325 fsl_dma_hardware.buffer_bytes_max,
326 326 &pcm->streams[1].substream->dma_buffer);
327 327 if (ret) {
328   - snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer);
329 328 dev_err(card->dev, "can't alloc capture dma buffer\n");
  329 + snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer);
330 330 return ret;
331 331 }
332 332 }
... ... @@ -449,7 +449,8 @@
449 449 dma_private->ld_buf_phys = ld_buf_phys;
450 450 dma_private->dma_buf_phys = substream->dma_buffer.addr;
451 451  
452   - ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "DMA", dma_private);
  452 + ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "fsldma-audio",
  453 + dma_private);
453 454 if (ret) {
454 455 dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
455 456 dma_private->irq, ret);
sound/soc/samsung/i2s.c
... ... @@ -191,7 +191,7 @@
191 191 if (!i2s)
192 192 return false;
193 193  
194   - active = readl(i2s->addr + I2SMOD);
  194 + active = readl(i2s->addr + I2SCON);
195 195  
196 196 if (is_secondary(i2s))
197 197 active &= CON_TXSDMA_ACTIVE;
... ... @@ -223,7 +223,7 @@
223 223 if (!i2s)
224 224 return false;
225 225  
226   - active = readl(i2s->addr + I2SMOD) & CON_RXDMA_ACTIVE;
  226 + active = readl(i2s->addr + I2SCON) & CON_RXDMA_ACTIVE;
227 227  
228 228 return active ? true : false;
229 229 }
sound/soc/soc-cache.c
... ... @@ -466,6 +466,9 @@
466 466 static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx,
467 467 unsigned int word_size)
468 468 {
  469 + if (!base)
  470 + return -1;
  471 +
469 472 switch (word_size) {
470 473 case 1: {
471 474 const u8 *cache = base;
sound/soc/soc-dapm.c
... ... @@ -350,9 +350,9 @@
350 350 }
351 351  
352 352 /* create new dapm mixer control */
353   -static int dapm_new_mixer(struct snd_soc_dapm_context *dapm,
354   - struct snd_soc_dapm_widget *w)
  353 +static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
355 354 {
  355 + struct snd_soc_dapm_context *dapm = w->dapm;
356 356 int i, ret = 0;
357 357 size_t name_len, prefix_len;
358 358 struct snd_soc_dapm_path *path;
359 359  
... ... @@ -450,9 +450,9 @@
450 450 }
451 451  
452 452 /* create new dapm mux control */
453   -static int dapm_new_mux(struct snd_soc_dapm_context *dapm,
454   - struct snd_soc_dapm_widget *w)
  453 +static int dapm_new_mux(struct snd_soc_dapm_widget *w)
455 454 {
  455 + struct snd_soc_dapm_context *dapm = w->dapm;
456 456 struct snd_soc_dapm_path *path = NULL;
457 457 struct snd_kcontrol *kcontrol;
458 458 struct snd_card *card = dapm->card->snd_card;
... ... @@ -535,8 +535,7 @@
535 535 }
536 536  
537 537 /* create new dapm volume control */
538   -static int dapm_new_pga(struct snd_soc_dapm_context *dapm,
539   - struct snd_soc_dapm_widget *w)
  538 +static int dapm_new_pga(struct snd_soc_dapm_widget *w)
540 539 {
541 540 if (w->num_kcontrols)
542 541 dev_err(w->dapm->dev,
543 542  
... ... @@ -1826,13 +1825,13 @@
1826 1825 case snd_soc_dapm_mixer:
1827 1826 case snd_soc_dapm_mixer_named_ctl:
1828 1827 w->power_check = dapm_generic_check_power;
1829   - dapm_new_mixer(dapm, w);
  1828 + dapm_new_mixer(w);
1830 1829 break;
1831 1830 case snd_soc_dapm_mux:
1832 1831 case snd_soc_dapm_virt_mux:
1833 1832 case snd_soc_dapm_value_mux:
1834 1833 w->power_check = dapm_generic_check_power;
1835   - dapm_new_mux(dapm, w);
  1834 + dapm_new_mux(w);
1836 1835 break;
1837 1836 case snd_soc_dapm_adc:
1838 1837 case snd_soc_dapm_aif_out:
... ... @@ -1845,7 +1844,7 @@
1845 1844 case snd_soc_dapm_pga:
1846 1845 case snd_soc_dapm_out_drv:
1847 1846 w->power_check = dapm_generic_check_power;
1848   - dapm_new_pga(dapm, w);
  1847 + dapm_new_pga(w);
1849 1848 break;
1850 1849 case snd_soc_dapm_input:
1851 1850 case snd_soc_dapm_output: