summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-09-20ASoC: convert for_each_rtd_codec_dai() for missing partKuninori Morimoto1-16/+15
commit 0b7990e38971 ("ASoC: add for_each_rtd_codec_dai() macro") added for_each_rtd_codec_dai(), but it didn't convert few loop which is not using "rtd". This patch fixup it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-19ASoC: q6afe: dt-bindings: Update input range for qcom,sd-linesRohit kumar1-9/+9
Input to qcom,sd-lines should be between 0 and 3 instead of 1 to 4 as 0 corresponds to BIT(0) which is MI2S_SD0 line. Bit 1 to 3 corresponds to SD1 to SD3 lines respectively. Updated documentation for the same. Signed-off-by: Rohit kumar <rohitkr@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18ASoC: rt5677-spi: Drop unused GPIO includeLinus Walleij1-1/+0
This SPI driver does not use the legacy GPIO header so just delete it. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18ASoC: rt5682: Minor code modificationShuming Fan1-4/+11
Minor code changes are: - improve the readability in patch list - add i2c remove function - regmap_register_patch changes to regmap_multi_reg_write Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18ASoC: rt5682: Fix the boost volume at the begining of playbackShuming Fan1-0/+5
This patch fixed the boost volume at the begining of playback while DAC volume set to lower level. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18ASoC: rt5682: Update calibration functionShuming Fan1-2/+11
The ADC/DAC path should open while calibration process. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18Merge branch 'asoc-4.19' into asoc-4.20 for rt5682 deps.Mark Brown5-23/+24
2018-09-18ASoC: rt5682: Remove HP volume controlShuming Fan1-5/+0
This patch removed Headphone Playback Volume control. Due to codec settings, we don't want the user to change HP analog gain. The user could use DAC1 Playback Volume control to change playback volume. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18ASoC: rt5682: Improve HP performanceShuming Fan2-3/+43
We change the settings while HP power-up for better performance. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18ASoC: remove redundant includezhong jiang4-4/+0
module.h already contained moduleparam.h, so it is safe to remove the redundant include. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17ASoC: rt5514-spi: Get the period_bytes in the copy work to make sure the ↵Oder Chiou1-6/+8
value correctly The value of period_bytes will get the zero before the hw_params() is not run completely. Move the function snd_pcm_lib_period_bytes() to copy work, and make sure that is not zero. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17ASoC: soc-core: add snd_soc_is_matching_component()Kuninori Morimoto1-20/+22
To find (CPU/)Codec/Platform, we need to find component first (= on CPU/Codec/Platform), and find DAI from it (= CPU/Codec). These are similar operation but difficult to be simple, and has many duplicate code to finding component. This patch adds new snd_soc_is_matching_component(), and reduce duplicate codes. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17ASoC: soc-core: manage platform name under snd_soc_init_platform()Kuninori Morimoto1-16/+17
Now "platform" is controlled by snd_soc_dai_link_component, thus its "name" can be initialized in snd_soc_init_platform(), instead of soc_bind_dai_link() local. This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17ASoC: qdsp6: q6asm-dai: remove duplicated include from q6asm-dai.cYueHaibing1-1/+0
Remove duplicated include. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17ASoC: hisilicon: fix fall-through annotationsGustavo A. R. Silva1-2/+2
Replace "fallthru" with a proper "fall through" annotation. This fix is part of the ongoing efforts to enabling -Wimplicit-fallthrough Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17ASoC: es8328: Fix fall-through annotationsGustavo A. R. Silva1-2/+2
Replace "fallthru" with a proper "fall through" annotation. This fix is part of the ongoing efforts to enabling -Wimplicit-fallthrough Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12ALSA: hda: Fix implicit definition of pci_iomap() on SHMark Brown1-0/+1
Include asm/io.h directly so we've got a definition of pci_iomap(), the current set of includes do this implicitly on most architectures but not on SH. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12sound: don't call skl_init_chip() to reset intel skl socYu Zhao3-4/+6
Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which 1) sets bus->chip_init to prevent multiple entrances before device is stopped; 2) enables interrupt. We shouldn't use it for the purpose of resetting device only because 1) when we really want to initialize device, we won't be able to do so; 2) we are ready to handle interrupt yet, and kernel crashes when interrupt comes in. Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset device properly. Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe") Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Yu Zhao <yuzhao@google.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12sound: enable interrupt after dma buffer initializationYu Zhao1-2/+6
In snd_hdac_bus_init_chip(), we enable interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers. If irq has been acquired and irq handler uses the dma buffer, kernel may crash when interrupt comes in. Fix the problem by postponing enabling irq after dma buffer initialization. And warn once on null dma buffer pointer during the initialization. Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Yu Zhao <yuzhao@google.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation"Yu Zhao1-6/+4
This reverts commit 12eeeb4f4733bbc4481d01df35933fc15beb8b19. The patch doesn't fix accessing memory with null pointer in skl_interrupt(). There are two problems: 1) skl_init_chip() is called twice, before and after dma buffer is allocate. The first call sets bus->chip_init which prevents the second from initializing bus->corb.buf and rirb.buf from bus->rb.area. 2) snd_hdac_bus_init_chip() enables interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers. There is a small window which skl_interrupt() can be called if irq has been acquired. If so, it crashes when using null dma buffer pointers. Will fix the problems in the following patches. Also attaching the crash for future reference. [ 16.949148] general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI <snipped> [ 16.950903] Call Trace: [ 16.950906] <IRQ> [ 16.950918] skl_interrupt+0x19e/0x2d6 [snd_soc_skl] [ 16.950926] ? dma_supported+0xb5/0xb5 [snd_soc_skl] [ 16.950933] __handle_irq_event_percpu+0x27a/0x6c8 [ 16.950937] ? __irq_wake_thread+0x1d1/0x1d1 [ 16.950942] ? __do_softirq+0x57a/0x69e [ 16.950944] handle_irq_event_percpu+0x95/0x1ba [ 16.950948] ? _raw_spin_unlock+0x65/0xdc [ 16.950951] ? __handle_irq_event_percpu+0x6c8/0x6c8 [ 16.950953] ? _raw_spin_unlock+0x65/0xdc [ 16.950957] ? time_cpufreq_notifier+0x483/0x483 [ 16.950959] handle_irq_event+0x89/0x123 [ 16.950962] handle_fasteoi_irq+0x16f/0x425 [ 16.950965] handle_irq+0x1fe/0x28e [ 16.950969] do_IRQ+0x6e/0x12e [ 16.950972] common_interrupt+0x7a/0x7a [ 16.950974] </IRQ> <snipped> [ 16.951031] RIP: snd_hdac_bus_update_rirb+0x19b/0x4cf [snd_hda_core] RSP: ffff88015c807c08 [ 16.951036] ---[ end trace 58bf9ece1775bc92 ]--- Fixes: 2eeeb4f4733b ("ASoC: Intel: Skylake: Acquire irq after RIRB allocation") Signed-off-by: Yu Zhao <yuzhao@google.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12ASoC: soc-core: remove dai->driver NULL checkKuninori Morimoto1-5/+0
It is strange if it has "dai" but doesn't have "dai->driver". And more over "dai->driver->xxx" is used everywhere without "dai->driver" pointer NULL checking. It got Oops already if "dai->driver" was NULL. Let's remove un-needed "dai->driver" NULL check. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12ASoC: core: add support to card rebindSrinivas Kandagatla2-27/+60
Current behaviour of ASoC core w.r.t to component removal is that it unregisters dependent sound card totally. There is no support to rebind the card if the component comes back. Typical use case is DSP restart or kernel modules itself. With this patch, core now maintains list of cards that are unbind due to any of its depended components are removed and card not unregistered yet. This list is cleared when the card is rebind successfully or when the card is unregistered from machine driver. This list of unbind cards are tried to bind once again after every new component is successfully added, giving a fair chance for card bind to be successful. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12ASoC: remove unneeded static set .owner field in platform_driverzhong jiang3-3/+0
platform_driver_register will set the .owner field. So it is safe to remove the redundant assignment. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11ASoC: rockchip: add missing INTERLEAVED PCM attributeKatsuhiro Suzuki1-1/+2
This patch adds SNDRV_PCM_INFO_INTERLEAVED into PCM hardware info. Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11ASoC: soc-core: remove unused num_dai_linksKuninori Morimoto2-5/+0
ALSA SoC is counting card->dai_link_list user, but no-one is using it. Let's remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11ASoC: soc-core: avoid nested code on soc_remove_dai()Kuninori Morimoto1-10/+11
Nested code is not readable. This patch avoid it on soc_remove_dai(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11ASoC: rt5668: remove empty rt5668_i2c_remove()Kuninori Morimoto1-6/+0
rt5668_i2c_remove() is empty, and no longer needed. Let's remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11ASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx()Rohit kumar1-2/+2
In functions snd_soc_get_volsw_sx() or snd_soc_put_volsw_sx(), if the result of (min + max) is negative, then fls() returns signed integer with value as 32. This leads to signed integer overflow as complete operation is considered as signed integer. UBSAN: Undefined behaviour in sound/soc/soc-ops.c:382:50 signed integer overflow: -2147483648 - 1 cannot be represented in type 'int' Call trace: [<ffffff852f746fe4>] __dump_stack lib/dump_stack.c:15 [inline] [<ffffff852f746fe4>] dump_stack+0xec/0x158 lib/dump_stack.c:51 [<ffffff852f7b5f3c>] ubsan_epilogue+0x18/0x50 lib/ubsan.c:164 [<ffffff852f7b6840>] handle_overflow+0xf8/0x130 lib/ubsan.c:195 [<ffffff852f7b68f0>] __ubsan_handle_sub_overflow+0x34/0x44 lib/ubsan.c:211 [<ffffff85307971a0>] snd_soc_get_volsw_sx+0x1a8/0x1f8 sound/soc/soc-ops.c:382 Typecast the operation to unsigned int to fix the issue. Signed-off-by: Rohit kumar <rohitkr@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10Merge branch 'asoc-4.19' into asoc-4.20 Cirrus conflictMark Brown5-3/+40
2018-09-10ASoC: pxa: switch to new ac97 bus supportRobert Jarzmik3-27/+27
Switch to the new ac97 bus support in sound/ac97 instead of the legacy snd_ac97 one. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: AMD: Fix simultaneous playback and capture on different channelAkshu Agrawal3-10/+41
If capture and playback are started on different channel (I2S/BT) there is a possibilty that channel information passed from machine driver is overwritten before the configuration is done in dma driver. Example: 113.597588: cz_max_startup: ---playback sets BT channel 113.597694: cz_dmic1_startup: ---capture sets I2S channel 113.597979: acp_dma_hw_params: ---configures capture for I2S channel 113.598114: acp_dma_hw_params: ---configures playback for I2S channel This is fixed by having 2 separate instance for playback and capture. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: cs4265: fix MMTLR Data switch controlSébastien Szymanski1-2/+2
The MMTLR bit is in the CS4265_SPDIF_CTL2 register at address 0x12 bit 0 and not at address 0x0 bit 1. Fix this. Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2018-09-10ASoC: dapm: Add missing return value check for snd_soc_dapm_new_daiCharles Keepax1-0/+16
snd_soc_dapm_new_dai may return an error pointer and currently this isn't checked for in dapm_connect_dai_link_widgets. Add code to check the return value and not add routes in that case. Fixes: 778ff5bb8689 ("ASoC: dapm: Move connection of CODEC to CODEC DAIs") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: skl-topology: Use kmemdup to replace kzalloc + memcpyzhong jiang1-2/+1
kmemdup has implemented the function that kzalloc() + memcpy() will do. and we prefer to kmemdup rather than the open coded implementation. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: q6core: Use kmemdup to replace kzalloc + memcpyzhong jiang1-6/+2
kmemdup has implemented the function that kzalloc() + memcpy() will do. and we prefer to use the kmemdup rather than the open coded implementation. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: txx9: use devm_snd_soc_register_component()Kuninori Morimoto1-2/+1
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: sh: use devm_snd_soc_register_component()Kuninori Morimoto1-2/+1
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: omap: use devm_snd_soc_register_component()Kuninori Morimoto1-3/+1
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: nuc900: use devm_snd_soc_register_component()Kuninori Morimoto1-3/+1
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: tscs454: use devm_snd_soc_register_component()Kuninori Morimoto1-1/+1
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: rt5668: use devm_snd_soc_register_component()Kuninori Morimoto1-3/+1
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: hdac_hda: use devm_snd_soc_register_component()Kuninori Morimoto1-2/+1
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: bcm: use devm_snd_soc_register_component()Kuninori Morimoto1-9/+4
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: atmel_ssc_dai: use devm_snd_soc_register_component()Kuninori Morimoto1-10/+3
Now we have devm_snd_soc_register_component(). Let's use it instead of snd_soc_register_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: AMD: Ensure reset bit is cleared before configuringAkshu Agrawal1-0/+21
HW register descriptions says: "DMA Channel Reset...Software must confirm that this bit is cleared before reprogramming any of the channel configuration registers." There could be cases where dma stop errored out leaving dma channel in reset state. We need to ensure that before the start of another dma, channel is out of the reset state. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: qdsp6: q6asm-dai: clean up a returnDan Carpenter1-1/+1
Smatch complains that if both "psubstream" and "csubstream" are NULL then "ret" is uninitialized. That probably can't happen, but it's cleaner to just return zero anyway so let's do that. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10ASoC: dapm: Fix a couple uninitialized ret variablesDan Carpenter1-1/+3
Smatch complains that these variables could be uninitialized. The first one in snd_soc_dai_link_event() is probably a false positive, because probably we know the lists are not empty. I would normally ignore the warning, but GCC complains here as well so I just silenced the warning. The "ret" in snd_soc_dapm_new_dai() does need to be initialized or it leads to a bogus dereference in the caller. Fixes: 3bbf5d34fd4a ("ASoC: dapm: Move error handling to snd_soc_dapm_new_control_unlocked") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-07ASoC: max98373: usleep_range() needs include/delay.hGrant Grundler1-0/+1
Commit ca917f9fe1a0fab added use of usleep_range() but not the corresponding "include <linux/delay.h>". The result is with Chrome OS won't build because warnings are forced to be errors: mnt/host/source/src/third_party/kernel/v4.4/sound/soc/codecs/max98373.c:734:2: error: implicit declaration of function 'usleep_range' [-Werror,-Wimplicit-function-declaration] usleep_range(10000, 11000); ^ Including delay.h "fixes" this. Signed-off-by: Grant Grundler <grundler@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-07ASoC: Intel: hdac_hdmi: Limit sampling rates at dai creationYong Zhi1-0/+6
Playback of 44.1Khz contents with HDMI plugged returns "Invalid pipe config" because HDMI paths in the FW topology are configured to operate at 48Khz. This patch filters out sampling rates not supported at hdac_hdmi_create_dais() to let user space SRC to do the converting. Signed-off-by: Yong Zhi <yong.zhi@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-07ASoC: dapm: Avoid uninitialised variable warningCharles Keepax1-1/+1
Commit 4a75aae17b2a ("ASoC: dapm: Add support for multi-CODEC CODEC to CODEC links") adds loops that iterate over multiple CODECs in snd_soc_dai_link_event. This also introduced a compiler warning for a potentially uninitialised variable in the case no CODECs are present. This should never be the case as the DAI link must by definition contain at least 1 CODEC however probably best to avoid the compiler warning by initialising ret to zero. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>