summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: codecs: jz4725b: Use C++ style comments in headerPaul Cercueil2019-02-071-5/+4Star
| | | | | | | | Change the header comment to use C++ style, so that it looks more consistent with the rest of ASoC. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Kconfig: Show knob, and depend on MIPS || COMPILE_TESTPaul Cercueil2019-02-071-1/+8
| | | | | | | | | Show the knob to enable or disable the jz4740-codec driver, add a proper description, and add a dependency on MIPS || COMPILE_TEST, as this driver is only useful on MIPS. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: jz4740: Add support for devicetreePaul Cercueil2019-02-071-0/+9
| | | | | | | Add support for probing the driver from devicetree. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: jz4740: Use SPDX license notifierPaul Cercueil2019-02-071-12/+5Star
| | | | | | | | Add license information as a standard SPDX license notifier instead of custom text. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: jz4725b: fix spelling mistake "Deemphatize" -> "Deemphasize"Colin Ian King2019-02-071-1/+1
| | | | | | | There is a spelling mistake in the SOC_SINGLE control name. Fix this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: wcd9335: fix semicolon.cocci warningskbuild test robot2019-02-071-3/+3
| | | | | | | | | | | | | | | sound/soc/codecs/wcd-clsh-v2.c:545:2-3: Unneeded semicolon sound/soc/codecs/wcd-clsh-v2.c:211:2-3: Unneeded semicolon sound/soc/codecs/wcd-clsh-v2.c:250:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: cc2e324d39b2 ("ASoC: wcd9335: add CLASS-H Controller support") CC: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Add jz4725b-codec driverPaul Cercueil2019-02-063-0/+613
| | | | | | | | Add jz4725b-codec driver to support the internal CODEC found in the JZ4725B SoC from Ingenic. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'asoc-5.0' into asoc-5.1 for dapm tableMark Brown2019-02-062-2/+4
|\
| * ASoC: rt5682: Correct the setting while select ASRC clk for AD/DA filterShuming Fan2019-01-221-0/+2
| | | | | | | | | | | | | | | | | | AD/DA ASRC function control two ASRC clock sources separately. Whether AD/DA filter select which clock source, we enable AD/DA ASRC function for all cases. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: hdmi-codec: fix oops on re-probeRussell King2019-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hdmi-codec oopses the kernel when it is unbound from a successfully bound audio subsystem, and is then rebound: Unable to handle kernel NULL pointer dereference at virtual address 0000001c pgd = ee3f0000 [0000001c] *pgd=3cc59831 Internal error: Oops: 817 [#1] PREEMPT ARM Modules linked in: ext2 snd_soc_spdif_tx vmeta dove_thermal snd_soc_kirkwood ofpart marvell_cesa m25p80 orion_wdt mtd spi_nor des_generic gpio_ir_recv snd_soc_kirkwood_spdif bmm_dmabuf auth_rpcgss nfsd autofs4 etnaviv thermal_sys hwmon gpu_sched tda9950 CPU: 0 PID: 1005 Comm: bash Not tainted 4.20.0+ #1762 Hardware name: Marvell Dove (Cubox) PC is at hdmi_dai_probe+0x68/0x80 LR is at find_held_lock+0x20/0x94 pc : [<c04c7de0>] lr : [<c0063bf4>] psr: 600f0013 sp : ee15bd28 ip : eebd8b1c fp : c093b488 r10: ee048000 r9 : eebdab18 r8 : ee048600 r7 : 00000001 r6 : 00000000 r5 : 00000000 r4 : ee82c100 r3 : 00000006 r2 : 00000001 r1 : c067e38c r0 : ee82c100 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none[ 297.318599] Control: 10c5387d Table: 2e3f0019 DAC: 00000051 Process bash (pid: 1005, stack limit = 0xee15a248) ... [<c04c7de0>] (hdmi_dai_probe) from [<c04b7060>] (soc_probe_dai.part.9+0x34/0x70) [<c04b7060>] (soc_probe_dai.part.9) from [<c04b81a8>] (snd_soc_instantiate_card+0x734/0xc9c) [<c04b81a8>] (snd_soc_instantiate_card) from [<c04b8b6c>] (snd_soc_add_component+0x29c/0x378) [<c04b8b6c>] (snd_soc_add_component) from [<c04b8c8c>] (snd_soc_register_component+0x44/0x54) [<c04b8c8c>] (snd_soc_register_component) from [<c04c64b4>] (devm_snd_soc_register_component+0x48/0x84) [<c04c64b4>] (devm_snd_soc_register_component) from [<c04c7be8>] (hdmi_codec_probe+0x150/0x260) [<c04c7be8>] (hdmi_codec_probe) from [<c0373124>] (platform_drv_probe+0x48/0x98) This happens because hdmi_dai_probe() attempts to access the HDMI codec private data, but this has not been assigned by hdmi_dai_probe() before it calls devm_snd_soc_register_component(). Move the call to dev_set_drvdata() before devm_snd_soc_register_component() to avoid this oops. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* | ASoC: ssm2602: switch to SPDX identifierMarco Felsch2019-02-061-27/+12Star
| | | | | | | | | | | | | | Drop old license header and switch to SPDX-License-Identifier. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: wcd9335: remove some unnecessary NULL checksDan Carpenter2019-02-061-12/+8Star
| | | | | | | | | | | | | | These are arrays, not pointers, and they can't be NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: ssm2602: Fix ADC powerup sequencingPhilipp Zabel2019-02-061-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the ssm2603 data sheet (control register sequencing), the digital core should be activated only after all necessary bits in the power register are enabled, and a delay determined by the decoupling capacitor on the VMID pin has passed. If the digital core is activated too early, or even before the ADC is powered up, audible artifacts appear at the beginning of the recorded signal. The digital core is also needed for playback, so when recording starts it may already be enabled. This means we cannot get the power sequence correct when we want to be able to start recording after playback. As a workaround put the MIC mute switch into the DAPM routes. This way we can keep the recording disabled until the MIC Bias has settled and thus get rid of audible artifacts. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> m.felsch@pengutronix.de: adapt commit message m.felsch@pengutronix.de: drop of configuration as mentioned by Mark: https://patchwork.kernel.org/patch/10407449/ Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: ak4118: fix missing headerClément Péron2019-02-041-0/+1
| | | | | | | | | | | | | | | | This driver use the gpio consumer interface. Add the header as it's needed. Signed-off-by: Clément Péron <peron.clem@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: arizona: Add channel numbers to AIFsCharles Keepax2019-02-025-158/+158
| | | | | | | | | | | | | | | | Set the channel number on each AIF widget to allow unused channels not to be powered up across AIFs. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: cros_ec_codec: Add codec driver for Cros ECCheng-Yi Chiang2019-01-293-0/+451
| | | | | | | | | | | | | | | | | | | | | | Add a codec driver to control ChromeOS EC codec. Use EC Host command to enable/disable I2S recording and control other configurations. Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge tag 'v5.0-rc4' into asoc-5.1Mark Brown2019-01-291-103/+13Star
|\ \ | | | | | | | | | Linux 5.0-rc4
| * | Merge tag 'asoc-fix-v5.0-rc2' of ↵Takashi Iwai2019-01-186-20/+27
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.0 Quite a big batch of fixes here. There's a couple of things going on, the main one is that we found some issues with not deferring probe when we should, causing us to skip some driver initialization. The fixes for this then in turn exposed some issues with how we were searching for components which had previously gone unnoticed due to the original issue. There's also been the normal driver specific stuff and there's been what looks like several batches of automated scanning for issues which have generated quite a large set of smaller fixes for potential crashes and missed error handling.
| * | ASoC: intel: skl: Fix display power regressionTakashi Iwai2019-01-141-103/+13Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the refactoring of HD-audio display power management, the display power status is managed per domain. Meanwhile the ASoC hdac_hdmi driver still keeps and relies (incorrectly) on the refcounting together with ASoC skl driver, and this leads to the display state always on. This patch is an attempt to address the regression by simplifying the PM code of ASoC skl and hdac_hdmi drivers. Basically, since the refactoring, we don't have to manage the display power at HD-audio controller suspend / resume but only at HD-audio HDMI codec suspend / resume. So the patch drops the superfluous snd_hdac_display_power() calls in skl driver. Meanwhile, in hdac_hdmi side, we rewrite the PM call just to re-use the runtime PM callbacks like other drivers do. Now the logic is simple: turn off at suspend and turn on at resume. The patch also fixes the possibly missing display-power off at skl driver removal as well as some error paths at probe. Fixes: 029d92c289bd ("ALSA: hda: Refactor display power management") Reported-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ASoC: wcd9335: Fix missing slimbus dependencyMark Brown2019-01-291-0/+1
| | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: wcd9335: add audio routingsSrinivas Kandagatla2019-01-281-0/+189
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds audio routing for both playback and capture. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: wcd9335: add capture dapm widgetsSrinivas Kandagatla2019-01-281-1/+1447
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds required dapm widgets for capture path. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: wcd9335: add playback dapm widgetsSrinivas Kandagatla2019-01-281-0/+1795
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds required dapm widgets for playback. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: wcd9335: add basic controlsSrinivas Kandagatla2019-01-281-0/+325
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic controls found in wcd9335 codec. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: wcd9335: add CLASS-H Controller supportSrinivas Kandagatla2019-01-284-1/+636
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CLASS-H controller/Amplifier is common accorss Qualcomm WCD codec series. This patchset adds basic CLASS-H controller apis for WCD codecs after wcd9335 to use. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: wcd9335: add support to wcd9335 codecSrinivas Kandagatla2019-01-284-0/+2134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qualcomm WCD9335 Codec is a standalone Hi-Fi audio codec IC, It supports both I2S/I2C and SLIMbus audio interfaces. On slimbus interface it supports two data lanes; 16 Tx ports and 8 Rx ports. It has Seven DACs and nine dedicated interpolators, Seven (six audio ADCs, and one VBAT ADC), Multibutton headset control (MBHC), Active noise cancellation and Sidetone paths and processing. This patchset adds very basic support for playback and capture via the 9 interpolators and ADC respectively. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5651: Variable "ret" in function rt5651_i2c_probe() could be ↵Yizhuo2019-01-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uninitialized In function rt5651_i2c_probe(), local variable "ret" could be uninitialized if function regmap_read() returns -EINVAL. However, this value is used in if statement. This is potentially unsafe. Signed-off-by: Yizhuo <yzhai003@ucr.edu> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: pcm512x: Fix clocking calculations when not using the PLLDimitris Papavasiliou2019-01-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rationale behind the current calculation is somewhat obscure [1] and can yield slightly wrong dividers in certain cases, which the machine drivers for some boards (like the HiFiBerry DAC+ Pro) seemingly try to circumvent, by updating the rate fraction so as to suit this calculation. The updated calculation should correctly yield the smallest bit clock rate that would fit the frame. [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144219.html Signed-off-by: Dimitris Papavasiliou <dpapavas@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: pcm512x: Implement the set_bclk_ratio interfaceDimitris Papavasiliou2019-01-281-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some boards, such as the HiFiBerry DAC+ Pro, use a pair of external oscillators, to generate 44.1 or 48kHz multiples and are forced to resort to hacks [1] in order to support 24-bit data without ending up with fractional dividers. This patch allows the machine driver to use 32-bit frames for 24-bit data to avoid such issues. Although the datasheet (p. 15) seems to suggest that only a handful of ratios are supported, it's not very explicit about it, so we allow the full range of values supported by the underlying register in the callback, to avoid needlessly rejecting potentially usable configurations. [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2018-December/143442.html Signed-off-by: Dimitris Papavasiliou <dpapavas@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: Fixup build error for mt6358Kuninori Morimoto2019-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixup build error for commit 6a8d4198ca8 ("ASoC: mediatek: mt6358: add codec driver") Fixes: commit 6a8d4198ca8 ("ASoC: mediatek: mt6358: add codec driver") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: mediatek: mt6358: add codec driverShunli Wang2019-01-254-0/+4659
| | | | | | | | | | | | | | | | | | | | | add the mt6358 codec driver. Signed-off-by: Shunli Wang <shunli.wang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge tag 'asoc-fix-v5.0-rc2' into asoc-5.1Mark Brown2019-01-183-12/+18
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASoC: Fixes for v5.0 Quite a big batch of fixes here. There's a couple of things going on, the main one is that we found some issues with not deferring probe when we should, causing us to skip some driver initialization. The fixes for this then in turn exposed some issues with how we were searching for components which had previously gone unnoticed due to the original issue. There's also been the normal driver specific stuff and there's been what looks like several batches of automated scanning for issues which have generated quite a large set of smaller fixes for potential crashes and missed error handling.
| * | ASoC: rt5514-spi: Fix potential NULL pointer dereferenceGustavo A. R. Silva2019-01-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a potential NULL pointer dereference in case devm_kzalloc() fails and returns NULL. Fix this by adding a NULL check on rt5514_dsp. This issue was detected with the help of Coccinelle. Fixes: 6eebf35b0e4a ("ASoC: rt5514: add rt5514 SPI driver") Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: rt5682: Fix PLL source register definitionsShuming Fan2019-01-151-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | Fix typo which causes headphone no sound while using BCLK as PLL source. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: tlv320aic32x4: Kernel OOPS while entering DAPM standby modeb-ak2019-01-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the bootup of the kernel, the DAPM bias level is in the OFF state. As soon as the DAPM framework kicks in it pushes the codec into STANDBY state. The probe function doesn't prepare the clock, and STANDBY state does a clk_disable_unprepare() without checking the previous state. This leads to an OOPS. Not transitioning from an OFF state to the STANDBY state fixes the problem. Signed-off-by: b-ak <anur.bhargav@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* | | ASoC: rt5682: add default pdata for i2s modeBard liao2019-01-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Add a default pdata which can fit most HW design. So we don't need to add a lot of DMI checking in this driver. Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: msm8916-wcd-digital: Select REGMAP_MMIO to fix build errorAxel Lin2019-01-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix below build error: ERROR: "__devm_regmap_init_mmio_clk" [sound/soc/codecs/snd-soc-msm8916-digital.ko] undefined! Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: msm8916-wcd-digital: remove few unused variablesSrinivas Kandagatla2019-01-141-10/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes unused variables which also fixes below warnings: msm8916-wcd-digital.c:245:30: warning: 'rx2_mix2_inp1_chain_enum' defined but not used [-Wunused-const-variable=] static const struct soc_enum rx2_mix2_inp1_chain_enum = SOC_ENUM_SINGLE( ^~~~~~~~~~~~~~~~~~~~~~~~ msm8916-wcd-digital.c:234:30: warning: 'rx_mix2_inp1_chain_enum' defined but not used [-Wunused-const-variable=] static const struct soc_enum rx_mix2_inp1_chain_enum = SOC_ENUM_SINGLE( ^~~~~~~~~~~~~~~~~~~~~~~ msm8916-wcd-digital.c:224:26: warning: 'adc2_mux_text' defined but not used [-Wunused-const-variable=] static const char *const adc2_mux_text[] = { "ZERO", "INP2", "INP3" }; ^~~~~~~~~~~~~ msm8916-wcd-digital.c:223:26: warning: 'rx_mix2_text' defined but not used [-Wunused-const-variable=] Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: cs4341: fix waring unused-functionAnders Roxell2019-01-142-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver cs4341 can be built with SPI and/or I2C, but it has to be one of them at least. When I2C is set as a module we see the warning below: sound/soc/codecs/cs4341.c:213:12: warning: ‘cs4341_probe’ defined but not used [-Wunused-function] static int cs4341_probe(struct device *dev) ^~~~~~~~~~~~ Rework so that we use IS_ENABLED instead of defined. Also change so SND_SOC_CS4341 depends on SND_SOC_I2C_AND_SPI to we dont' get a link error when SND_SOC_CS4341=y, I2C=m and REGMAP_I2C=m is set. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: tlv320aic32x4: SND_SOC_DAPM_MICBIAS is deprecatedb-ak2019-01-092-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SND_SOC_DAPM_MICBIAS is deprecated, replace it with SND_SOC_DAPM_SUPPLY. MICBIAS voltage wasn't supplied to the microphone with the older SND_SOC_DAPM_MICBIAS widget, hence the microphone wouldn't work. This patch fixes the problem. Signed-off-by: b-ak <anur.bhargav@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: da7219: Add recalc_rate function to return DAI clock rateAdam Thomson2019-01-092-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making MCLK parent of DAI clocks, when querying the rate of the clock the rate returned is now given from the parent clock so gives the MCLK rate rather than 0 as previously returned. This is a bit misleading, and actually there's no major reason why we can't at least return the DAI WCLK rate, as set in HW, so that's what we now do. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: da7219: MCLK should be enabled before DAI clocksAdam Thomson2019-01-091-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For platforms using the Common Clock Framework to control the codec's DAI clocks, MCLK should be enabled prior to DAI clocks being turned on. For some platforms the codec is already provided with an MCLK reference and can therefore control MCLK itself as it needs to. To improve functionality MCLK is now added as a parent to the DAI clocks, if MCLK was provided, so that if they are enabled MCLK will automatically be enabled as a prerequisite by the CCF. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt274: Variable "buf" in function rt274_jack_detect() could be ↵Yizhuo2019-01-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uninitialized In function rt274_jack_detect(), local variable "buf" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used to calculate "hp" and "mic" and make their value unpredictable while those value are used in the caller. This is potentially unsafe. Signed-off-by: Yizhuo <yzhai003@ucr.edu> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: ADAU7002: Add optional delay before start of captureAgrawal, Akshu2019-01-081-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On capture through some of dmic we observe a glitch at the start of record. This is because we start capturing even before dmic is ready to send out data. The optional delay will be applied after enabling the mic. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5651: Add support for jack detect using an external GPIOHans de Goede2019-01-072-16/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some board designs hook the jack-detect up to an external GPIO, rather then to one of the codec pins, add support for this. Figuring out which GPIO to use is pretty much board specific so I've chosen to let the machine driver pass the gpio_desc as data argument to snd_soc_component_set_jack() rather then add support for getting the GPIO to the codec driver. This keeps the codec code nice and clean. Note that using an external GPIO for this conflicts with button-press support, so this commit disables button-press support when an external GPIO is used. Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5651: Add ACPI ID 10EC5640Hans de Goede2019-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some BYT platforms have a RT5651 codec while using an ACPI node with a HID of 10EC5640 to describe the coded. Add the 10EC5640 HID to the acpi_device_id list, so that the rt5651 will bind to the codec on these devices. Like the rt5645 and rt5670 drivers which also have the 10EC5640 ACPI HID in their acpi_device_id list for similar reasons, the rt5651 driver checks the codecs device-id register so that it will only bind if the codec actually is a rt5651 and it will ignore actual rt5640 codecs. Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: sgtl5000: Allow SCLK pad drive strength to be changedAlison Wang2019-01-071-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces "sclk-strength" property to allow SCLK pad drive strength to be changed via device tree. When running playback test on LS1028ARDB, Tx Frame sync error interrupt will occur sometimes. Some noises also exist. After changing SCLK pad drive strength to the maximum value, the issues are gone. Signed-off-by: Alison Wang <alison.wang@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt298: fix boolean testsPierre-Louis Bossart2019-01-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Coccinelle: sound/soc/codecs/rt298.c:992:6-8: WARNING: Comparison to bool sound/soc/codecs/rt298.c:995:6-9: WARNING: Comparison to bool sound/soc/codecs/rt298.c:317:5-7: WARNING: Comparison to bool sound/soc/codecs/rt298.c:320:5-8: WARNING: Comparison to bool sound/soc/codecs/rt298.c:348:5-7: WARNING: Comparison to bool sound/soc/codecs/rt298.c:351:5-8: WARNING: Comparison to bool Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rl6437a: use __be32 for a __be32 bufBard liao2019-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The buf in rl6347a_hw_read is __be32. Cc: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5645: store eq kcontrol byte in __beBard liao2019-01-071-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The eq parameters binary is stored in __be. However, it is unsigned short in rt5645_eq_param_s{} which will cause incorrect type assignment. So add struct rt5645_eq_param_s_be16{} to store the eq binary and convert it to unsigned short in rt5645->eq_param. Cc: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>