Skip to content

Commit 26b9b55

Browse files
committed
Merge branch 'fix/asoc' into for-linus
2 parents 468c545 + 18036b5 commit 26b9b55

22 files changed

+95
-45
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5532,6 +5532,7 @@ F: include/media/*7146*
55325532

55335533
SAMSUNG AUDIO (ASoC) DRIVERS
55345534
M: Jassi Brar <[email protected]>
5535+
M: Sangbeom Kim <[email protected]>
55355536
L: [email protected] (moderated for non-subscribers)
55365537
S: Supported
55375538
F: sound/soc/samsung

sound/soc/blackfin/bf5xx-ad193x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream,
5656

5757
switch (params_rate(params)) {
5858
case 48000:
59-
clk = 12288000;
59+
clk = 24576000;
6060
break;
6161
}
6262

sound/soc/codecs/ad193x.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ struct ad193x_priv {
2727
int sysclk;
2828
};
2929

30-
/* ad193x register cache & default register settings */
31-
static const u8 ad193x_reg[AD193X_NUM_REGS] = {
32-
0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0, 0,
33-
};
34-
3530
/*
3631
* AD193X volume/mute/de-emphasis etc. controls
3732
*/
@@ -307,7 +302,8 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream,
307302
snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, reg);
308303

309304
reg = snd_soc_read(codec, AD193X_DAC_CTRL2);
310-
reg = (reg & (~AD193X_DAC_WORD_LEN_MASK)) | word_len;
305+
reg = (reg & (~AD193X_DAC_WORD_LEN_MASK))
306+
| (word_len << AD193X_DAC_WORD_LEN_SHFT);
311307
snd_soc_write(codec, AD193X_DAC_CTRL2, reg);
312308

313309
reg = snd_soc_read(codec, AD193X_ADC_CTRL1);
@@ -389,9 +385,6 @@ static int ad193x_probe(struct snd_soc_codec *codec)
389385

390386
static struct snd_soc_codec_driver soc_codec_dev_ad193x = {
391387
.probe = ad193x_probe,
392-
.reg_cache_default = ad193x_reg,
393-
.reg_cache_size = AD193X_NUM_REGS,
394-
.reg_word_size = sizeof(u16),
395388
};
396389

397390
#if defined(CONFIG_SPI_MASTER)

sound/soc/codecs/ad193x.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
#define AD193X_DAC_LEFT_HIGH (1 << 3)
3535
#define AD193X_DAC_BCLK_INV (1 << 7)
3636
#define AD193X_DAC_CTRL2 0x804
37-
#define AD193X_DAC_WORD_LEN_MASK 0xC
37+
#define AD193X_DAC_WORD_LEN_SHFT 3
38+
#define AD193X_DAC_WORD_LEN_MASK 0x18
3839
#define AD193X_DAC_MASTER_MUTE 1
3940
#define AD193X_DAC_CHNL_MUTE 0x805
4041
#define AD193X_DACL1_MUTE 0
@@ -63,7 +64,7 @@
6364
#define AD193X_ADC_CTRL1 0x80f
6465
#define AD193X_ADC_SERFMT_MASK 0x60
6566
#define AD193X_ADC_SERFMT_STEREO (0 << 5)
66-
#define AD193X_ADC_SERFMT_TDM (1 << 2)
67+
#define AD193X_ADC_SERFMT_TDM (1 << 5)
6768
#define AD193X_ADC_SERFMT_AUX (2 << 5)
6869
#define AD193X_ADC_WORD_LEN_MASK 0x3
6970
#define AD193X_ADC_CTRL2 0x810

sound/soc/codecs/sta32x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,7 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c,
857857
ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1);
858858
if (ret != 0) {
859859
dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret);
860+
kfree(sta32x);
860861
return ret;
861862
}
862863

sound/soc/codecs/wm8962.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,8 @@ static int sysclk_event(struct snd_soc_dapm_widget *w,
22212221
switch (event) {
22222222
case SND_SOC_DAPM_PRE_PMU:
22232223
if (fll) {
2224+
try_wait_for_completion(&wm8962->fll_lock);
2225+
22242226
snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
22252227
WM8962_FLL_ENA, WM8962_FLL_ENA);
22262228
if (wm8962->irq) {
@@ -2927,10 +2929,6 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,
29272929
WM8962_BIAS_ENA | 0x180);
29282930

29292931
msleep(5);
2930-
2931-
snd_soc_update_bits(codec, WM8962_CLOCKING2,
2932-
WM8962_CLKREG_OVD,
2933-
WM8962_CLKREG_OVD);
29342932
}
29352933

29362934
/* VMID 2*250k */
@@ -3288,6 +3286,8 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
32883286
snd_soc_write(codec, WM8962_FLL_CONTROL_7, fll_div.lambda);
32893287
snd_soc_write(codec, WM8962_FLL_CONTROL_8, fll_div.n);
32903288

3289+
try_wait_for_completion(&wm8962->fll_lock);
3290+
32913291
snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
32923292
WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK |
32933293
WM8962_FLL_ENA, fll1);
@@ -3868,6 +3868,10 @@ static int wm8962_probe(struct snd_soc_codec *codec)
38683868
*/
38693869
snd_soc_update_bits(codec, WM8962_CLOCKING2, WM8962_SYSCLK_ENA, 0);
38703870

3871+
/* Ensure we have soft control over all registers */
3872+
snd_soc_update_bits(codec, WM8962_CLOCKING2,
3873+
WM8962_CLKREG_OVD, WM8962_CLKREG_OVD);
3874+
38713875
regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
38723876

38733877
if (pdata) {

sound/soc/codecs/wm8996.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ static const char *sidetone_hpf_text[] = {
420420
};
421421

422422
static const struct soc_enum sidetone_hpf =
423-
SOC_ENUM_SINGLE(WM8996_SIDETONE, 7, 6, sidetone_hpf_text);
423+
SOC_ENUM_SINGLE(WM8996_SIDETONE, 7, 7, sidetone_hpf_text);
424424

425425
static const char *hpf_mode_text[] = {
426426
"HiFi", "Custom", "Voice"
@@ -988,15 +988,10 @@ SND_SOC_DAPM_MICBIAS("MICB1", WM8996_POWER_MANAGEMENT_1, 8, 0),
988988
SND_SOC_DAPM_PGA("IN1L PGA", WM8996_POWER_MANAGEMENT_2, 5, 0, NULL, 0),
989989
SND_SOC_DAPM_PGA("IN1R PGA", WM8996_POWER_MANAGEMENT_2, 4, 0, NULL, 0),
990990

991-
SND_SOC_DAPM_MUX("IN1L Mux", SND_SOC_NOPM, 0, 0, &in1_mux),
992-
SND_SOC_DAPM_MUX("IN1R Mux", SND_SOC_NOPM, 0, 0, &in1_mux),
993-
SND_SOC_DAPM_MUX("IN2L Mux", SND_SOC_NOPM, 0, 0, &in2_mux),
994-
SND_SOC_DAPM_MUX("IN2R Mux", SND_SOC_NOPM, 0, 0, &in2_mux),
995-
996-
SND_SOC_DAPM_PGA("IN1L", WM8996_POWER_MANAGEMENT_7, 2, 0, NULL, 0),
997-
SND_SOC_DAPM_PGA("IN1R", WM8996_POWER_MANAGEMENT_7, 3, 0, NULL, 0),
998-
SND_SOC_DAPM_PGA("IN2L", WM8996_POWER_MANAGEMENT_7, 6, 0, NULL, 0),
999-
SND_SOC_DAPM_PGA("IN2R", WM8996_POWER_MANAGEMENT_7, 7, 0, NULL, 0),
991+
SND_SOC_DAPM_MUX("IN1L Mux", WM8996_POWER_MANAGEMENT_7, 2, 0, &in1_mux),
992+
SND_SOC_DAPM_MUX("IN1R Mux", WM8996_POWER_MANAGEMENT_7, 3, 0, &in1_mux),
993+
SND_SOC_DAPM_MUX("IN2L Mux", WM8996_POWER_MANAGEMENT_7, 6, 0, &in2_mux),
994+
SND_SOC_DAPM_MUX("IN2R Mux", WM8996_POWER_MANAGEMENT_7, 7, 0, &in2_mux),
1000995

1001996
SND_SOC_DAPM_SUPPLY("DMIC2", WM8996_POWER_MANAGEMENT_7, 9, 0, NULL, 0),
1002997
SND_SOC_DAPM_SUPPLY("DMIC1", WM8996_POWER_MANAGEMENT_7, 8, 0, NULL, 0),
@@ -1213,6 +1208,16 @@ static const struct snd_soc_dapm_route wm8996_dapm_routes[] = {
12131208
{ "AIF2RX0", NULL, "AIFCLK" },
12141209
{ "AIF2RX1", NULL, "AIFCLK" },
12151210

1211+
{ "AIF1TX0", NULL, "AIFCLK" },
1212+
{ "AIF1TX1", NULL, "AIFCLK" },
1213+
{ "AIF1TX2", NULL, "AIFCLK" },
1214+
{ "AIF1TX3", NULL, "AIFCLK" },
1215+
{ "AIF1TX4", NULL, "AIFCLK" },
1216+
{ "AIF1TX5", NULL, "AIFCLK" },
1217+
1218+
{ "AIF2TX0", NULL, "AIFCLK" },
1219+
{ "AIF2TX1", NULL, "AIFCLK" },
1220+
12161221
{ "DSP1RXL", NULL, "SYSDSPCLK" },
12171222
{ "DSP1RXR", NULL, "SYSDSPCLK" },
12181223
{ "DSP2RXL", NULL, "SYSDSPCLK" },
@@ -2106,6 +2111,9 @@ static int wm8996_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
21062111

21072112
snd_soc_write(codec, WM8996_FLL_EFS_1, fll_div.lambda);
21082113

2114+
/* Clear any pending completions (eg, from failed startups) */
2115+
try_wait_for_completion(&wm8996->fll_lock);
2116+
21092117
snd_soc_update_bits(codec, WM8996_FLL_CONTROL_1,
21102118
WM8996_FLL_ENA, WM8996_FLL_ENA);
21112119

sound/soc/ep93xx/ep93xx-i2s.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,14 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
385385
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
386386
if (!res) {
387387
err = -ENODEV;
388-
goto fail;
388+
goto fail_free_info;
389389
}
390390

391391
info->mem = request_mem_region(res->start, resource_size(res),
392392
pdev->name);
393393
if (!info->mem) {
394394
err = -EBUSY;
395-
goto fail;
395+
goto fail_free_info;
396396
}
397397

398398
info->regs = ioremap(info->mem->start, resource_size(info->mem));
@@ -435,6 +435,7 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
435435
iounmap(info->regs);
436436
fail_release_mem:
437437
release_mem_region(info->mem->start, resource_size(info->mem));
438+
fail_free_info:
438439
kfree(info);
439440
fail:
440441
return err;

sound/soc/fsl/fsl_dma.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,10 +879,12 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
879879
* assume that device_node pointers are a valid comparison.
880880
*/
881881
np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0);
882+
of_node_put(np);
882883
if (np == dma_channel_np)
883884
return ssi_np;
884885

885886
np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0);
887+
of_node_put(np);
886888
if (np == dma_channel_np)
887889
return ssi_np;
888890
}

sound/soc/fsl/mpc8610_hpcd.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,10 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
345345
}
346346

347347
machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL);
348-
if (!machine_data)
349-
return -ENOMEM;
348+
if (!machine_data) {
349+
ret = -ENOMEM;
350+
goto error_alloc;
351+
}
350352

351353
machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev);
352354
machine_data->dai[0].ops = &mpc8610_hpcd_ops;
@@ -494,22 +496,20 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
494496
ret = platform_device_add(sound_device);
495497
if (ret) {
496498
dev_err(&pdev->dev, "platform device add failed\n");
497-
goto error;
499+
goto error_sound;
498500
}
499501
dev_set_drvdata(&pdev->dev, sound_device);
500502

501503
of_node_put(codec_np);
502504

503505
return 0;
504506

507+
error_sound:
508+
platform_device_unregister(sound_device);
505509
error:
506-
of_node_put(codec_np);
507-
508-
if (sound_device)
509-
platform_device_unregister(sound_device);
510-
511510
kfree(machine_data);
512-
511+
error_alloc:
512+
of_node_put(codec_np);
513513
return ret;
514514
}
515515

sound/soc/fsl/p1022_ds.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,10 @@ static int get_dma_channel(struct device_node *ssi_np,
297297
* dai->platform name should already point to an allocated buffer.
298298
*/
299299
ret = of_address_to_resource(dma_channel_np, 0, &res);
300-
if (ret)
300+
if (ret) {
301+
of_node_put(dma_channel_np);
301302
return ret;
303+
}
302304
snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%s",
303305
(unsigned long long) res.start, dma_channel_np->name);
304306

sound/soc/kirkwood/kirkwood-i2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)
424424
if (!priv->mem) {
425425
dev_err(&pdev->dev, "request_mem_region failed\n");
426426
err = -EBUSY;
427-
goto error;
427+
goto error_alloc;
428428
}
429429

430430
priv->io = ioremap(priv->mem->start, SZ_16K);

sound/soc/omap/ams-delta.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
514514
}
515515

516516
/* Set codec bias level */
517-
ams_delta_set_bias_level(card, SND_SOC_BIAS_STANDBY);
517+
ams_delta_set_bias_level(card, dapm, SND_SOC_BIAS_STANDBY);
518518

519519
/* Add hook switch - can be used to control the codec from userspace
520520
* even if line discipline fails */
@@ -649,7 +649,9 @@ static void __exit ams_delta_module_exit(void)
649649
ams_delta_hook_switch_gpios);
650650

651651
/* Keep modem power on */
652-
ams_delta_set_bias_level(&ams_delta_audio_card, SND_SOC_BIAS_STANDBY);
652+
ams_delta_set_bias_level(&ams_delta_audio_card,
653+
&ams_delta_audio_card.rtd[0].codec->dapm,
654+
SND_SOC_BIAS_STANDBY);
653655

654656
platform_device_unregister(cx20442_platform_device);
655657
platform_device_unregister(ams_delta_audio_platform_device);

sound/soc/samsung/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ config SND_SOC_SPEYSIDE
185185
select SND_SAMSUNG_I2S
186186
select SND_SOC_WM8996
187187
select SND_SOC_WM9081
188+
select SND_SOC_WM1250_EV1
188189

189190
config SND_SOC_SPEYSIDE_WM8962
190191
tristate "Audio support for Wolfson Speyside with WM8962"

sound/soc/samsung/h1940_uda1380.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
*/
1515

16+
#include <linux/types.h>
1617
#include <linux/gpio.h>
1718

1819
#include <sound/soc.h>

sound/soc/samsung/rx1950_uda1380.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*
1818
*/
1919

20+
#include <linux/types.h>
2021
#include <linux/gpio.h>
2122

2223
#include <sound/soc.h>

sound/soc/samsung/speyside_wm8962.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ static int speyside_wm8962_set_bias_level(struct snd_soc_card *card,
2323
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
2424
int ret;
2525

26+
if (dapm->dev != codec_dai->dev)
27+
return 0;
28+
2629
switch (level) {
2730
case SND_SOC_BIAS_PREPARE:
2831
if (dapm->bias_level == SND_SOC_BIAS_STANDBY) {
@@ -57,6 +60,9 @@ static int speyside_wm8962_set_bias_level_post(struct snd_soc_card *card,
5760
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
5861
int ret;
5962

63+
if (dapm->dev != codec_dai->dev)
64+
return 0;
65+
6066
switch (level) {
6167
case SND_SOC_BIAS_STANDBY:
6268
ret = snd_soc_dai_set_sysclk(codec_dai, WM8962_SYSCLK_MCLK,

sound/soc/soc-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
19131913

19141914
if (prefix) {
19151915
name_len = strlen(long_name) + strlen(prefix) + 2;
1916-
name = kmalloc(name_len, GFP_ATOMIC);
1916+
name = kmalloc(name_len, GFP_KERNEL);
19171917
if (!name)
19181918
return NULL;
19191919

sound/soc/soc-io.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,25 @@ static unsigned int snd_soc_16_8_read_i2c(struct snd_soc_codec *codec,
205205
#define snd_soc_16_8_read_i2c NULL
206206
#endif
207207

208+
#if defined(CONFIG_SPI_MASTER)
209+
static unsigned int snd_soc_16_8_read_spi(struct snd_soc_codec *codec,
210+
unsigned int r)
211+
{
212+
struct spi_device *spi = codec->control_data;
213+
214+
const u16 reg = cpu_to_be16(r | 0x100);
215+
u8 data;
216+
int ret;
217+
218+
ret = spi_write_then_read(spi, &reg, 2, &data, 1);
219+
if (ret < 0)
220+
return 0;
221+
return data;
222+
}
223+
#else
224+
#define snd_soc_16_8_read_spi NULL
225+
#endif
226+
208227
static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg,
209228
unsigned int value)
210229
{
@@ -295,6 +314,7 @@ static struct {
295314
int (*write)(struct snd_soc_codec *codec, unsigned int, unsigned int);
296315
unsigned int (*read)(struct snd_soc_codec *, unsigned int);
297316
unsigned int (*i2c_read)(struct snd_soc_codec *, unsigned int);
317+
unsigned int (*spi_read)(struct snd_soc_codec *, unsigned int);
298318
} io_types[] = {
299319
{
300320
.addr_bits = 4, .data_bits = 12,
@@ -318,6 +338,7 @@ static struct {
318338
.addr_bits = 16, .data_bits = 8,
319339
.write = snd_soc_16_8_write,
320340
.i2c_read = snd_soc_16_8_read_i2c,
341+
.spi_read = snd_soc_16_8_read_spi,
321342
},
322343
{
323344
.addr_bits = 16, .data_bits = 16,
@@ -383,6 +404,8 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
383404
#ifdef CONFIG_SPI_MASTER
384405
codec->hw_write = do_spi_write;
385406
#endif
407+
if (io_types[i].spi_read)
408+
codec->hw_read = io_types[i].spi_read;
386409

387410
codec->control_data = container_of(codec->dev,
388411
struct spi_device,

0 commit comments

Comments
 (0)