summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
AgeCommit message (Collapse)Author
2020-07-24ASoC: max98390: Fix dac event dapm mixer.Steve Lee
Global EN register guide to off before AMP_EN register when amp disable sequence. - remove AMP_EN control before max98390_dac_event call Signed-off-by: Steve Lee <steves.lee@maximintegrated.com> Link: https://lore.kernel.org/r/20200724060058.19201-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-21ASoC: max98357a: move control of SD_MODE back to DAI opsTzung-Bi Shih
Partially reverts commit 128f825aeab7 ("ASoC: max98357a: move control of SD_MODE to DAPM"). In order to have mute control of max98357 from machine drivers, commit 128f825aeab7 ("ASoC: max98357a: move control of SD_MODE to DAPM") moves the control of SD_MODE from DAI ops to DAPM events. However, pop noise has been observed on rk3399-gru-kevin boards due to this commit. The commit 128f825aeab7 caused sequence of DAI clocks and SD_MODE changed on rk3399-gru-kevin boards. With the commit 128f825aeab7: - SD_MODE will be set to 1 before DAI clocks start. - SD_MODE will be set to 0 after DAI clocks stop. As a result, pop noise. Moves the control of SD_MODE back to DAI ops. In the meantime, uses an additional flag in DAPM event to provide chance of mute control for machine drivers. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Tested-By: Alper Nebi Yasak <alpernebiyasak@gmail.com> Link: https://lore.kernel.org/r/20200721114232.2812254-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16ASoC: rt5682: Report the button event in the headset type onlyOder Chiou
The irq work will be manipulated by resume function, and it will report the wrong jack type while the jack type is headphone in the button event. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200716030123.27122-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-14ASoC: rt5682: Enable Vref2 under using PLL2derek.fang
Enable Vref2 under long term using PLL2 to avoid clock unstable. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1594721600-29994-1-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09ASoC: rt286: fix unexpected interrupt happensShuming Fan
The HV/VREF should not turn off if the headphone jack plug-in. This patch could solve the unexpected interrupt issue in some devices. Signed-off-by: Shuming Fan <shumingf@realtek.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200709101345.11449-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09ASoC: wm8974: remove unsupported clock modePuyou Lu
In DSP_A mode, BIT7 of IFACE should bit 0 according to datasheet (ie. inverted frame clock is not support in this mode). Signed-off-by: Puyou Lu <puyou.lu@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/1593657056-4989-1-git-send-email-puyou.lu@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09ASoC: wm8974: fix Boost Mixer Aux SwitchPuyou Lu
Clear BIT6 of INPPGA means not muted (Switch On). Signed-off-by: Puyou Lu <puyou.lu@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/1593657025-4903-1-git-send-email-puyou.lu@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08ASoc: codecs: max98373: remove Idle_bias_on to let codec suspendranderwang
Idle_bias_on is used to decide bias on/off in standby state by dapm. When Idle_bias_on is set to one, dapm will keep max98373 active at idle time. Max98373 is doing nothing in this state, so remove idle_bias_on setting to let max98373 get suspended when it is idle. Signed-off-by: randerwang <rander.wang@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ryan Lee <ryans.lee@maximintegrated.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200707205740.114927-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08ASoC: codecs: max98373: Removed superfluous volume control from chip defaultRyan Lee
Volume control in probe function is not necessary. Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200707205740.114927-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01ASoC: rt5682: cancel jack_detect_work if hs_jack is set to null even ↵Oder Chiou
soundwire mode Base on https://patchwork.kernel.org/patch/11237953/ Soundwire mode also should follow it. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200701071645.32061-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29ASoC: rt5670: Fix dac- and adc- vol-tlv values being off by a factor of 10Hans de Goede
The adc_vol_tlv volume-control has a range from -17.625 dB to +30 dB, not -176.25 dB to + 300 dB. This wrong scale is esp. a problem in userspace apps which translate the dB scale to a linear scale. With the logarithmic dB scale being of by a factor of 10 we loose all precision in the lower area of the range when apps translate things to a linear scale. E.g. the 0 dB default, which corresponds with a value of 47 of the 0 - 127 range for the control, would be shown as 0/100 in alsa-mixer. Since the centi-dB values used in the TLV struct cannot represent the 0.375 dB step size used by these controls, change the TLV definition for them to specify a min and max value instead of min + stepsize. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200628155231.71089-5-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29ASoC: rt5670: Add new gpio1_is_ext_spk_en quirk and enable it on the Lenovo ↵Hans de Goede
Miix 2 10 The Lenovo Miix 2 10 has a keyboard dock with extra speakers in the dock. Rather then the ACL5672's GPIO1 pin being used as IRQ to the CPU, it is actually used to enable the amplifier for these speakers (the IRQ to the CPU comes directly from the jack-detect switch). Add a quirk for having an ext speaker-amplifier enable pin on GPIO1 and replace the Lenovo Miix 2 10's dmi_system_id table entry's wrong GPIO_DEV quirk (which needs to be renamed to GPIO1_IS_IRQ) with the new RT5670_GPIO1_IS_EXT_SPK_EN quirk, so that we enable the external speaker-amplifier as necessary. Also update the ident field for the dmi_system_id table entry, the Miix models are not Thinkpads. Fixes: 67e03ff3f32f ("ASoC: codecs: rt5670: add Thinkpad Tablet 10 quirk") Signed-off-by: Hans de Goede <hdegoede@redhat.com> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723 Link: https://lore.kernel.org/r/20200628155231.71089-4-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29ASoC: rt5670: Correct RT5670_LDO_SEL_MASKHans de Goede
The RT5670_PWR_ANLG1 register has 3 bits to select the LDO voltage, so the correct mask is 0x7 not 0x3. Because of this wrong mask we were programming the ldo bits to a setting of binary 001 (0x05 & 0x03) instead of binary 101 when moving to SND_SOC_BIAS_PREPARE. According to the datasheet 001 is a reserved value, so no idea what it did, since the driver was working fine before I guess we got lucky and it does something which is ok. Fixes: 5e8351de740d ("ASoC: add RT5670 CODEC driver") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200628155231.71089-3-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-24ASoC: rt5682: fix the pop noise while OMTP type headset pluginShuming Fan
To turn the headphone output switch off during jack type detection, it could avoid the pop noise when jack type switches to OMTP type. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20200623125312.27896-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17ASoC: hdac_hda: fix memleak with regmap not freed on removePierre-Louis Bossart
kmemleak throws error reports on module load/unload tests, add snd_hdac_regmap_exit() in .remove(). While we are at it, also fix the error handling flow in .probe() to use snd_hdac_regmap_exit() if needed. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20200617164144.17859-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: rt1015: Update rt1015 default register value according to spec ↵Jack Yu
modification. Update rt1015 default register value according to spec modification. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200615032433.31061-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: rt5682: Let dai clks be registered whether mclk exists or notderek.fang
According to ideal rt5682 CCF, the root clk is mclk. But in some platforms, mclk is not exported to CCF. In this condition, rt5682_register_dai_clks will not be called. This patch lets dai clks could be registered whether mclk exists or not. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1591938925-1070-5-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-11ASoC: max98390: Update regmap readable reg and volatileSteve Lee
Update max98390_readable_register and max98390_volatile_reg Signed-off-by: Steve Lee <steves.lee@maximintegrated.com> Link: https://lore.kernel.org/r/20200611094800.18422-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-09ASoC: rt5645: Add platform-data for Asus T101HAHans de Goede
The Asus T101HA uses the default jack-detect mode 3, but instead of using an analog microphone it is using a DMIC on dmic-data-pin 1, like the Asus T100HA. Note unlike the T100HA its jack-detect is not inverted. Add a DMI quirk with the correct settings for this model. 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/20200608204634.93407-2-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-04ASoC: max98390: Fix potential crash during param fw loadingSteve Lee
malformed firmware file can cause out-of-bound access and crash during dsm_param bin loading. - add MIN/MAX param size to avoid out-of-bound access. - read start addr and size of param and check bound. - add condition that fw->size > param_size + _PAYLOAD_OFFSET to confirm enough data. Signed-off-by: Steve Lee <steves.lee@maximintegrated.com> Link: https://lore.kernel.org/r/20200604054731.21140-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-04ASoC: max98390: Fix incorrect printf qualifierTakashi Iwai
This patch addresses a compile warning: sound/soc/codecs/max98390.c:781:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘size_t {aka const unsigned int}’ [-Wformat=] Fixes: a6e3f4f34cdb ("ASoC: max98390: Added Amplifier Driver") Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20200602164453.29925-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-04ASoC: rl6231: Modify the target DMIC clock rateOder Chiou
Some DMIC components will not work correctly in the clock rate 3.072MHz. We recommend the clock rate 1.536MHz in the gerenal case. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200604071016.3981-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-29ASoC: rt1015: Enable class-D silence and clock detectionsderek.fang
Avoid noise under bypass boost mode. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1590750310-30085-1-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-28ASoC: sta32x: add missed function calls in error pathsChuhong Yuan
sta32x_probe() forgets to call undo functions when it fails, add the missed function calls to fix it. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Link: https://lore.kernel.org/r/20200528102004.911653-1-hslester96@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-28ASoC: rt5682: split i2c driver into separate moduleArnd Bergmann
With SND_SOC_AMD_RV_RT5682_MACH using the i2c version of the driver, we can easily get a build failure when I2C is built-in but soundwire is not: WARNING: unmet direct dependencies detected for SND_SOC_RT5682 Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (I2C [=y] || SOUNDWIRE [=m]) && (SOUNDWIRE [=m] || !SOUNDWIRE [=m]) && (I2C [=y] || !I2C [=y]) Selected by [y]: - SND_SOC_AMD_RV_RT5682_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AMD_ACP3x [=y] && I2C [=y] && CROS_EC [=y] Selected by [m]: - SND_SOC_RT5682_SDW [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SOUNDWIRE [=m] && (I2C [=y] || !I2C [=y]) Rework the driver to have three separate modules, with the main driver just dealing with the common bits and the actual initialization as part of i2c and sdw specific modules. The conversion is fairly mechanical to keep it easy to review, i.e. it moves code around with the minimal required renaming and changes. Fixes: 6b8e4e7db3cd ("ASoC: amd: Add machine driver for Raven based platform") Fixes: fd443a20c2f0 ("ASoC: rt5682: fix I2C/Soundwire dependencies") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200528091851.2889754-1-arnd@arndb.de Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-28ASoC: nau8810: add I2C device and compatible IDSeven Lee
The nau8810 driver can also compatible with nau8812 and nau8814. Signed-off-by: Seven Lee <wtli@nuvoton.com> Link: https://lore.kernel.org/r/20200528070510.29959-1-wtli@nuvoton.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-28ASoC: ingenic: Unconditionally depend on devicetreePaul Cercueil
All boards with Ingenic SoCs probe with devicetree already, we have no use for a non-devicetree path. This solves some compilation warnings that were caused by unused variables in the case where CONFIG_OF was disabled. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20200523125455.12392-1-paul@crapouillou.net Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-27ASoC: tlv320adcx140: Fix warnings when using W=1Dan Murphy
Fix the warnings when using the W=1 compiler flag. sound/soc/codecs/tlv320adcx140.c: In function ‘adcx140_reset’: sound/soc/codecs/tlv320adcx140.c:570:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] 570 | int ret = 0; | ^~~ This was set but only used in case where the reset GPIO is not defined. Have the function return the value of ret. sound/soc/codecs/tlv320adcx140.c: In function ‘adcx140_codec_probe’: sound/soc/codecs/tlv320adcx140.c:778:18: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 778 | if (bias_source < ADCX140_MIC_BIAS_VAL_VREF || | ^ sound/soc/codecs/tlv320adcx140.c:789:18: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 789 | if (vref_source < ADCX140_MIC_BIAS_VREF_275V || This condition will not occur since if the dt property is not set then the *_source variable is set to the default value. So there is no way that *_source can be less then 0. Which is what each #define is set to. The code just needs to make sure that the dt property is not out of the upper bounds. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20200526175247.15309-1-dmurphy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-27ASoC: wm8962: Fix runtime PM imbalance on errorDinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20200527024625.9937-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-27ASoC: tlv320adcx140: Add support for configuring GPI pinsDan Murphy
Add support to configure the GPI pins to the specific configuration. The pins can be disabled or be configured as data input for any of the digital mic channels. In addition the GPI can be used a a general purpose input, a Master clock input or an ASI input for daisy chaining devices. Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20200526200917.10385-2-dmurphy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-26ASoC: tas2552: Fix runtime PM imbalance in tas2552_component_probeDinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20200525071732.5887-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-26ASoC: fix semicolon.cocci warningskbuild test robot
sound/soc/codecs/zl38060.c:298:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 52e8a94baf90 ("ASoC: Add initial ZL38060 driver") Signed-off-by: kbuild test robot <lkp@intel.com> CC: Sven Van Asbroeck <thesven73@gmail.com> Link: https://lore.kernel.org/r/20200525184351.GA37386@5cf39b9a5cc3 Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25ASoC: max98390: Added Amplifier DriverSteve Lee
This is the initial amplifier driver for max98390. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Steve Lee <steves.lee@maximintegrated.com> Link: https://lore.kernel.org/r/20200518005038.21074-1-steves.lee@maximintegrated.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-22ASoC: max9867: keep ADCs and DACs always onPavel Dobias
Updating power management register requires toggling the shutdown bit otherwise it causes unexpected behavior of the codec. However, toggling the shutdown bit results in loud speaker crackling. Setup the power management register only at startup to avoid that. Signed-off-by: Pavel Dobias <dobias@2n.cz> Link: https://lore.kernel.org/r/20200522142957.18364-3-dobias@2n.cz Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-22ASoC: max9867: add digital microphone controlsPavel Dobias
MAX9867 codec has a possibility of connecting digital microphones. Add DAPM controls to be able to enable them. Signed-off-by: Pavel Dobias <dobias@2n.cz> Link: https://lore.kernel.org/r/20200522142957.18364-2-dobias@2n.cz Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-20ASoC: max9867: add mono playback switchPavel Dobias
Add Mono Playback switch to codec controls which enables codec's capability of mixing left and right channel at the DAC output. Signed-off-by: Pavel Dobias <dobias@2n.cz> Link: https://lore.kernel.org/r/20200520071904.15801-5-dobias@2n.cz Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-20ASoC: max9867: add filter controlsPavel Dobias
Adding missing codec controls - ADC/DAC IIR filter selection. Signed-off-by: Pavel Dobias <dobias@2n.cz> Link: https://lore.kernel.org/r/20200520071904.15801-3-dobias@2n.cz Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-20ASoC: max9867: don't use regmap defaultsPavel Dobias
MAX9867 codec doesn't have reset pin, so the registers don't have default values in the case of reboot without powering off. Remove the reg_defaults struct and let the regmap read initial state of the registers at startup instead of taking them from reg_defaults struct. Signed-off-by: Pavel Dobias <dobias@2n.cz> Link: https://lore.kernel.org/r/20200520071904.15801-2-dobias@2n.cz Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18Merge series "ASoC: cleanup DAI/Component activity" from Kuninori Morimoto ↵Mark Brown
<kuninori.morimoto.gx@renesas.com>: Hi Mark These are v3 of DAI/Component activity cleanup. This patch-set exchanges soc-dapm.c :: snd_soc_dai_link_event_xxx() behavior which updates dai->active but not cares other actives. But I think original code was wrong. So, I believe these works correctly, but maybe need some tests or deep review. v1 -> v2 - function naming "activity" -> "active" v2 -> v3 - macro -> inline function - added Reviewed-by from Ranjani, Acked-by from Peter Link: https://lore.kernel.org/r/875zd39frp.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87blmq9alx.wl-kuninori.morimoto.gx@renesas.com Kuninori Morimoto (21): ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro ASoC: soc-dai: add snd_soc_dai_action() ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate() ASoC: soc-dai: add snd_soc_dai_active() ASoC: soc-component: add snd_soc_component_active() ASoC: soc-dai: add snd_soc_dai_stream_active() ASoC: use snd_soc_xxx_active() ASoC: atomel: use snd_soc_xxx_active() ASoC: bcm: use snd_soc_xxx_active() ASoC: cirrus: use snd_soc_xxx_active() ASoC: codecs: use snd_soc_xxx_active() ASoC: fsl: use snd_soc_xxx_active() ASoC: intel: use snd_soc_xxx_active() ASoC: jz4740: use snd_soc_xxx_active() ASoC: mediatek: use snd_soc_xxx_active() ASoC: meson: use snd_soc_xxx_active() ASoC: pxa: use snd_soc_xxx_active() ASoC: ti: use snd_soc_xxx_active() ASoC: uniphier: use snd_soc_xxx_active() ASoC: dwc: use snd_soc_xxx_active() ASoC: cleanup dai / component active code include/sound/soc-component.h | 6 +- include/sound/soc-dai.h | 21 +++++- include/sound/soc.h | 15 ++++- sound/soc/atmel/atmel_ssc_dai.c | 4 +- sound/soc/bcm/bcm2835-i2s.c | 6 +- sound/soc/bcm/cygnus-ssp.c | 4 +- sound/soc/cirrus/ep93xx-i2s.c | 4 +- sound/soc/codecs/adav80x.c | 4 +- sound/soc/codecs/arizona.c | 2 +- sound/soc/codecs/cs4271.c | 4 +- sound/soc/codecs/madera.c | 2 +- sound/soc/codecs/max98090.c | 6 +- sound/soc/codecs/tlv320aic23.c | 2 +- sound/soc/codecs/tlv320dac33.c | 2 +- sound/soc/codecs/uda1380.c | 2 +- sound/soc/codecs/wl1273.c | 2 +- sound/soc/codecs/wm8711.c | 2 +- sound/soc/codecs/wm8753.c | 4 +- sound/soc/dwc/dwc-i2s.c | 2 +- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_spdif.c | 4 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 14 ++-- sound/soc/jz4740/jz4740-i2s.c | 8 +-- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 8 +-- sound/soc/meson/axg-tdm-interface.c | 2 +- sound/soc/pxa/pxa-ssp.c | 8 +-- sound/soc/pxa/pxa2xx-i2s.c | 2 +- sound/soc/soc-compress.c | 4 +- sound/soc/soc-core.c | 11 +-- sound/soc/soc-dai.c | 23 +++++++ sound/soc/soc-dapm.c | 8 +-- sound/soc/soc-pcm.c | 70 +++++++------------- sound/soc/ti/davinci-mcasp.c | 2 +- sound/soc/ti/omap-dmic.c | 4 +- sound/soc/ti/omap-mcbsp.c | 4 +- sound/soc/ti/omap-mcpdm.c | 8 +-- sound/soc/uniphier/aio-cpu.c | 4 +- 37 files changed, 155 insertions(+), 125 deletions(-) -- 2.17.1
2020-05-18Merge series "ASoC: codecs: rt*-sdw: memory leaks and simplifications" from ↵Mark Brown
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: While debugging unrelated memory corruption errors, I detected issues related to the interaction with the SoundWire and ASoC cores, here are 3 small patches to fix all this. Pierre-Louis Bossart (3): ASoC: codecs: rt*-sdw: don't assign slave_ops ASoC: codecs: rt*-sdw: fix memory leak in set_sdw_stream() ASoC: codecs: rt1308-sdw: remove duplicate allocation sound/soc/codecs/rt1308-sdw.c | 11 +++-------- sound/soc/codecs/rt5682-sdw.c | 3 --- sound/soc/codecs/rt5682.c | 3 +++ sound/soc/codecs/rt700-sdw.c | 3 --- sound/soc/codecs/rt700.c | 3 +++ sound/soc/codecs/rt711-sdw.c | 3 --- sound/soc/codecs/rt711.c | 3 +++ sound/soc/codecs/rt715-sdw.c | 3 --- sound/soc/codecs/rt715.c | 3 +++ 9 files changed, 15 insertions(+), 20 deletions(-) base-commit: d731c1a0f935dbebf4a851e072f8c7309eb2b8c5 -- 2.20.1
2020-05-18ASoC: codecs: use snd_soc_xxx_active()Kuninori Morimoto
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87wo5e58j4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: da7213: move set_pll to codec levelSebastian Reichel
Move set_pll function to component level, so that it can be used at both component and DAI level. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/20200511132544.82364-5-sebastian.reichel@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: da7213: move set_sysclk to codec levelSebastian Reichel
Move set_sysclk function to component level, so that it can be used at both component and DAI level. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/20200511132544.82364-4-sebastian.reichel@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: da7213: Add regulator supportSebastian Reichel
This adds support for most regulators of da7212 for improved power management. The only thing skipped was the speaker supply, which has some undocumented dependencies. It's supposed to be either always-enabled or always-disabled. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/20200511132544.82364-3-sebastian.reichel@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: da7213: Add da7212 DT compatibleSebastian Reichel
This adds a compatible for da7212. It's handled exactly the same way as DA7213 and follows the ACPI bindings. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20200511132544.82364-2-sebastian.reichel@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: codecs: rt1308-sdw: remove duplicate allocationPierre-Louis Bossart
The .read_prop callback is supposed to be called by the SoundWire core only. Calling it again from this driver results in an additional memory allocation for no good reason. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Cc: Oder Chiou <oder_chiou@realtek.com> Cc: Shuming Fan <shumingf@realtek.com> Cc: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200515211531.11416-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: codecs: rt*-sdw: fix memory leak in set_sdw_stream()Pierre-Louis Bossart
Now that the sdw_stream is allocated in machine driver, set_sdw_stream() is also called with a NULL argument during the dailink shutdown. In this case, the drivers should not allocate any memory, and just return. Detected with KASAN/kmemleak. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Cc: Oder Chiou <oder_chiou@realtek.com> Cc: Shuming Fan <shumingf@realtek.com> Cc: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200515211531.11416-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: codecs: rt*-sdw: don't assign slave_opsPierre-Louis Bossart
The SoundWire bus core already assigns the slave ops, no need to set them a second time manually in each driver. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Cc: Oder Chiou <oder_chiou@realtek.com> Cc: Shuming Fan <shumingf@realtek.com> Cc: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200515211531.11416-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-15ASoC: cros_ec_codec: switch to library API for SHA-256Ard Biesheuvel
The CrOS EC codec driver uses SHA-256 explicitly, and not in a performance critical manner, so there is really no point in using the SHASH crypto API here. Let's switch to the library API instead. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Tzung-Bi Shih <tzungbi@google.com> Cc: Cheng-Yi Chiang <cychiang@chromium.org> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com> Cc: Guenter Roeck <groeck@chromium.org> Cc: Benson Leung <bleung@chromium.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Eric Biggers <ebiggers@kernel.org> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200515100309.20795-1-ardb@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-14Merge branch 'for-5.7' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8