summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
AgeCommit message (Collapse)AuthorFilesLines
2021-10-15Merge tag 'asoc-fix-v5.15-rc5' of ↵Takashi Iwai8-21/+29
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.15 A colletion of smallish mostly driver specific fixes, the biggest thing here is fixing some of the core code to generate change notifications properly when writing to controls which will fix issues with UIs not showing the correct values. There's one build fix here with a slightly misleading changelog saying it's adding IRQ config support, it's adding a missing select of the regmap-irq code rather than adding a feature.
2021-10-13ASoC: wm8960: Fix clock configuration on slave modeShengjiu Wang1-3/+10
There is a noise issue for 8kHz sample rate on slave mode. Compared with master mode, the difference is the DACDIV setting, after correcting the DACDIV, the noise is gone. There is no noise issue for 48kHz sample rate, because the default value of DACDIV is correct for 48kHz. So wm8960_configure_clocking() should be functional for ADC and DAC function even if it is slave mode. In order to be compatible for old use case, just add condition for checking that sysclk is zero with slave mode. Fixes: 0e50b51aa22f ("ASoC: wm8960: Let wm8960 driver configure its bit clock and frame clock") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/1634102224-3922-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-12ASoC: cs42l42: Ensure 0dB full scale volume is used for headsetsStefan Binding1-13/+3
Ensure the default 0dB playback path is always used. The code that set FULL_SCALE_VOL based on LOAD_DET_RCSTAT was spurious, and resulted in a -6dB attenuation being accidentally inserted into the playback path. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20211011144903.28915-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07ASoC: codec: wcd938x: Add irq config supportSrinivasa Rao Mandadapu1-0/+1
This patch fixes compilation error in wcd98x codec driver. Fixes: 045442228868 ("ASoC: codecs: wcd938x: add audio routing and Kconfig") Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org> Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/1633614675-27122-1-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07ASoC: wcd938x: Fix jack detection issueSrinivasa Rao Mandadapu1-3/+3
This patch is to fix audio 3.5mm jack detection failure on wcd938x codec based target. Fixes: bcee7ed09b8e (ASoC: codecs: wcd938x: add Multi Button Headset Control support) Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org> Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/1633614619-27026-1-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30ASoC: nau8824: Fix headphone vs headset, button-press detection no longer ↵Hans de Goede1-2/+2
working Commit 1d25684e2251 ("ASoC: nau8824: Fix open coded prefix handling") replaced the nau8824_dapm_enable_pin() helper with direct calls to snd_soc_dapm_enable_pin(), but the helper was using snd_soc_dapm_force_enable_pin() and not forcing the MICBIAS + SAR supplies on breaks headphone vs headset and button-press detection. Replace the snd_soc_dapm_enable_pin() calls with snd_soc_dapm_force_enable_pin() to fix this. Cc: stable@vger.kernel.org Fixes: 1d25684e2251 ("ASoC: nau8824: Fix open coded prefix handling") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210929201512.460360-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27ASoC: cs4341: Add SPI device ID tableMark Brown1-0/+7
Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding SPI IDs for parts that only have a compatible listed. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown <broonie@kernel.org> Cc: patches@opensource.cirrus.com Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210924194844.45974-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27ASoC: pcm179x: Add missing entries SPI to device ID tableMark Brown1-0/+1
Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding SPI IDs for parts that only have a compatible listed. Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210924194956.46079-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-21ASoC: pcm512x: Mend accesses to the I2S_1 and I2S_2 registersPeter Rosin1-0/+2
Commit 25d27c4f68d2 ("ASoC: pcm512x: Add support for more data formats") breaks the TSE-850 device, which is using a pcm5142 in I2S and CBM_CFS mode (maybe not relevant). Without this fix, the result is: pcm512x 0-004c: Failed to set data format: -16 And after that, no sound. This fix is not 100% correct. The datasheet of at least the pcm5142 states that four bits (0xcc) in the I2S_1 register are "RSV" ("Reserved. Do not access.") and no hint is given as to what the initial values are supposed to be. So, specifying defaults for these bits is wrong. But perhaps better than a broken driver? Fixes: 25d27c4f68d2 ("ASoC: pcm512x: Add support for more data formats") Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Kirill Marinushkin <kmarinushkin@birdec.com> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> Link: https://lore.kernel.org/r/2d221984-7a2e-7006-0f8a-ffb5f64ee885@axentia.se Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-09Merge tag 'sound-fix-5.15-rc1' of ↵Linus Torvalds1-3/+0
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes that have been gathered before rc1, including a few regression fixes for the problem in the previous pull request" * tag 'sound-fix-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: gus: Fix repeated probe for ISA interwave card ALSA: gus: Fix repeated probes of snd_gus_create() ALSA: vx222: fix null-ptr-deref ASoC: rockchip: i2s: Fix concurrency between tx/rx ASoC: mt8195: correct the dts parsing logic about DPTX and HDMITX ASoC: Intel: boards: Fix CONFIG_SND_SOC_SDW_MOCKUP select ASoC: dt-bindings: fsl_rpmsg: Add compatible string for i.MX8ULP ALSA: usb-audio: Add registration quirk for JBL Quantum 800 ASoC: rt5682: fix headset background noise when S3 state ASoC: dt-bindings: mt8195: remove dependent headers in the example ASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK ASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device" ASoC: audio-graph: respawn Platform Support ASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency
2021-09-01Merge tag 'sound-5.15-rc1' of ↵Linus Torvalds24-232/+1126
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "There are a few intensive changes in ALSA core side at this time that helped with significant code reduction. Meanwhile we keep getting new stuff, so the total size still grows... Anyway, the below are some highlights in this development cycle. ALSA core: - New helpers to manage page allocations and card object with devres - Refactoring for memory allocation with wc-pages - A new PCM hardware flag SNDRV_PCM_INFO_EXPLICIT_SYNC for controlling the explicit sync of the stream control; it'll be used for ASoC SOF and non-coherent memory in future ASoC: - Lots of cleanups and improvements to the Intel drivers, including some new systems support - New support for AMD Vangoh, CUI CMM-4030D-261, Mediatek Mt8195, Renesas RZ/G2L Mediatek Mt8195, RealTek RT101P, Renesas RZ/G2L, Rockchip RK3568 S/PDIF USB-audio: - Re-organized the quirk handling and a new option quirk_flags - Fix for a regression in 5.14 code change for JACK - Quirks for Sony WALKMAN, Digidesign mbox HD-audio: - Enhanced support for CS8409 codec - More consistent shutdown behavior with the runtime PM - The model option can accept the PCI or codec SSID as an alias - Quirks for ASUS ROG, HP Spectre x360 Others: - Lots of code reduction in legacy drivers with devres helpers - FireWire MOTU 896HD support" * tag 'sound-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (421 commits) ASoC: Revert PCM trigger changes ALSA: usb-audio: Add lowlatency module option ALSA: hda/cs8409: Initialize Codec only in init fixup. ALSA: hda/cs8409: Ensure Type Detection is only run on startup when necessary ALSA: usb-audio: Work around for XRUN with low latency playback ALSA: pcm: fix divide error in snd_pcm_lib_ioctl ASoC: soc-pcm: test refcount before triggering ASoC: soc-pcm: protect BE dailink state changes in trigger ASoC: wcd9335: Disable irq on slave ports in the remove function ASoC: wcd9335: Fix a memory leak in the error handling path of the probe function ASoC: wcd9335: Fix a double irq free in the remove function ALSA: hda: Disable runtime resume at shutdown ASoC: rockchip: i2s: Add support for frame inversion ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs ASoC: rockchip: i2s: Add compatible for more SoCs ASoC: rockchip: i2s: Make playback/capture optional ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B ASoC: dt-bindings: rockchip: Document reset property for i2s ASoC: rockchip: i2s: Fix regmap_ops hang ASoC: rockchip: i2s: Improve dma data transfer efficiency ...
2021-09-01ASoC: rt5682: fix headset background noise when S3 stateShuming Fan1-3/+0
Remove CBJ power off setting to avoid floating state. Signed-off-by: Jack Yu <jack.yu@realtek.com> Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20210901100754.21045-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-26ASoC: wcd9335: Disable irq on slave ports in the remove functionChristophe JAILLET1-0/+11
The probe calls 'wcd9335_setup_irqs()' to enable interrupts on all slave ports. This must be undone in the remove function. Add a 'wcd9335_teardown_irqs()' function that undoes 'wcd9335_setup_irqs()' function, and call it from the remove function. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Message-Id: <8f761244d79bd4c098af8a482be9121d3a486d1b.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-26ASoC: wcd9335: Fix a memory leak in the error handling path of the probe ↵Christophe JAILLET1-1/+10
function If 'wcd9335_setup_irqs()' fails, me must release the memory allocated in 'wcd_clsh_ctrl_alloc()', as already done in the remove function. Add an error handling path and the missing 'wcd_clsh_ctrl_free()' call. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Message-Id: <6dc12372f09fabb70bf05941dbe6a1382dc93e43.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-26ASoC: wcd9335: Fix a double irq free in the remove functionChristophe JAILLET1-1/+0
There is no point in calling 'free_irq()' explicitly for 'WCD9335_IRQ_SLIMBUS' in the remove function. The irqs are requested in 'wcd9335_setup_irqs()' using a resource managed function (i.e. 'devm_request_threaded_irq()'). 'wcd9335_setup_irqs()' requests all what is defined in the 'wcd9335_irqs' structure. This structure has only one entry for 'WCD9335_IRQ_SLIMBUS'. So 'devm_request...irq()' + explicit 'free_irq()' would lead to a double free. Remove the unneeded 'free_irq()' from the remove function. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Message-Id: <0614d63bc00edd7e81dd367504128f3d84f72efa.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-25ASoC: rt5682: Fix the vol+ button detection issueDerek Fang1-6/+8
Fix the wrong button vol+ detection issue with some brand headsets by fine tuning the threshold of button vol+ and SAR ADC button accuracy. Signed-off-by: Derek Fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/20210825040346.28346-1-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-25Merge branch 'for-5.14' of ↵Mark Brown2-1/+2
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.15
2021-08-24ASoC: wm_adsp: Put debugfs_remove_recursive back inCharles Keepax1-0/+2
This patch reverts commit acbf58e53041 ("ASoC: wm_adsp: Let soc_cleanup_component_debugfs remove debugfs"), and adds an alternate solution to the issue. That patch removes the call to debugfs_remove_recursive, which cleans up the DSPs debugfs. The intention was to avoid an unbinding issue on an out of tree driver/platform. The issue with the patch is it means the driver no longer cleans up its own debugfs, instead relying on ASoC to remove recurive on the parent debugfs node. This is conceptually rather unclean, but also it would prevent DSPs being added/removed independently of ASoC and soon we are going to be upstreaming some non-audio parts with these DSPs, which will require this. Finally, it seems the issue on the platform is a result of the wm_adsp2_cleanup_debugfs getting called twice. This is very likely a problem on the platform side and will be resolved there. But in the mean time make the code a little more robust to such issues, and again conceptually a bit nicer, but clearing the debugfs_root variable in the DSP structure when the debugfs is removed. Fixes: acbf58e53041 ("ASoC: wm_adsp: Let soc_cleanup_component_debugfs remove debugfs" Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210824101552.1119-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-24Merge tag 'soundwire-5.15-rc1' of ↵Greg Kroah-Hartman3-0/+332
git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next Vinod writes: soundwire updates for 5.15-rc1 - Core has updates to support SoundWire mockup device (includes tag from asoc), improved error handling and slave status. - Drivers has update on Intel driver for new quriks and better handling of errors and suspend routines * tag 'soundwire-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: cadence: do not extend reset delay soundwire: intel: conditionally exit clock stop mode on system suspend soundwire: intel: skip suspend/resume/wake when link was not started soundwire: intel: fix potential race condition during power down soundwire: cadence: override PDI configurations to create loopback soundwire: cadence: add debugfs interface for PDI loopbacks soundwire: stream: don't program mockup device ports soundwire: bus: squelch error returned by mockup devices soundwire: add flag to ignore all command/control for mockup devices soundwire: stream: don't abort bank switch on Command_Ignored/-ENODATA soundwire: cadence: add paranoid check on self-clearing bits soundwire: dmi-quirks: add quirk for Intel 'Bishop County' NUC M15 soundwire: bus: update Slave status in sdw_clear_slave_status soundwire: cadence: Remove ret variable from sdw_cdns_irq() soundwire: bus: filter out more -EDATA errors on clock stop soundwire: dmi-quirks: add ull suffix for SoundWire _ADR values ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests ASoC: soc-acpi: tgl: add table for SoundWire mockup devices ASoC: soc-acpi: cnl: add table for SoundWire mockup devices ASoC: codecs: add SoundWire mockup device support
2021-08-23ASoC: rt1015: remove possible unused variable `bclk_ms'Tzung-Bi Shih1-5/+2
bclk_ms is possible unused by using the given config (see [1]). sound/soc/codecs/rt1015.c:724:2: warning: Value stored to 'bclk_ms' is never read [clang-analyzer-deadcode.DeadStores] bclk_ms = frame_size > 32; ^ ~~~~~~~~~~~~~~~ In addition, bclk_ms is meaningless and confusing after applying commit a5db2ca51367 ("ASoC: rt1015: remove unneeded variables in rt1015_priv"). The "> 32" in the expression looks like a typo but it was not. Let's remove the confusing variable bclk_ms. [1]: https://lkml.org/lkml/2021/8/23/305 Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210823153323.1297723-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-23ASoC: ics43432: add CMM-4030D-261 supportAngelo Dureghello2-2/+4
Despite minimal datasheet differences, the driver seems perfectly compatible with CMM-4030D-261. Tested CMM-4030D-261 to work with this changes: / { cmm4030d: cmm4030d { #sound-dai-cells = <0>; compatible = "cui,cmm-4030d-261"; }; sound_mic { compatible = "simple-audio-card"; simple-audio-card,name = "i2s mem mic"; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-master = <&sound_master>; simple-audio-card,frame-master = <&sound_master>; sound_master: simple-audio-card,cpu { sound-dai = <&ssi2>; system-clock-frequency = <2822400>; }; simple-audio-card,codec { sound-dai = <&cmm4030d>; }; }; }; Audio has been captured and tested successfully by: arecord -D "hw:1,0" -f S24_LE > test.wav aplay test.wav Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com> Link: https://lore.kernel.org/r/20210821082658.4147595-1-angelo.dureghello@timesys.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: rt5640: Add rt5640_set_ovcd_params() helperHans de Goede2-20/+34
Some devices don't use the builtin jack-detect but can still benefit from the mic-bias-current over-current-detection to differentiate between headphones vs a headset. Move the ovcd init code from rt5640_enable_jack_detect() into a new rt5640_set_ovcd_params() helper and export this helper as well as a couple of related ovcd functions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-5-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset()Hans de Goede2-4/+12
Some devices don't use the builtin jack-detect but can still benefit from the mic-bias-current over-current-detection headphones vs headset detection done by rt5640_detect_headset(). In this case the jack-inserted check done by rt5640_detect_headset() needs to be done through a GPIO rather then by using the codec's builtin jack-detect. Add an optional hp_det_gpio parameter and export rt5640_detect_headset() for use on machines where jack-detect is handled outside of the codec. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-4-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jackHans de Goede1-17/+13
Delay requesting the IRQ until the machine-drv calls set_jack. The main reason for this is that the codec's IRQ is unused on some boards, in which case we really should not call request_irq at all. On some boards there is an IRQ listed at index 0 for the codec, but this is not connected to the codec, but rather is directly connected to the jack's jack-detect pin. These special setups will be handled by the machine-driver, but the machine driver can only request the IRQ if it is not first requested by the codec driver. Moving the request_irq to the set_jack callback (which will not get called in this case) avoids the codec-driver clobbering the IRQ. Moving the request_irq also removes the need to disable the IRQ immediately after requesting it, avoiding a small race (this could also have been fixed by using the new IRQF_NO_AUTOEN flag when requesting the IRQ). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-3-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c fileHans de Goede1-23/+23
Move rt5640_disable_jack_detect() to above rt5640_enable_jack_detect(). This is a preparation patch for reworking how the IRQ gets requested. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-2-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: rt5682: Remove unused variable in rt5682_i2c_remove()Douglas Anderson1-2/+0
In commit 772d44526e20 ("ASoC: rt5682: Properly turn off regulators if wrong device ID") I deleted code but forgot to delete a variable that's now unused. Delete it. Fixes: 772d44526e20 ("ASoC: rt5682: Properly turn off regulators if wrong device ID") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210813073402.1.Iaa9425cfab80f5233afa78b32d02b6dc23256eb3@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-12ASoC: rt5682: Properly turn off regulators if wrong device IDDouglas Anderson1-1/+12
When I booted up on a board that had a slightly different codec stuffed on it, I got this message at bootup: rt5682 9-001a: Device with ID register 6749 is not rt5682 That's normal/expected, but what wasn't normal was the splat that I got after: WARNING: CPU: 7 PID: 176 at drivers/regulator/core.c:2151 _regulator_put+0x150/0x158 pc : _regulator_put+0x150/0x158 ... Call trace: _regulator_put+0x150/0x158 regulator_bulk_free+0x48/0x70 devm_regulator_bulk_release+0x20/0x2c release_nodes+0x1cc/0x244 devres_release_all+0x44/0x60 really_probe+0x17c/0x378 ... This is because the error paths don't turn off the regulator. Let's fix that. Fixes: 0ddce71c21f0 ("ASoC: rt5682: add rt5682 codec driver") Fixes: 87b42abae99d ("ASoC: rt5682: Implement remove callback") Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210811081751.v2.1.I4a1d9aa5d99e05aeee15c2768db600158d76cab8@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-12ASoC: rt5682: Adjust headset volume button threshold againDerek Fang1-1/+0
This reverts commit 6d20bf7c020f417fdef1810a22da17c126603472. Since it may risk affecting other headset Vol- button. Signed-off-by: Derek Fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/20210811083750.26680-1-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09ASoC: rt1015p: add new acpi id and comapatible idJack Yu1-0/+2
Add new acpi id and compatible id for rt1015p. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/22be83429956486f9f64b424c26be810@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09ASoC: max98390: Add support change dsm param nameSteve Lee2-6/+21
In case of using different type of speaker, support using different dsm parameter bin file for each amp connected. Signed-off-by: Steve Lee <steves.lee@maximintegrated.com> Link: https://lore.kernel.org/r/20210809142140.9293-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-06Merge tag 'asoc-fix-v5.14-rc4' of ↵Takashi Iwai9-79/+121
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.14 Quite a lot of fixes here, the biggest set being for the cs42l42 driver which is reasonably old but has seen a sudden uptick in activity. There's also some fixes for correctly referencing PCM buffer addresses and the removal of some driver-local bodges that had been done for the lack of prefix handling in DAPM which were broken by the core handling that as expected.
2021-08-06Merge some cs42l42 patches into asoc-5.15Mark Brown11-106/+180
2021-08-05ASoC: cs42l42: Update module authorsRichard Fitzgerald1-0/+3
Add the current authors of this module. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210805161111.10410-8-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: cs42l42: Assume 24-bit samples are in 32-bit slotsRichard Fitzgerald1-0/+7
If the machine driver doesn't call snd_soc_dai_set_sysclk() the SCLK is assumed to be sample_rate * sample_bits * 2 (that is, the rate necessary for a standard I2S frame). But 24-bit samples can be sent in either a 24-bit slot or a 32-bit slot. If the PLL is configured for a 24-bit slot, but a 32-bit slot is used, cs42l42 will be overclocked. Ultimately it is the machine driver's responsibilty to call snd_soc_dai_set_sysclk() if SLK will be different from the standard I2S rate. However, it is convenient to assume 32-bit slots to allow this common case without needing special machine driver support. The machine driver then only has to set SCLK if the slots are 24-bit, but if it fails to do this cs42l42 won't be overclocked. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210805161111.10410-7-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: cs42l42: Validate dai_set_sysclk() frequencyRichard Fitzgerald1-2/+15
If the machine driver calls snd_set_sysclk() with an unsupported SCLK frequency, return an error instead of letting hw_params() fail. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210805161111.10410-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: cs42l42: Add PLL configuration for 44.1kHz/16-bitRichard Fitzgerald1-0/+1
44.1kHz 16-bit standard I2S gives a SCLK of 1.4112 MHz. Add a PLL configuration for this. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210805161111.10410-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: rt5640: Silence warning message about missing interruptDmitry Osipenko1-8/+11
Interrupt is optional for the RT5640 codec. Nexus 7 doesn't use interrupt, this results in a noisy warning message that looks like a error condition. Make interrupt explicitly optional to silence the message, use modern IRQF_NO_AUTOEN flag and correct the reg[q]uest typo in the message. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210802185258.1881-1-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: codecs: wcd938x: add Multi Button Headset Control supportSrinivas Kandagatla2-23/+819
WCD938x has Multi Button Headset Control hardware to support Headset insertion, type detection, 8 headset buttons detection, Over Current detection and Impedence measurements. This patch adds support for this using wcd-mbhc apis. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210716105918.7301-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: cs42l42: Fix mono playbackRichard Fitzgerald2-2/+15
I2S always has two LRCLK phases and both CH1 and CH2 of the RX must be enabled (corresponding to the low and high phases of LRCLK.) The selection of the valid data channels is done by setting the DAC CHA_SEL and CHB_SEL. CHA_SEL is always the first (left) channel, CHB_SEL depends on the number of active channels. Previously for mono ASP CH2 was not enabled, the result was playing mono data would not produce any audio output. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 621d65f3b868 ("ASoC: cs42l42: Provide finer control on playback path") Link: https://lore.kernel.org/r/20210805161111.10410-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: cs42l42: Constrain sample rate to prevent illegal SCLKRichard Fitzgerald1-1/+20
The lowest valid SCLK corresponds to 44.1 kHz at 16-bit. Sample rates less than this would produce SCLK below the minimum when using a normal I2S frame. A constraint must be applied to prevent this. The constraint is not applied if the machine driver sets SCLK, to allow setups where the host generates additional bits per LRCLK phase to increase the SCLK frequency. In these cases the machine driver would always have to inform this driver of the actual SCLK, and it must select a legal SCLK. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210805161111.10410-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: cs42l42: Fix LRCLK frame start edgeRichard Fitzgerald1-9/+12
An I2S frame starts on the falling edge of LRCLK so ASP_STP must be 0. At the same time, move other format settings in the same register from cs42l42_pll_config() to cs42l42_set_dai_fmt() where you'd expect to find them, and merge into a single write. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 2c394ca79604 ("ASoC: Add support for CS42L42 codec") Link: https://lore.kernel.org/r/20210805161111.10410-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: cs42l42: PLL must be running when changing MCLK_SRC_SELRichard Fitzgerald2-7/+19
Both SCLK and PLL clocks must be running to drive the glitch-free mux behind MCLK_SRC_SEL and complete the switchover. This patch moves the writing of MCLK_SRC_SEL to when the PLL is started and stopped, so that it only transitions while the PLL is running. The unconditional write MCLK_SRC_SEL=0 in cs42l42_mute_stream() is safe because if the PLL is not running MCLK_SRC_SEL is already 0. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 43fc357199f9 ("ASoC: cs42l42: Set clock source for both ways of stream") Link: https://lore.kernel.org/r/20210805161111.10410-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: wcd938x: simplify return valuePierre-Louis Bossart1-1/+1
cppcheck warning: sound/soc/codecs/wcd938x.c:3701:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/codecs/wcd938x.c:3691:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/codecs/wcd938x.c:3701:9: note: Returning identical expression 'ret' return ret; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210804192456.278702-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: mt6359-accdet.c: remove useless assignmentsPierre-Louis Bossart1-4/+4
cppcheck warnings (and additional issue found by code inspection) sound/soc/codecs/mt6359-accdet.c:464:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210804192456.278702-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-05ASoC: max98090: remove duplicate status reads and useless assignmmentPierre-Louis Bossart1-3/+1
The logic for the jack detection has not changed since the first commit for this driver. Remove a duplicate read and remove useless assignment sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is reassigned a value before the old one has been used. [redundantAssignment] reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2161:7: note: reg is assigned reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is reassigned a value before the old one has been used. [redundantAssignment] reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2167:7: note: reg is assigned reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS); ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210804192456.278702-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-03ASoC: mediatek: mt6359: convert to use module_platform_driverNobuhiro Iwamatsu1-16/+1
Simplify the code by using module_platform_driver macro for mt6359-accdet. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> Link: https://lore.kernel.org/r/20210531051203.228567-1-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-03ASoC: rt5514: make array div static const, makes object smallerColin Ian King1-1/+1
Don't populate the array div on the stack but instead it static const. Makes the object code smaller by 48 bytes. Before: text data bss dec hex filename 53894 16368 128 70390 112f6 ./sound/soc/codecs/rt5514.o After: text data bss dec hex filename 53750 16464 128 70342 112c6 ./sound/soc/codecs/rt5514.o (gcc version 10.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210801064023.138359-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-03ASoC: codecs: ad193x: add support for 96kHz and 192kHz playback ratesCodrin Ciubotariu2-2/+32
ad193x devices support 96KHz and 192KHz sampling rates, when PLL/MCLK is referenced to 48kHz. Tested on ad1934. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Link: https://lore.kernel.org/r/20210803104825.2198335-1-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-03ASoC: cs42l42: Remove duplicate control for WNF filter frequencyRichard Fitzgerald1-10/+0
The driver was defining two ALSA controls that both change the same register field for the wind noise filter corner frequency. The filter response has two corners, at different frequencies, and the duplicate controls most likely were an attempt to be able to set the value using either of the frequencies. However, having two controls changing the same field can be problematic and it is unnecessary. Both frequencies are related to each other so setting one implies exactly what the other would be. Removing a control affects user-side code, but there is currently no known use of the removed control so it would be best to remove it now before it becomes a problem. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 2c394ca79604 ("ASoC: Add support for CS42L42 codec") Link: https://lore.kernel.org/r/20210803160834.9005-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-03ASoC: cs42l42: Fix inversion of ADC Notch Switch controlRichard Fitzgerald1-1/+1
The underlying register field has inverted sense (0 = enabled) so the control definition must be marked as inverted. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 2c394ca79604 ("ASoC: Add support for CS42L42 codec") Link: https://lore.kernel.org/r/20210803160834.9005-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>