diff --git a/[refs] b/[refs] index 36a700daedaf..c78c1d22e8c8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: aa983d9d63c38f596fb87754205da9b7a8d2f6fd +refs/heads/master: bb26276744a80d066681836f4d49c70010b129d6 diff --git a/trunk/include/sound/soc-dai.h b/trunk/include/sound/soc-dai.h index ca24e7f7a3f5..e0c7fa7b1060 100644 --- a/trunk/include/sound/soc-dai.h +++ b/trunk/include/sound/soc-dai.h @@ -30,7 +30,6 @@ struct snd_pcm_substream; #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ -#define SND_SOC_DAIFMT_PDM 6 /* Pulse density modulation */ /* left and right justified also known as MSB and LSB respectively */ #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J diff --git a/trunk/sound/soc/codecs/wm8711.c b/trunk/sound/soc/codecs/wm8711.c index ae083eb92fb7..90ec8c58e2f4 100644 --- a/trunk/sound/soc/codecs/wm8711.c +++ b/trunk/sound/soc/codecs/wm8711.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -632,9 +633,9 @@ static int __init wm8711_modinit(void) } #endif #if defined(CONFIG_SPI_MASTER) - ret = spi_register_driver(&wm8731_spi_driver); + ret = spi_register_driver(&wm8711_spi_driver); if (ret != 0) { - printk(KERN_ERR "Failed to register WM8731 SPI driver: %d\n", + printk(KERN_ERR "Failed to register WM8711 SPI driver: %d\n", ret); } #endif @@ -648,7 +649,7 @@ static void __exit wm8711_exit(void) i2c_del_driver(&wm8711_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER) - spi_unregister_driver(&wm8731_spi_driver); + spi_unregister_driver(&wm8711_spi_driver); #endif } module_exit(wm8711_exit); diff --git a/trunk/sound/soc/codecs/wm8974.c b/trunk/sound/soc/codecs/wm8974.c index eff29331235b..93d66e30f109 100644 --- a/trunk/sound/soc/codecs/wm8974.c +++ b/trunk/sound/soc/codecs/wm8974.c @@ -281,38 +281,36 @@ static int wm8974_add_widgets(struct snd_soc_codec *codec) } struct pll_ { - unsigned int pre_div:1; + unsigned int pre_div:4; /* prescale - 1 */ unsigned int n:4; unsigned int k; }; +static struct pll_ pll_div; + /* The size in bits of the pll divide multiplied by 10 * to allow rounding later */ #define FIXED_PLL_SIZE ((1 << 24) * 10) -static void pll_factors(struct pll_ *pll_div, - unsigned int target, unsigned int source) +static void pll_factors(unsigned int target, unsigned int source) { unsigned long long Kpart; unsigned int K, Ndiv, Nmod; - /* There is a fixed divide by 4 in the output path */ - target *= 4; - Ndiv = target / source; if (Ndiv < 6) { - source /= 2; - pll_div->pre_div = 1; + source >>= 1; + pll_div.pre_div = 1; Ndiv = target / source; } else - pll_div->pre_div = 0; + pll_div.pre_div = 0; if ((Ndiv < 6) || (Ndiv > 12)) printk(KERN_WARNING "WM8974 N value %u outwith recommended range!\n", Ndiv); - pll_div->n = Ndiv; + pll_div.n = Ndiv; Nmod = target % source; Kpart = FIXED_PLL_SIZE * (long long)Nmod; @@ -327,14 +325,13 @@ static void pll_factors(struct pll_ *pll_div, /* Move down to proper range now rounding is done */ K /= 10; - pll_div->k = K; + pll_div.k = K; } static int wm8974_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, int source, unsigned int freq_in, unsigned int freq_out) { struct snd_soc_codec *codec = codec_dai->codec; - struct pll_ pll_div; u16 reg; if (freq_in == 0 || freq_out == 0) { @@ -348,7 +345,7 @@ static int wm8974_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, return 0; } - pll_factors(&pll_div, freq_out, freq_in); + pll_factors(freq_out*4, freq_in); snd_soc_write(codec, WM8974_PLLN, (pll_div.pre_div << 4) | pll_div.n); snd_soc_write(codec, WM8974_PLLK1, pll_div.k >> 18); diff --git a/trunk/sound/soc/codecs/wm8993.c b/trunk/sound/soc/codecs/wm8993.c index dac397712147..6b32a2852603 100644 --- a/trunk/sound/soc/codecs/wm8993.c +++ b/trunk/sound/soc/codecs/wm8993.c @@ -1572,15 +1572,33 @@ static int wm8993_i2c_probe(struct i2c_client *i2c, /* Use automatic clock configuration */ snd_soc_update_bits(codec, WM8993_CLOCKING_4, WM8993_SR_MODE, 0); - wm_hubs_handle_analogue_pdata(codec, wm8993->pdata.lineout1_diff, - wm8993->pdata.lineout2_diff, - wm8993->pdata.lineout1fb, - wm8993->pdata.lineout2fb, - wm8993->pdata.jd_scthr, - wm8993->pdata.jd_thr, - wm8993->pdata.micbias1_lvl, - wm8993->pdata.micbias2_lvl); - + if (!wm8993->pdata.lineout1_diff) + snd_soc_update_bits(codec, WM8993_LINE_MIXER1, + WM8993_LINEOUT1_MODE, + WM8993_LINEOUT1_MODE); + if (!wm8993->pdata.lineout2_diff) + snd_soc_update_bits(codec, WM8993_LINE_MIXER2, + WM8993_LINEOUT2_MODE, + WM8993_LINEOUT2_MODE); + + if (wm8993->pdata.lineout1fb) + snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, + WM8993_LINEOUT1_FB, WM8993_LINEOUT1_FB); + + if (wm8993->pdata.lineout2fb) + snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, + WM8993_LINEOUT2_FB, WM8993_LINEOUT2_FB); + + /* Apply the microphone bias/detection configuration - the + * platform data is directly applicable to the register. */ + snd_soc_update_bits(codec, WM8993_MICBIAS, + WM8993_JD_SCTHR_MASK | WM8993_JD_THR_MASK | + WM8993_MICB1_LVL | WM8993_MICB2_LVL, + wm8993->pdata.jd_scthr << WM8993_JD_SCTHR_SHIFT | + wm8993->pdata.jd_thr << WM8993_JD_THR_SHIFT | + wm8993->pdata.micbias1_lvl | + wm8993->pdata.micbias1_lvl << 1); + ret = wm8993_set_bias_level(codec, SND_SOC_BIAS_STANDBY); if (ret != 0) goto err; diff --git a/trunk/sound/soc/codecs/wm_hubs.c b/trunk/sound/soc/codecs/wm_hubs.c index 810a563d0ebf..e542027eea89 100644 --- a/trunk/sound/soc/codecs/wm_hubs.c +++ b/trunk/sound/soc/codecs/wm_hubs.c @@ -738,41 +738,6 @@ int wm_hubs_add_analogue_routes(struct snd_soc_codec *codec, } EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_routes); -int wm_hubs_handle_analogue_pdata(struct snd_soc_codec *codec, - int lineout1_diff, int lineout2_diff, - int lineout1fb, int lineout2fb, - int jd_scthr, int jd_thr, int micbias1_lvl, - int micbias2_lvl) -{ - if (!lineout1_diff) - snd_soc_update_bits(codec, WM8993_LINE_MIXER1, - WM8993_LINEOUT1_MODE, - WM8993_LINEOUT1_MODE); - if (!lineout2_diff) - snd_soc_update_bits(codec, WM8993_LINE_MIXER2, - WM8993_LINEOUT2_MODE, - WM8993_LINEOUT2_MODE); - - if (lineout1fb) - snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, - WM8993_LINEOUT1_FB, WM8993_LINEOUT1_FB); - - if (lineout2fb) - snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, - WM8993_LINEOUT2_FB, WM8993_LINEOUT2_FB); - - snd_soc_update_bits(codec, WM8993_MICBIAS, - WM8993_JD_SCTHR_MASK | WM8993_JD_THR_MASK | - WM8993_MICB1_LVL | WM8993_MICB2_LVL, - jd_scthr << WM8993_JD_SCTHR_SHIFT | - jd_thr << WM8993_JD_THR_SHIFT | - micbias1_lvl | - micbias2_lvl << WM8993_MICB2_LVL_SHIFT); - - return 0; -} -EXPORT_SYMBOL_GPL(wm_hubs_handle_analogue_pdata); - MODULE_DESCRIPTION("Shared support for Wolfson hubs products"); MODULE_AUTHOR("Mark Brown "); MODULE_LICENSE("GPL"); diff --git a/trunk/sound/soc/codecs/wm_hubs.h b/trunk/sound/soc/codecs/wm_hubs.h index 36d3fba1de8b..ec09cb6a2939 100644 --- a/trunk/sound/soc/codecs/wm_hubs.h +++ b/trunk/sound/soc/codecs/wm_hubs.h @@ -20,10 +20,5 @@ extern const unsigned int wm_hubs_spkmix_tlv[]; extern int wm_hubs_add_analogue_controls(struct snd_soc_codec *); extern int wm_hubs_add_analogue_routes(struct snd_soc_codec *, int, int); -extern int wm_hubs_handle_analogue_pdata(struct snd_soc_codec *, - int lineout1_diff, int lineout2_diff, - int lineout1fb, int lineout2fb, - int jd_scthr, int jd_thr, - int micbias1_lvl, int micbias2_lvl); #endif diff --git a/trunk/sound/soc/davinci/davinci-i2s.c b/trunk/sound/soc/davinci/davinci-i2s.c index 2ab809359c08..4ae707048021 100644 --- a/trunk/sound/soc/davinci/davinci-i2s.c +++ b/trunk/sound/soc/davinci/davinci-i2s.c @@ -397,8 +397,6 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, } dma_params->acnt = dma_params->data_type; - dma_params->fifo_level = 0; - rcr |= DAVINCI_MCBSP_RCR_RFRLEN1(1); xcr |= DAVINCI_MCBSP_XCR_XFRLEN1(1); diff --git a/trunk/sound/soc/davinci/davinci-mcasp.c b/trunk/sound/soc/davinci/davinci-mcasp.c index 50ad0519a8fa..5d1f98a4c978 100644 --- a/trunk/sound/soc/davinci/davinci-mcasp.c +++ b/trunk/sound/soc/davinci/davinci-mcasp.c @@ -714,13 +714,16 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, struct davinci_pcm_dma_params *dma_params = &dev->dma_params[substream->stream]; int word_length; - u8 fifo_level; + u8 numevt; davinci_hw_common_param(dev, substream->stream); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - fifo_level = dev->txnumevt; + numevt = dev->txnumevt; else - fifo_level = dev->rxnumevt; + numevt = dev->rxnumevt; + + if (!numevt) + numevt = 1; if (dev->op_mode == DAVINCI_MCASP_DIT_MODE) davinci_hw_dit_param(dev); @@ -748,12 +751,12 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (dev->version == MCASP_VERSION_2 && !fifo_level) - dma_params->acnt = 4; - else + if (dev->version == MCASP_VERSION_2) { + dma_params->data_type *= numevt; + dma_params->acnt = 4 * numevt; + } else dma_params->acnt = dma_params->data_type; - dma_params->fifo_level = fifo_level; davinci_config_channel_size(dev, word_length); return 0; diff --git a/trunk/sound/soc/davinci/davinci-pcm.c b/trunk/sound/soc/davinci/davinci-pcm.c index 1152d8ba8970..359e99ec7244 100644 --- a/trunk/sound/soc/davinci/davinci-pcm.c +++ b/trunk/sound/soc/davinci/davinci-pcm.c @@ -66,53 +66,38 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream) dma_addr_t dma_pos; dma_addr_t src, dst; unsigned short src_bidx, dst_bidx; - unsigned short src_cidx, dst_cidx; unsigned int data_type; unsigned short acnt; unsigned int count; - unsigned int fifo_level; period_size = snd_pcm_lib_period_bytes(substream); dma_offset = prtd->period * period_size; dma_pos = runtime->dma_addr + dma_offset; - fifo_level = prtd->params->fifo_level; pr_debug("davinci_pcm: audio_set_dma_params_play channel = %d " "dma_ptr = %x period_size=%x\n", lch, dma_pos, period_size); data_type = prtd->params->data_type; count = period_size / data_type; - if (fifo_level) - count /= fifo_level; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { src = dma_pos; dst = prtd->params->dma_addr; src_bidx = data_type; dst_bidx = 0; - src_cidx = data_type * fifo_level; - dst_cidx = 0; } else { src = prtd->params->dma_addr; dst = dma_pos; src_bidx = 0; dst_bidx = data_type; - src_cidx = 0; - dst_cidx = data_type * fifo_level; } acnt = prtd->params->acnt; edma_set_src(lch, src, INCR, W8BIT); edma_set_dest(lch, dst, INCR, W8BIT); - - edma_set_src_index(lch, src_bidx, src_cidx); - edma_set_dest_index(lch, dst_bidx, dst_cidx); - - if (!fifo_level) - edma_set_transfer_params(lch, acnt, count, 1, 0, ASYNC); - else - edma_set_transfer_params(lch, acnt, fifo_level, count, - fifo_level, ABSYNC); + edma_set_src_index(lch, src_bidx, 0); + edma_set_dest_index(lch, dst_bidx, 0); + edma_set_transfer_params(lch, acnt, count, 1, 0, ASYNC); prtd->period++; if (unlikely(prtd->period >= runtime->periods)) diff --git a/trunk/sound/soc/davinci/davinci-pcm.h b/trunk/sound/soc/davinci/davinci-pcm.h index c8b0d2baf05a..8746606efc89 100644 --- a/trunk/sound/soc/davinci/davinci-pcm.h +++ b/trunk/sound/soc/davinci/davinci-pcm.h @@ -23,7 +23,6 @@ struct davinci_pcm_dma_params { enum dma_event_q eventq_no; /* event queue number */ unsigned char data_type; /* xfer data type */ unsigned char convert_mono_stereo; - unsigned int fifo_level; };