diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-12-08 09:04:02 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-08 09:04:02 -0500 |
commit | e5edba464c11d9d42550f9e3ff97f25196ba50b2 (patch) | |
tree | 269a640ff93c68db724080f73b0e267e024af082 /sound/soc/fsl | |
parent | 77de61c3975da6f2200935c341e84018ece6ce36 (diff) | |
parent | 1810afd3e1ded09c53d4e966dddce3c7d484521f (diff) |
Merge tag 'asoc-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v3.19
Lots and lots of changes this time around, the usual set of driver
updates and a huge bulk of cleanups from Lars-Peter. Probably the most
interesting thing for most users is the Intel driver updates which will
(with some more machine integration work) enable support for newer x86
laptops.
- Conversion of AC'97 drivers to use regmap, bringing us closer to the
removal of the ASoC level I/O code.
- Clean up a lot of old drivers that were open coding things that have
subsequently been implemented in the core.
- Some DAPM performance improvements.
- Removal of the now seldom used CODEC mutex.
- Lots of updates for the newer Intel SoC support, including support
for the DSP and some Cherrytrail and Braswell machine drivers.
- Support for Samsung boards using rt5631 as the CODEC.
- Removal of the obsolete AFEB9260 machine driver.
- Driver support for the TI TS3A227E headset driver used in some
Chrombeooks.
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/eukrea-tlv320.c | 5 | ||||
-rw-r--r-- | sound/soc/fsl/fsl-asoc-card.c | 19 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_esai.c | 12 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 17 | ||||
-rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 6 | ||||
-rw-r--r-- | sound/soc/fsl/imx-spdif.c | 3 | ||||
-rw-r--r-- | sound/soc/fsl/imx-ssi.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/imx-wm8962.c | 6 | ||||
-rw-r--r-- | sound/soc/fsl/mpc5200_dma.c | 3 | ||||
-rw-r--r-- | sound/soc/fsl/mpc5200_psc_ac97.c | 6 |
10 files changed, 39 insertions, 40 deletions
diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c index eb093d5b85c4..b175b0145a42 100644 --- a/sound/soc/fsl/eukrea-tlv320.c +++ b/sound/soc/fsl/eukrea-tlv320.c | |||
@@ -105,7 +105,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev) | |||
105 | int ret; | 105 | int ret; |
106 | int int_port = 0, ext_port; | 106 | int int_port = 0, ext_port; |
107 | struct device_node *np = pdev->dev.of_node; | 107 | struct device_node *np = pdev->dev.of_node; |
108 | struct device_node *ssi_np, *codec_np; | 108 | struct device_node *ssi_np = NULL, *codec_np = NULL; |
109 | 109 | ||
110 | eukrea_tlv320.dev = &pdev->dev; | 110 | eukrea_tlv320.dev = &pdev->dev; |
111 | if (np) { | 111 | if (np) { |
@@ -217,8 +217,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev) | |||
217 | err: | 217 | err: |
218 | if (ret) | 218 | if (ret) |
219 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); | 219 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); |
220 | if (np) | 220 | of_node_put(ssi_np); |
221 | of_node_put(ssi_np); | ||
222 | 221 | ||
223 | return ret; | 222 | return ret; |
224 | } | 223 | } |
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 007c772f3cef..3f6959c8e2f7 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c | |||
@@ -51,6 +51,7 @@ struct codec_priv { | |||
51 | * @sysclk_freq[2]: SYSCLK rates for set_sysclk() | 51 | * @sysclk_freq[2]: SYSCLK rates for set_sysclk() |
52 | * @sysclk_dir[2]: SYSCLK directions for set_sysclk() | 52 | * @sysclk_dir[2]: SYSCLK directions for set_sysclk() |
53 | * @sysclk_id[2]: SYSCLK ids for set_sysclk() | 53 | * @sysclk_id[2]: SYSCLK ids for set_sysclk() |
54 | * @slot_width: Slot width of each frame | ||
54 | * | 55 | * |
55 | * Note: [1] for tx and [0] for rx | 56 | * Note: [1] for tx and [0] for rx |
56 | */ | 57 | */ |
@@ -58,6 +59,7 @@ struct cpu_priv { | |||
58 | unsigned long sysclk_freq[2]; | 59 | unsigned long sysclk_freq[2]; |
59 | u32 sysclk_dir[2]; | 60 | u32 sysclk_dir[2]; |
60 | u32 sysclk_id[2]; | 61 | u32 sysclk_id[2]; |
62 | u32 slot_width; | ||
61 | }; | 63 | }; |
62 | 64 | ||
63 | /** | 65 | /** |
@@ -125,7 +127,12 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream, | |||
125 | priv->sample_rate = params_rate(params); | 127 | priv->sample_rate = params_rate(params); |
126 | priv->sample_format = params_format(params); | 128 | priv->sample_format = params_format(params); |
127 | 129 | ||
128 | if (priv->card.set_bias_level) | 130 | /* |
131 | * If codec-dai is DAI Master and all configurations are already in the | ||
132 | * set_bias_level(), bypass the remaining settings in hw_params(). | ||
133 | * Note: (dai_fmt & CBM_CFM) includes CBM_CFM and CBM_CFS. | ||
134 | */ | ||
135 | if (priv->card.set_bias_level && priv->dai_fmt & SND_SOC_DAIFMT_CBM_CFM) | ||
129 | return 0; | 136 | return 0; |
130 | 137 | ||
131 | /* Specific configurations of DAIs starts from here */ | 138 | /* Specific configurations of DAIs starts from here */ |
@@ -137,6 +144,15 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream, | |||
137 | return ret; | 144 | return ret; |
138 | } | 145 | } |
139 | 146 | ||
147 | if (cpu_priv->slot_width) { | ||
148 | ret = snd_soc_dai_set_tdm_slot(rtd->cpu_dai, 0x3, 0x3, 2, | ||
149 | cpu_priv->slot_width); | ||
150 | if (ret) { | ||
151 | dev_err(dev, "failed to set TDM slot for cpu dai\n"); | ||
152 | return ret; | ||
153 | } | ||
154 | } | ||
155 | |||
140 | return 0; | 156 | return 0; |
141 | } | 157 | } |
142 | 158 | ||
@@ -448,6 +464,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) | |||
448 | priv->cpu_priv.sysclk_freq[RX] = priv->codec_priv.mclk_freq; | 464 | priv->cpu_priv.sysclk_freq[RX] = priv->codec_priv.mclk_freq; |
449 | priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT; | 465 | priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT; |
450 | priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT; | 466 | priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT; |
467 | priv->cpu_priv.slot_width = 32; | ||
451 | priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS; | 468 | priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS; |
452 | } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) { | 469 | } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) { |
453 | priv->codec_priv.mclk_id = SGTL5000_SYSCLK; | 470 | priv->codec_priv.mclk_id = SGTL5000_SYSCLK; |
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index a645e296199e..ca319d59f843 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c | |||
@@ -513,10 +513,15 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream, | |||
513 | u32 width = snd_pcm_format_width(params_format(params)); | 513 | u32 width = snd_pcm_format_width(params_format(params)); |
514 | u32 channels = params_channels(params); | 514 | u32 channels = params_channels(params); |
515 | u32 pins = DIV_ROUND_UP(channels, esai_priv->slots); | 515 | u32 pins = DIV_ROUND_UP(channels, esai_priv->slots); |
516 | u32 slot_width = width; | ||
516 | u32 bclk, mask, val; | 517 | u32 bclk, mask, val; |
517 | int ret; | 518 | int ret; |
518 | 519 | ||
519 | bclk = params_rate(params) * esai_priv->slot_width * esai_priv->slots; | 520 | /* Override slot_width if being specifially set */ |
521 | if (esai_priv->slot_width) | ||
522 | slot_width = esai_priv->slot_width; | ||
523 | |||
524 | bclk = params_rate(params) * slot_width * esai_priv->slots; | ||
520 | 525 | ||
521 | ret = fsl_esai_set_bclk(dai, tx, bclk); | 526 | ret = fsl_esai_set_bclk(dai, tx, bclk); |
522 | if (ret) | 527 | if (ret) |
@@ -538,7 +543,7 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream, | |||
538 | regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx), mask, val); | 543 | regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx), mask, val); |
539 | 544 | ||
540 | mask = ESAI_xCR_xSWS_MASK | (tx ? ESAI_xCR_PADC : 0); | 545 | mask = ESAI_xCR_xSWS_MASK | (tx ? ESAI_xCR_PADC : 0); |
541 | val = ESAI_xCR_xSWS(esai_priv->slot_width, width) | (tx ? ESAI_xCR_PADC : 0); | 546 | val = ESAI_xCR_xSWS(slot_width, width) | (tx ? ESAI_xCR_PADC : 0); |
542 | 547 | ||
543 | regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx), mask, val); | 548 | regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx), mask, val); |
544 | 549 | ||
@@ -780,9 +785,6 @@ static int fsl_esai_probe(struct platform_device *pdev) | |||
780 | return ret; | 785 | return ret; |
781 | } | 786 | } |
782 | 787 | ||
783 | /* Set a default slot size */ | ||
784 | esai_priv->slot_width = 32; | ||
785 | |||
786 | /* Set a default slot number */ | 788 | /* Set a default slot number */ |
787 | esai_priv->slots = 2; | 789 | esai_priv->slots = 2; |
788 | 790 | ||
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index e6955170dc42..b6b0d25f6ace 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -67,8 +67,6 @@ | |||
67 | /** | 67 | /** |
68 | * FSLSSI_I2S_FORMATS: audio formats supported by the SSI | 68 | * FSLSSI_I2S_FORMATS: audio formats supported by the SSI |
69 | * | 69 | * |
70 | * This driver currently only supports the SSI running in I2S slave mode. | ||
71 | * | ||
72 | * The SSI has a limitation in that the samples must be in the same byte | 70 | * The SSI has a limitation in that the samples must be in the same byte |
73 | * order as the host CPU. This is because when multiple bytes are written | 71 | * order as the host CPU. This is because when multiple bytes are written |
74 | * to the STX register, the bytes and bits must be written in the same | 72 | * to the STX register, the bytes and bits must be written in the same |
@@ -1099,7 +1097,7 @@ static const struct snd_soc_component_driver fsl_ssi_component = { | |||
1099 | }; | 1097 | }; |
1100 | 1098 | ||
1101 | static struct snd_soc_dai_driver fsl_ssi_ac97_dai = { | 1099 | static struct snd_soc_dai_driver fsl_ssi_ac97_dai = { |
1102 | .ac97_control = 1, | 1100 | .bus_control = true, |
1103 | .playback = { | 1101 | .playback = { |
1104 | .stream_name = "AC97 Playback", | 1102 | .stream_name = "AC97 Playback", |
1105 | .channels_min = 2, | 1103 | .channels_min = 2, |
@@ -1363,7 +1361,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1363 | return PTR_ERR(ssi_private->regs); | 1361 | return PTR_ERR(ssi_private->regs); |
1364 | } | 1362 | } |
1365 | 1363 | ||
1366 | ssi_private->irq = irq_of_parse_and_map(np, 0); | 1364 | ssi_private->irq = platform_get_irq(pdev, 0); |
1367 | if (!ssi_private->irq) { | 1365 | if (!ssi_private->irq) { |
1368 | dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); | 1366 | dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); |
1369 | return -ENXIO; | 1367 | return -ENXIO; |
@@ -1389,7 +1387,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1389 | if (ssi_private->soc->imx) { | 1387 | if (ssi_private->soc->imx) { |
1390 | ret = fsl_ssi_imx_probe(pdev, ssi_private, iomem); | 1388 | ret = fsl_ssi_imx_probe(pdev, ssi_private, iomem); |
1391 | if (ret) | 1389 | if (ret) |
1392 | goto error_irqmap; | 1390 | return ret; |
1393 | } | 1391 | } |
1394 | 1392 | ||
1395 | ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component, | 1393 | ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component, |
@@ -1412,7 +1410,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1412 | 1410 | ||
1413 | ret = fsl_ssi_debugfs_create(&ssi_private->dbg_stats, &pdev->dev); | 1411 | ret = fsl_ssi_debugfs_create(&ssi_private->dbg_stats, &pdev->dev); |
1414 | if (ret) | 1412 | if (ret) |
1415 | goto error_asoc_register; | 1413 | goto error_irq; |
1416 | 1414 | ||
1417 | /* | 1415 | /* |
1418 | * If codec-handle property is missing from SSI node, we assume | 1416 | * If codec-handle property is missing from SSI node, we assume |
@@ -1460,10 +1458,6 @@ error_asoc_register: | |||
1460 | if (ssi_private->soc->imx) | 1458 | if (ssi_private->soc->imx) |
1461 | fsl_ssi_imx_clean(pdev, ssi_private); | 1459 | fsl_ssi_imx_clean(pdev, ssi_private); |
1462 | 1460 | ||
1463 | error_irqmap: | ||
1464 | if (ssi_private->use_dma) | ||
1465 | irq_dispose_mapping(ssi_private->irq); | ||
1466 | |||
1467 | return ret; | 1461 | return ret; |
1468 | } | 1462 | } |
1469 | 1463 | ||
@@ -1480,9 +1474,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) | |||
1480 | if (ssi_private->soc->imx) | 1474 | if (ssi_private->soc->imx) |
1481 | fsl_ssi_imx_clean(pdev, ssi_private); | 1475 | fsl_ssi_imx_clean(pdev, ssi_private); |
1482 | 1476 | ||
1483 | if (ssi_private->use_dma) | ||
1484 | irq_dispose_mapping(ssi_private->irq); | ||
1485 | |||
1486 | return 0; | 1477 | return 0; |
1487 | } | 1478 | } |
1488 | 1479 | ||
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index 1cb22dd034eb..1dab963a59f7 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c | |||
@@ -175,10 +175,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
175 | fail: | 175 | fail: |
176 | if (data && !IS_ERR(data->codec_clk)) | 176 | if (data && !IS_ERR(data->codec_clk)) |
177 | clk_put(data->codec_clk); | 177 | clk_put(data->codec_clk); |
178 | if (ssi_np) | 178 | of_node_put(ssi_np); |
179 | of_node_put(ssi_np); | 179 | of_node_put(codec_np); |
180 | if (codec_np) | ||
181 | of_node_put(codec_np); | ||
182 | 180 | ||
183 | return ret; | 181 | return ret; |
184 | } | 182 | } |
diff --git a/sound/soc/fsl/imx-spdif.c b/sound/soc/fsl/imx-spdif.c index e1dc40143600..0c9068ebe1e7 100644 --- a/sound/soc/fsl/imx-spdif.c +++ b/sound/soc/fsl/imx-spdif.c | |||
@@ -74,8 +74,7 @@ static int imx_spdif_audio_probe(struct platform_device *pdev) | |||
74 | platform_set_drvdata(pdev, data); | 74 | platform_set_drvdata(pdev, data); |
75 | 75 | ||
76 | end: | 76 | end: |
77 | if (spdif_np) | 77 | of_node_put(spdif_np); |
78 | of_node_put(spdif_np); | ||
79 | 78 | ||
80 | return ret; | 79 | return ret; |
81 | } | 80 | } |
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index ab2fdd76b693..60b0a5b1f1f1 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c | |||
@@ -382,7 +382,7 @@ static struct snd_soc_dai_driver imx_ssi_dai = { | |||
382 | 382 | ||
383 | static struct snd_soc_dai_driver imx_ac97_dai = { | 383 | static struct snd_soc_dai_driver imx_ac97_dai = { |
384 | .probe = imx_ssi_dai_probe, | 384 | .probe = imx_ssi_dai_probe, |
385 | .ac97_control = 1, | 385 | .bus_control = true, |
386 | .playback = { | 386 | .playback = { |
387 | .stream_name = "AC97 Playback", | 387 | .stream_name = "AC97 Playback", |
388 | .channels_min = 2, | 388 | .channels_min = 2, |
diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c index 3a3d17ce6ba4..48179ffe1543 100644 --- a/sound/soc/fsl/imx-wm8962.c +++ b/sound/soc/fsl/imx-wm8962.c | |||
@@ -281,10 +281,8 @@ static int imx_wm8962_probe(struct platform_device *pdev) | |||
281 | clk_fail: | 281 | clk_fail: |
282 | clk_disable_unprepare(data->codec_clk); | 282 | clk_disable_unprepare(data->codec_clk); |
283 | fail: | 283 | fail: |
284 | if (ssi_np) | 284 | of_node_put(ssi_np); |
285 | of_node_put(ssi_np); | 285 | of_node_put(codec_np); |
286 | if (codec_np) | ||
287 | of_node_put(codec_np); | ||
288 | 286 | ||
289 | return ret; | 287 | return ret; |
290 | } | 288 | } |
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index f2b5d756b1f3..0b82e209b6e3 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c | |||
@@ -327,9 +327,6 @@ static int psc_dma_new(struct snd_soc_pcm_runtime *rtd) | |||
327 | goto capture_alloc_err; | 327 | goto capture_alloc_err; |
328 | } | 328 | } |
329 | 329 | ||
330 | if (rtd->codec->ac97) | ||
331 | rtd->codec->ac97->private_data = psc_dma; | ||
332 | |||
333 | return 0; | 330 | return 0; |
334 | 331 | ||
335 | capture_alloc_err: | 332 | capture_alloc_err: |
diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index 24eafa2cfbf4..c6ed6ba965a9 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c | |||
@@ -237,7 +237,7 @@ static const struct snd_soc_dai_ops psc_ac97_digital_ops = { | |||
237 | static struct snd_soc_dai_driver psc_ac97_dai[] = { | 237 | static struct snd_soc_dai_driver psc_ac97_dai[] = { |
238 | { | 238 | { |
239 | .name = "mpc5200-psc-ac97.0", | 239 | .name = "mpc5200-psc-ac97.0", |
240 | .ac97_control = 1, | 240 | .bus_control = true, |
241 | .probe = psc_ac97_probe, | 241 | .probe = psc_ac97_probe, |
242 | .playback = { | 242 | .playback = { |
243 | .stream_name = "AC97 Playback", | 243 | .stream_name = "AC97 Playback", |
@@ -257,7 +257,7 @@ static struct snd_soc_dai_driver psc_ac97_dai[] = { | |||
257 | }, | 257 | }, |
258 | { | 258 | { |
259 | .name = "mpc5200-psc-ac97.1", | 259 | .name = "mpc5200-psc-ac97.1", |
260 | .ac97_control = 1, | 260 | .bus_control = true, |
261 | .playback = { | 261 | .playback = { |
262 | .stream_name = "AC97 SPDIF", | 262 | .stream_name = "AC97 SPDIF", |
263 | .channels_min = 1, | 263 | .channels_min = 1, |
@@ -282,7 +282,6 @@ static const struct snd_soc_component_driver psc_ac97_component = { | |||
282 | static int psc_ac97_of_probe(struct platform_device *op) | 282 | static int psc_ac97_of_probe(struct platform_device *op) |
283 | { | 283 | { |
284 | int rc; | 284 | int rc; |
285 | struct snd_ac97 ac97; | ||
286 | struct mpc52xx_psc __iomem *regs; | 285 | struct mpc52xx_psc __iomem *regs; |
287 | 286 | ||
288 | rc = mpc5200_audio_dma_create(op); | 287 | rc = mpc5200_audio_dma_create(op); |
@@ -304,7 +303,6 @@ static int psc_ac97_of_probe(struct platform_device *op) | |||
304 | 303 | ||
305 | psc_dma = dev_get_drvdata(&op->dev); | 304 | psc_dma = dev_get_drvdata(&op->dev); |
306 | regs = psc_dma->psc_regs; | 305 | regs = psc_dma->psc_regs; |
307 | ac97.private_data = psc_dma; | ||
308 | 306 | ||
309 | psc_dma->imr = 0; | 307 | psc_dma->imr = 0; |
310 | out_be16(&psc_dma->psc_regs->isr_imr.imr, psc_dma->imr); | 308 | out_be16(&psc_dma->psc_regs->isr_imr.imr, psc_dma->imr); |