Skip to content

Commit 33d31d3

Browse files
committed
Merge tag 'sound-3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "All small fixes in random various drivers, mostly for ASoC at this time, which look reasonable for a high rc number" * tag 'sound-3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: rockchip-i2s: dt: swap tx and rx channed request number in example ASoC: rockchip-i2s: fix registers' property of rockchip i2s controller ASoC: rockchip-i2s: fix master mode set bit error ASoC: cs4265: Fix register address to set the proper data type. ALSA: hda - Fix invalid pin powermap without jack detection ASoC: soc-pcm: fix dpcm_path_get error handling ASoC: samsung-i2s: Check secondary DAI exists before referencing ASoC: Update email id of the author ASoC: dwc: Update email id of the author ASoC: davinci-mcasp: Correct rx format unit configuration ASoC: tlv320aic31xx: Fix 24bit samples with I2S format and 12MHz mclk
2 parents 153a9f1 + 7796085 commit 33d31d3

12 files changed

Lines changed: 91 additions & 38 deletions

File tree

‎Documentation/devicetree/bindings/sound/rockchip-i2s.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ i2s@ff890000 {
3131
#address-cells = <1>;
3232
#size-cells = <0>;
3333
dmas = <&pdma1 0>, <&pdma1 1>;
34-
dma-names = "rx", "tx";
34+
dma-names = "tx", "rx";
3535
clock-names = "i2s_hclk", "i2s_clk";
3636
clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>;
3737
};

‎sound/pci/hda/patch_sigmatel.c‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ static void stac_init_power_map(struct hda_codec *codec)
566566
if (snd_hda_jack_tbl_get(codec, nid))
567567
continue;
568568
if (def_conf == AC_JACK_PORT_COMPLEX &&
569-
!(spec->vref_mute_led_nid == nid ||
570-
is_jack_detectable(codec, nid))) {
569+
spec->vref_mute_led_nid != nid &&
570+
is_jack_detectable(codec, nid)) {
571571
snd_hda_jack_detect_enable_callback(codec, nid,
572572
STAC_PWR_EVENT,
573573
jack_update_power);
@@ -4276,11 +4276,18 @@ static int stac_parse_auto_config(struct hda_codec *codec)
42764276
return err;
42774277
}
42784278

4279-
stac_init_power_map(codec);
4280-
42814279
return 0;
42824280
}
42834281

4282+
static int stac_build_controls(struct hda_codec *codec)
4283+
{
4284+
int err = snd_hda_gen_build_controls(codec);
4285+
4286+
if (err < 0)
4287+
return err;
4288+
stac_init_power_map(codec);
4289+
return 0;
4290+
}
42844291

42854292
static int stac_init(struct hda_codec *codec)
42864293
{
@@ -4392,7 +4399,7 @@ static int stac_suspend(struct hda_codec *codec)
43924399
#endif /* CONFIG_PM */
43934400

43944401
static const struct hda_codec_ops stac_patch_ops = {
4395-
.build_controls = snd_hda_gen_build_controls,
4402+
.build_controls = stac_build_controls,
43964403
.build_pcms = snd_hda_gen_build_pcms,
43974404
.init = stac_init,
43984405
.free = stac_free,

‎sound/soc/codecs/cs4265.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,12 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream,
458458
if (params_width(params) == 16) {
459459
snd_soc_update_bits(codec, CS4265_DAC_CTL,
460460
CS4265_DAC_CTL_DIF, (1 << 5));
461-
snd_soc_update_bits(codec, CS4265_ADC_CTL,
461+
snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
462462
CS4265_SPDIF_CTL2_DIF, (1 << 7));
463463
} else {
464464
snd_soc_update_bits(codec, CS4265_DAC_CTL,
465465
CS4265_DAC_CTL_DIF, (3 << 5));
466-
snd_soc_update_bits(codec, CS4265_ADC_CTL,
466+
snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
467467
CS4265_SPDIF_CTL2_DIF, (1 << 7));
468468
}
469469
break;
@@ -472,7 +472,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream,
472472
CS4265_DAC_CTL_DIF, 0);
473473
snd_soc_update_bits(codec, CS4265_ADC_CTL,
474474
CS4265_ADC_DIF, 0);
475-
snd_soc_update_bits(codec, CS4265_ADC_CTL,
475+
snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
476476
CS4265_SPDIF_CTL2_DIF, (1 << 6));
477477

478478
break;

‎sound/soc/codecs/sta529.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver
55
*
66
* Copyright (C) 2012 ST Microelectronics
7-
* Rajeev Kumar <rajeev-dlh.kumar@st.com>
7+
* Rajeev Kumar <rajeevkumar.linux@gmail.com>
88
*
99
* This file is licensed under the terms of the GNU General Public
1010
* License version 2. This program is licensed "as is" without any
@@ -426,5 +426,5 @@ static struct i2c_driver sta529_i2c_driver = {
426426
module_i2c_driver(sta529_i2c_driver);
427427

428428
MODULE_DESCRIPTION("ASoC STA529 codec driver");
429-
MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
429+
MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
430430
MODULE_LICENSE("GPL");

‎sound/soc/codecs/tlv320aic31xx.c‎

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,46 +189,57 @@ static const struct aic31xx_rate_divs aic31xx_divs[] = {
189189
/* mclk rate pll: p j d dosr ndac mdac aors nadc madc */
190190
/* 8k rate */
191191
{12000000, 8000, 1, 8, 1920, 128, 48, 2, 128, 48, 2},
192+
{12000000, 8000, 1, 8, 1920, 128, 32, 3, 128, 32, 3},
192193
{24000000, 8000, 2, 8, 1920, 128, 48, 2, 128, 48, 2},
193194
{25000000, 8000, 2, 7, 8643, 128, 48, 2, 128, 48, 2},
194195
/* 11.025k rate */
195196
{12000000, 11025, 1, 7, 5264, 128, 32, 2, 128, 32, 2},
197+
{12000000, 11025, 1, 8, 4672, 128, 24, 3, 128, 24, 3},
196198
{24000000, 11025, 2, 7, 5264, 128, 32, 2, 128, 32, 2},
197199
{25000000, 11025, 2, 7, 2253, 128, 32, 2, 128, 32, 2},
198200
/* 16k rate */
199201
{12000000, 16000, 1, 8, 1920, 128, 24, 2, 128, 24, 2},
202+
{12000000, 16000, 1, 8, 1920, 128, 16, 3, 128, 16, 3},
200203
{24000000, 16000, 2, 8, 1920, 128, 24, 2, 128, 24, 2},
201204
{25000000, 16000, 2, 7, 8643, 128, 24, 2, 128, 24, 2},
202205
/* 22.05k rate */
203206
{12000000, 22050, 1, 7, 5264, 128, 16, 2, 128, 16, 2},
207+
{12000000, 22050, 1, 8, 4672, 128, 12, 3, 128, 12, 3},
204208
{24000000, 22050, 2, 7, 5264, 128, 16, 2, 128, 16, 2},
205209
{25000000, 22050, 2, 7, 2253, 128, 16, 2, 128, 16, 2},
206210
/* 32k rate */
207211
{12000000, 32000, 1, 8, 1920, 128, 12, 2, 128, 12, 2},
212+
{12000000, 32000, 1, 8, 1920, 128, 8, 3, 128, 8, 3},
208213
{24000000, 32000, 2, 8, 1920, 128, 12, 2, 128, 12, 2},
209214
{25000000, 32000, 2, 7, 8643, 128, 12, 2, 128, 12, 2},
210215
/* 44.1k rate */
211216
{12000000, 44100, 1, 7, 5264, 128, 8, 2, 128, 8, 2},
217+
{12000000, 44100, 1, 8, 4672, 128, 6, 3, 128, 6, 3},
212218
{24000000, 44100, 2, 7, 5264, 128, 8, 2, 128, 8, 2},
213219
{25000000, 44100, 2, 7, 2253, 128, 8, 2, 128, 8, 2},
214220
/* 48k rate */
215221
{12000000, 48000, 1, 8, 1920, 128, 8, 2, 128, 8, 2},
222+
{12000000, 48000, 1, 7, 6800, 96, 5, 4, 96, 5, 4},
216223
{24000000, 48000, 2, 8, 1920, 128, 8, 2, 128, 8, 2},
217224
{25000000, 48000, 2, 7, 8643, 128, 8, 2, 128, 8, 2},
218225
/* 88.2k rate */
219226
{12000000, 88200, 1, 7, 5264, 64, 8, 2, 64, 8, 2},
227+
{12000000, 88200, 1, 8, 4672, 64, 6, 3, 64, 6, 3},
220228
{24000000, 88200, 2, 7, 5264, 64, 8, 2, 64, 8, 2},
221229
{25000000, 88200, 2, 7, 2253, 64, 8, 2, 64, 8, 2},
222230
/* 96k rate */
223231
{12000000, 96000, 1, 8, 1920, 64, 8, 2, 64, 8, 2},
232+
{12000000, 96000, 1, 7, 6800, 48, 5, 4, 48, 5, 4},
224233
{24000000, 96000, 2, 8, 1920, 64, 8, 2, 64, 8, 2},
225234
{25000000, 96000, 2, 7, 8643, 64, 8, 2, 64, 8, 2},
226235
/* 176.4k rate */
227236
{12000000, 176400, 1, 7, 5264, 32, 8, 2, 32, 8, 2},
237+
{12000000, 176400, 1, 8, 4672, 32, 6, 3, 32, 6, 3},
228238
{24000000, 176400, 2, 7, 5264, 32, 8, 2, 32, 8, 2},
229239
{25000000, 176400, 2, 7, 2253, 32, 8, 2, 32, 8, 2},
230240
/* 192k rate */
231241
{12000000, 192000, 1, 8, 1920, 32, 8, 2, 32, 8, 2},
242+
{12000000, 192000, 1, 7, 6800, 24, 5, 4, 24, 5, 4},
232243
{24000000, 192000, 2, 8, 1920, 32, 8, 2, 32, 8, 2},
233244
{25000000, 192000, 2, 7, 8643, 32, 8, 2, 32, 8, 2},
234245
};
@@ -680,7 +691,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
680691
struct snd_pcm_hw_params *params)
681692
{
682693
struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
694+
int bclk_score = snd_soc_params_to_frame_size(params);
683695
int bclk_n = 0;
696+
int match = -1;
684697
int i;
685698

686699
/* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */
@@ -691,15 +704,37 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
691704

692705
for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) {
693706
if (aic31xx_divs[i].rate == params_rate(params) &&
694-
aic31xx_divs[i].mclk == aic31xx->sysclk)
695-
break;
707+
aic31xx_divs[i].mclk == aic31xx->sysclk) {
708+
int s = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) %
709+
snd_soc_params_to_frame_size(params);
710+
int bn = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) /
711+
snd_soc_params_to_frame_size(params);
712+
if (s < bclk_score && bn > 0) {
713+
match = i;
714+
bclk_n = bn;
715+
bclk_score = s;
716+
}
717+
}
696718
}
697719

698-
if (i == ARRAY_SIZE(aic31xx_divs)) {
699-
dev_err(codec->dev, "%s: Sampling rate %u not supported\n",
720+
if (match == -1) {
721+
dev_err(codec->dev,
722+
"%s: Sample rate (%u) and format not supported\n",
700723
__func__, params_rate(params));
724+
/* See bellow for details how fix this. */
701725
return -EINVAL;
702726
}
727+
if (bclk_score != 0) {
728+
dev_warn(codec->dev, "Can not produce exact bitclock");
729+
/* This is fine if using dsp format, but if using i2s
730+
there may be trouble. To fix the issue edit the
731+
aic31xx_divs table for your mclk and sample
732+
rate. Details can be found from:
733+
http://www.ti.com/lit/ds/symlink/tlv320aic3100.pdf
734+
Section: 5.6 CLOCK Generation and PLL
735+
*/
736+
}
737+
i = match;
703738

704739
/* PLL configuration */
705740
snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK,
@@ -729,14 +764,6 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
729764
snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr);
730765

731766
/* Bit clock divider configuration. */
732-
bclk_n = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac)
733-
/ snd_soc_params_to_frame_size(params);
734-
if (bclk_n == 0) {
735-
dev_err(codec->dev, "%s: Not enough BLCK bandwidth\n",
736-
__func__);
737-
return -EINVAL;
738-
}
739-
740767
snd_soc_update_bits(codec, AIC31XX_BCLKN,
741768
AIC31XX_PLL_MASK, bclk_n);
742769

‎sound/soc/davinci/davinci-mcasp.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
467467
{
468468
u32 fmt;
469469
u32 tx_rotate = (word_length / 4) & 0x7;
470-
u32 rx_rotate = (32 - word_length) / 4;
471470
u32 mask = (1ULL << word_length) - 1;
471+
/*
472+
* For captured data we should not rotate, inversion and masking is
473+
* enoguh to get the data to the right position:
474+
* Format data from bus after reverse (XRBUF)
475+
* S16_LE: |LSB|MSB|xxx|xxx| |xxx|xxx|MSB|LSB|
476+
* S24_3LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB|
477+
* S24_LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB|
478+
* S32_LE: |LSB|DAT|DAT|MSB| |MSB|DAT|DAT|LSB|
479+
*/
480+
u32 rx_rotate = 0;
472481

473482
/*
474483
* if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()

‎sound/soc/dwc/designware_i2s.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* sound/soc/dwc/designware_i2s.c
55
*
66
* Copyright (C) 2010 ST Microelectronics
7-
* Rajeev Kumar <rajeev-dlh.kumar@st.com>
7+
* Rajeev Kumar <rajeevkumar.linux@gmail.com>
88
*
99
* This file is licensed under the terms of the GNU General Public
1010
* License version 2. This program is licensed "as is" without any
@@ -455,7 +455,7 @@ static struct platform_driver dw_i2s_driver = {
455455

456456
module_platform_driver(dw_i2s_driver);
457457

458-
MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
458+
MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
459459
MODULE_DESCRIPTION("DESIGNWARE I2S SoC Interface");
460460
MODULE_LICENSE("GPL");
461461
MODULE_ALIAS("platform:designware_i2s");

‎sound/soc/rockchip/rockchip_i2s.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,14 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
165165
struct rk_i2s_dev *i2s = to_info(cpu_dai);
166166
unsigned int mask = 0, val = 0;
167167

168-
mask = I2S_CKR_MSS_SLAVE;
168+
mask = I2S_CKR_MSS_MASK;
169169
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
170170
case SND_SOC_DAIFMT_CBS_CFS:
171-
val = I2S_CKR_MSS_SLAVE;
171+
/* Set source clock in Master mode */
172+
val = I2S_CKR_MSS_MASTER;
172173
break;
173174
case SND_SOC_DAIFMT_CBM_CFM:
174-
val = I2S_CKR_MSS_MASTER;
175+
val = I2S_CKR_MSS_SLAVE;
175176
break;
176177
default:
177178
return -EINVAL;
@@ -361,6 +362,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg)
361362
case I2S_XFER:
362363
case I2S_CLR:
363364
case I2S_RXDR:
365+
case I2S_FIFOLR:
366+
case I2S_INTSR:
364367
return true;
365368
default:
366369
return false;
@@ -370,8 +373,8 @@ static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg)
370373
static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
371374
{
372375
switch (reg) {
373-
case I2S_FIFOLR:
374376
case I2S_INTSR:
377+
case I2S_CLR:
375378
return true;
376379
default:
377380
return false;
@@ -381,8 +384,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
381384
static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg)
382385
{
383386
switch (reg) {
384-
case I2S_FIFOLR:
385-
return true;
386387
default:
387388
return false;
388389
}

‎sound/soc/samsung/i2s.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
462462
if (dir == SND_SOC_CLOCK_IN)
463463
rfs = 0;
464464

465-
if ((rfs && other->rfs && (other->rfs != rfs)) ||
465+
if ((rfs && other && other->rfs && (other->rfs != rfs)) ||
466466
(any_active(i2s) &&
467467
(((dir == SND_SOC_CLOCK_IN)
468468
&& !(mod & MOD_CDCLKCON)) ||
@@ -762,7 +762,8 @@ static void i2s_shutdown(struct snd_pcm_substream *substream,
762762
} else {
763763
u32 mod = readl(i2s->addr + I2SMOD);
764764
i2s->cdclk_out = !(mod & MOD_CDCLKCON);
765-
other->cdclk_out = i2s->cdclk_out;
765+
if (other)
766+
other->cdclk_out = i2s->cdclk_out;
766767
}
767768
/* Reset any constraint on RFS and BFS */
768769
i2s->rfs = 0;

‎sound/soc/soc-compress.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
101101

102102
fe->dpcm[stream].runtime = fe_substream->runtime;
103103

104-
if (dpcm_path_get(fe, stream, &list) <= 0) {
104+
ret = dpcm_path_get(fe, stream, &list);
105+
if (ret < 0) {
106+
mutex_unlock(&fe->card->mutex);
107+
goto fe_err;
108+
} else if (ret == 0) {
105109
dev_dbg(fe->dev, "ASoC: %s no valid %s route\n",
106110
fe->dai_link->name, stream ? "capture" : "playback");
107111
}

0 commit comments

Comments
 (0)