From 15f6c5884ee939f17d8e1fec5bda044a7d995f2f Mon Sep 17 00:00:00 2001 From: Matthieu Crapet Date: Mon, 8 Dec 2014 11:58:29 +0100 Subject: ASoC: atmel_ssc_dai/trivial: typo fix Signed-off-by: Matthieu Crapet Signed-off-by: Nicolas Ferre Signed-off-by: Mark Brown --- sound/soc/atmel/atmel_ssc_dai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index b1cc2a4a7fc0..99ff35e2a25d 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -267,7 +267,7 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream, if (!ssc_p->dir_mask) { if (ssc_p->initialized) { /* Shutdown the SSC clock. */ - pr_debug("atmel_ssc_dau: Stopping clock\n"); + pr_debug("atmel_ssc_dai: Stopping clock\n"); clk_disable(ssc_p->ssc->clk); free_irq(ssc_p->ssc->irq, ssc_p); -- cgit v1.2.3 From 681a19560378213a193c424881b2180a783b81ae Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Mon, 8 Dec 2014 16:33:11 +0100 Subject: ASoC: pcm512x: Trigger auto-increment of register addresses on i2c When the codec is connected using i2c, it will only auto-increment register addresses if msb (0x80) of the register address byte is set. [Fixes cache sync if multiple adjacent registers are updated -- broonie] Signed-off-by: Peter Rosin Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/pcm512x-i2c.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c index 4d62230bd378..d0547fa275fc 100644 --- a/sound/soc/codecs/pcm512x-i2c.c +++ b/sound/soc/codecs/pcm512x-i2c.c @@ -24,8 +24,13 @@ static int pcm512x_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct regmap *regmap; + struct regmap_config config = pcm512x_regmap; - regmap = devm_regmap_init_i2c(i2c, &pcm512x_regmap); + /* msb needs to be set to enable auto-increment of addresses */ + config.read_flag_mask = 0x80; + config.write_flag_mask = 0x80; + + regmap = devm_regmap_init_i2c(i2c, &config); if (IS_ERR(regmap)) return PTR_ERR(regmap); -- cgit v1.2.3 From 7e5d8706dd3ee19f8626977935ab16e59b3603be Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Mon, 8 Dec 2014 18:45:54 +0100 Subject: ASoC: samsung: i2s: Add missing assignment of variant_regs Add assignment of the variant_regs field which is missing in commit a5a56871f804edac93a53b5e871c0e9818fb9033 ("ASoC: samsung: add support for exynos7 I2S controller"). Without this attempting to probe the secondary DAI fails with an error like: [ 1.763026] Unable to handle kernel NULL pointer dereference at virtual address 0000000c [ 1.780895] pgd = c0004000 [ 1.783606] [0000000c] *pgd=00000000 [ 1.838255] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 1.843514] Modules linked in: [ 1.846558] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc1-00009-g5dcb01e-dirty #1521 [ 1.854887] task: ee00a800 ti: ee088000 task.ti: ee088000 [ 1.860284] PC is at i2s_txctrl+0x40/0x2d4 [ 1.864350] LR is at i2s_txctrl+0x28/0x2d4 [ 1.868428] pc : [] lr : [] psr: 60000153 [ 1.868428] sp : ee089dc0 ip : 00000000 fp : ee21f000 [ 1.879883] r10: 00000000 r9 : ee21fb00 r8 : c06406c4 [ 1.885091] r7 : ee21fb00 r6 : 00000000 r5 : f00f6000 r4 : ed943410 [ 1.891601] r3 : 0000016c r2 : c0464550 r1 : c055cef8 r0 : ed943610 [ 1.898113] Flags: nZCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment kernel [ 1.905490] Control: 10c5387d Table: 4000404a DAC: 00000015 [ 1.911218] Process swapper/0 (pid: 1, stack limit = 0xee088240) [ 1.917208] Stack: (0xee089dc0 to 0xee08a000) ... [ 2.068431] [] (i2s_txctrl) from [] (samsung_i2s_dai_probe+0xb8/0x450) [ 2.076676] [] (samsung_i2s_dai_probe) from [] (snd_soc_register_card+0xd98/0x1348) [ 2.086044] [] (snd_soc_register_card) from [] (odroidx2_audio_probe+0xa8/0x11c) [ 2.095160] [] (odroidx2_audio_probe) from [] (platform_drv_probe+0x48/0xa4) [ 2.103922] [] (platform_drv_probe) from [] (driver_probe_device+0x10c/0x22c) [ 2.112773] [] (driver_probe_device) from [] (__driver_attach+0x8c/0x90) [ 2.121192] [] (__driver_attach) from [] (bus_for_each_dev+0x54/0x88) [ 2.129352] [] (bus_for_each_dev) from [] (bus_add_driver+0xd4/0x1d0) [ 2.137510] [] (bus_add_driver) from [] (driver_register+0x78/0xf4) [ 2.145499] [] (driver_register) from [] (do_one_initcall+0x80/0x1b8) [ 2.153670] [] (do_one_initcall) from [] (kernel_init_freeable+0xfc/0x1c8) [ 2.162260] [] (kernel_init_freeable) from [] (kernel_init+0x8/0xec) [ 2.170330] [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) [ 2.177873] Code: e5940000 e59f128c e59f228c e2800010 (e59c700c) Signed-off-by: Sylwester Nawrocki Signed-off-by: Mark Brown --- sound/soc/samsung/i2s.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 9d513473b300..7f98ee69d15d 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1239,6 +1239,8 @@ static int samsung_i2s_probe(struct platform_device *pdev) ret = -ENOMEM; goto err; } + + sec_dai->variant_regs = pri_dai->variant_regs; sec_dai->dma_playback.dma_addr = regs_base + I2STXDS; sec_dai->dma_playback.ch_name = "tx-sec"; -- cgit v1.2.3 From 75945896a2f4a7ebfc3402443f99ac32f629ee96 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Tue, 9 Dec 2014 10:14:45 +0800 Subject: ASoC: rt5645: Fix potential crash in jd function If no one defined the rt5645->pdata.hp_det_gpio in coreboot/bios. It will cause kernel to reboot because rt5645->pdata.hp_det_gpio is 0. So it is worth to add a check in rt5645_jack_detect. Signed-off-by: Bard Liao Signed-off-by: Fang, Yang A Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index d16331e0b64d..c901ef6ba69b 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -2113,6 +2113,10 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int gpio_state, jack_type = 0; unsigned int val; + if (!gpio_is_valid(rt5645->pdata.hp_det_gpio)) { + dev_err(codec->dev, "invalid gpio\n"); + return -EINVAL; + } gpio_state = gpio_get_value(rt5645->pdata.hp_det_gpio); dev_dbg(codec->dev, "gpio = %d(%d)\n", rt5645->pdata.hp_det_gpio, -- cgit v1.2.3 From 359ff7ffafa78dd401a1ca0019ba2fe35ff377cc Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Wed, 10 Dec 2014 20:15:25 -0800 Subject: ASoC: rt5677: add REGMAP_I2C and REGMAP_IRQ dependency The codec driver uses regmap to do i2c read/write. The codec driver started to use REGMAP_IRQ since: 5e3363ad1b7b2e1f197a3f56b01e21cb155ad454 ASoC: rt5677: add GPIO IRQ support Signed-off-by: Ben Zhang Signed-off-by: Mark Brown --- sound/soc/codecs/Kconfig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 883c5778b309..8349f982a586 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -520,6 +520,8 @@ config SND_SOC_RT5670 config SND_SOC_RT5677 tristate + select REGMAP_I2C + select REGMAP_IRQ config SND_SOC_RT5677_SPI tristate -- cgit v1.2.3 From f5d40b400fe2de5f9dc3d41681cc59b2b7c28f8c Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Tue, 9 Dec 2014 21:14:37 +0800 Subject: ASoC: Intel: fix return value check in sst_acpi_probe() In case of error, the function platform_device_register_data() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown --- sound/soc/intel/sst/sst_acpi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c index 31124aa4434e..f59972a28d24 100644 --- a/sound/soc/intel/sst/sst_acpi.c +++ b/sound/soc/intel/sst/sst_acpi.c @@ -277,16 +277,16 @@ int sst_acpi_probe(struct platform_device *pdev) dev_dbg(dev, "ACPI device id: %x\n", dev_id); plat_dev = platform_device_register_data(dev, mach->pdata->platform, -1, NULL, 0); - if (plat_dev == NULL) { + if (IS_ERR(plat_dev)) { dev_err(dev, "Failed to create machine device: %s\n", mach->pdata->platform); - return -ENODEV; + return PTR_ERR(plat_dev); } /* Create platform device for sst machine driver */ mdev = platform_device_register_data(dev, mach->machine, -1, NULL, 0); - if (mdev == NULL) { + if (IS_ERR(mdev)) { dev_err(dev, "Failed to create machine device: %s\n", mach->machine); - return -ENODEV; + return PTR_ERR(mdev); } ret = sst_alloc_drv_context(&ctx, dev, dev_id); -- cgit v1.2.3 From de5f644e3ca71afc06377d137375c56e250f8cb3 Mon Sep 17 00:00:00 2001 From: Kevin Strasser Date: Mon, 15 Dec 2014 16:15:04 -0800 Subject: ASoC: Intel: fix possible acpi enumeration panic A crash can occur on some platforms where adsp is enumerated but codec is not matched. Define codec_id as a pointer intead of an array so that it gets initialized to NULL for the terminating element of sst_acpi_bytcr[] and sst_acpi_chv[]. Signed-off-by: Kevin Strasser Signed-off-by: Mark Brown --- sound/soc/intel/sst/sst_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c index f59972a28d24..3abc29e8a928 100644 --- a/sound/soc/intel/sst/sst_acpi.c +++ b/sound/soc/intel/sst/sst_acpi.c @@ -43,7 +43,7 @@ #include "sst.h" struct sst_machines { - char codec_id[32]; + char *codec_id; char board[32]; char machine[32]; void (*machine_quirk)(void); -- cgit v1.2.3