summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tlv320aic32x4.c
AgeCommit message (Collapse)Author
2021-10-18ASoC: tlv320aic32x4: Make aic32x4_remove() return voidUwe Kleine-König
Up to now aic32x4_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20211015071113.2795767-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-06Merge some cs42l42 patches into asoc-5.15Mark Brown
2021-08-02ASoC: tlv320aic32x4: make array clocks static, makes object smallerColin Ian King
Don't populate the array clocks on the stack but instead it static. Makes the object code smaller by 316 bytes. Before: text data bss dec hex filename 63668 28264 0 91932 1671c ./sound/soc/codecs/tlv320aic32x4.o After: text data bss dec hex filename 62616 29000 0 91616 165e0 ./sound/soc/codecs/tlv320aic32x4.o (gcc version 10.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210801064807.138641-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22ASoC: tlv320aic32x4: Fix TAS2505/TAS2521 processing block selectionMarek Vasut
The TAS2505/TAS2521 does support only three processing block options, unlike TLV320AIC32x4 which supports 25. This is documented in TI slau472 2.5.1.2 Processing Blocks and Page 0 / Register 60: DAC Instruction Set - 0x00 / 0x3C. Limit the Processing Blocks maximum value to 3 on TAS2505/TAS2521 and select processing block PRB_P1 always, because for the configuration of teh codec implemented in this driver, this is the best quality option. Fixes: b4525b6196cd7 ("ASoC: tlv320aic32x4: add support for TAS2505") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Claudius Heine <ch@denx.de> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210720200348.182139-1-marex@denx.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11ASoC: tlv320aic32x4: Fix TAS2505/TAS2521 channel countMarek Vasut
The TAS2505/TAS2521 does support up to two channels, LEFT and RIGHT, which are being alternated on the audio data bus by Word Clock, WCLK. This is documented in TI slau472 2.7.1 Digital Audio Interface. Note that both the LEFT and RIGHT channels are only used for audio INPUT, while only the LEFT channel is used for audio OUTPUT. Fixes: b4525b6196cd7 ("ASoC: tlv320aic32x4: add support for TAS2505") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Claudius Heine <ch@denx.de> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210708091229.56443-1-marex@denx.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11ASoC: tlv320aic32x4: Fix TAS2505 volume controlsMarek Vasut
None of the TAS2505 outputs are stereo, do not pretend they are by implementing them using SOC*DOUBLE* macros referencing the same register twice, use SOC*SINGLE* instead. Fix volume ranges and mute control for the codec according to datasheet. Fixes: b4525b6196cd7 ("ASoC: tlv320aic32x4: add support for TAS2505") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Claudius Heine <ch@denx.de> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210708091255.56502-1-marex@denx.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23ASoC: tlv320aic32x4: add support for TAS2505Claudius Heine
This adds support for TAS2505 and TAS2521 to the tlv320aic32x4 driver. The TAS2505 seems to be a stripped down version of the TLV320AIC32X4 so it makes sense to handle them in the same driver. Signed-off-by: Claudius Heine <ch@denx.de> Link: https://lore.kernel.org/r/20210617085230.1851503-3-ch@denx.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23ASoC: tlv320aic32x4: add type to device private data structClaudius Heine
While this driver can already handle different device variants, the variant information cannot be used in the driver code and therefor cannot have different code paths depending on the device variant. This change adds a `type` value into the `aic32x4_priv` structure, that contains a device variant identifier, which was set when the driver was bound to the device. Signed-off-by: Claudius Heine <ch@denx.de> Link: https://lore.kernel.org/r/20210617085230.1851503-2-ch@denx.de Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-06ASoC: tlv320aic32x4: Register clocks before registering componentAnnaliese McDermond
Clock registration must be performed before the component is registered. aic32x4_component_probe attempts to get all the clocks right off the bat. If the component is registered before the clocks there is a race condition where the clocks may not be registered by the time aic32x4_componet_probe actually runs. Fixes: d1c859d314d8 ("ASoC: codec: tlv3204: Increased maximum supported channels") Cc: stable@vger.kernel.org Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Link: https://lore.kernel.org/r/0101017889850206-dcac4cce-8cc8-4a21-80e9-4e4bef44b981-000000@us-west-2.amazonses.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-06ASoC: tlv320aic32x4: Increase maximum register in regmapAnnaliese McDermond
AIC32X4_REFPOWERUP was added as a register, but the maximum register value in the regmap and regmap range was not correspondingly increased. This caused an error when this register was attempted to be written. Fixes: ec96690de82c ("ASoC: tlv320aic32x4: Enable fast charge") Cc: stable@vger.kernel.org Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Link: https://lore.kernel.org/r/0101017889851cab-ce60cfdb-d88c-43d8-bbd2-7fbf34a0c912-000000@us-west-2.amazonses.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21ASoC: tlv*: sync parameter naming (rate/sample_bits)Kuninori Morimoto
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87bldqolgw.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21Merge branch 'asoc-5.9' into asoc-5.10Mark Brown
2020-09-21ASoC: tlv320aic32x4: Enable fast chargeMiquel Raynal
At power-up the analog circuits may take up to one full second before being charged with the default configuration. Using the analog blocks before they are ready generates a *very* crappy sound. Enable the fast charge feature, which will require a bit more power than normal charge but will definitely speed up the starting operation by shrinking this delay to up to 40 ms. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20200911173140.29984-4-miquel.raynal@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21ASoC: tlv320aic32x4: Fix bdiv clock rate derivationMiquel Raynal
Current code expects a single channel to be always used. Fix this situation by forwarding the number of channels used. Then fix the derivation of the bdiv clock rate. Fixes: 96c3bb00239d ("ASoC: tlv320aic32x4: Dynamically Determine Clocking") Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20200911173140.29984-3-miquel.raynal@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: codec: tlv320aic32x4: do software reset before clock registrationMatthias Schiffer
To avoid the actual PLL settings to differ from the state expected by the clock driver, the codec should only be fully reset before the clocks are registered. But we also need to ensure that the software reset happens at all before clock registration, as not all boards have a reset GPIO. Move the software reset from aic32x4_component_probe() to aic32x4_probe() and reorder the reset and registration sequence: 1. Reset via GPIO (if available) 2. Reset via software 3. Register component 4. Register clocks Note that aic32x4_component_probe() is only called after aic32x4_probe() has finished, so the reset in aic32x4_component_probe() was happening too late. Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Link: https://lore.kernel.org/r/20200902133043.19504-2-matthias.schiffer@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: codec: tlv320aic32x4: fix missing aic32x4_disable_regulators() in ↵Matthias Schiffer
error path The regulators need to be disabled in the aic32x4_register_clocks() failure case as well. Fixes: 9d4befff5a95 ("ASoC: codec: tlv3204: Moving GPIO reset and add ADC reset") Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Link: https://lore.kernel.org/r/20200902133043.19504-1-matthias.schiffer@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-17ASoC: codec: tlv3204: Moving GPIO reset and add ADC resetMichael Sit Wei Hong
Moving GPIO reset to a later stage and before clock registration to ensure that the host system and codec clocks are in sync. If the host register clock values prior to gpio reset, the last configured codec clock is registered to the host. The codec then gets gpio resetted setting the codec clocks to their default value, causing a mismatch. Host system will skip clock setting thinking the codec clocks are already at the requested rate. ADC reset is added to ensure the next audio capture does not have undesired artifacts. It is probably related to the original code where the probe function resets the ADC prior to 1st record. Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com> Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200812094631.4698-4-michael.wei.hong.sit@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-17ASoC: codec: tlv3204: Increased maximum supported channelsMichael Sit Wei Hong
Increased maximum supported channel to 8 channels for audio capture running in TDM mode. Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com> Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200812094631.4698-3-michael.wei.hong.sit@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-17ASoC: codec: tlv3204: Enable 24 bit audio supportMichael Sit Wei Hong
Enable 24 bit in 32 bit container audio support. Using the params_physical_width to differentiate 24 bit in 32 bit container and 24 bit in 24 bit container modes. Use the sample rate, bit depth and channel parameters to calculate the bit clock needed. Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com> Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200812094631.4698-2-michael.wei.hong.sit@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16ASoC: codecs: tlv*: merge .digital_mute() into .mute_stream()Kuninori Morimoto
snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/874kqhxxhz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22ASoC: codecs: tlv*: rename to snd_soc_component_read()Kuninori Morimoto
We need to use snd_soc_component_read() instead of snd_soc_component_read32() This patch renames _read32() to _read() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87k1074mds.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-04treewide: remove redundant IS_ERR() before error code checkMasahiro Yamada
'PTR_ERR(p) == -E*' is a stronger condition than IS_ERR(p). Hence, IS_ERR(p) is unneeded. The semantic patch that generates this commit is as follows: // <smpl> @@ expression ptr; constant error_code; @@ -IS_ERR(ptr) && (PTR_ERR(ptr) == - error_code) +PTR_ERR(ptr) == - error_code // </smpl> Link: http://lkml.kernel.org/r/20200106045833.1725-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Cc: Julia Lawall <julia.lawall@lip6.fr> Acked-by: Stephen Boyd <sboyd@kernel.org> [drivers/clk/clk.c] Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> [GPIO] Acked-by: Wolfram Sang <wsa@the-dreams.de> [drivers/i2c] Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [acpi/scan.c] Acked-by: Rob Herring <robh@kernel.org> Cc: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-10-18ASoC: tlv320aic32x4: add a check for devm_clk_getChuhong Yuan
aic32x4_set_dai_sysclk misses a check for devm_clk_get and may miss the failure. Add a check to fix it. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Link: https://lore.kernel.org/r/20191018081448.8486-1-hslester96@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-21treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1Thomas Gleixner
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option [no]_[pad]_[ctrl] any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 176 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154040.652910950@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-02ASoC: tlv320aic32x4: Remove set but not used variable 'mclk_rate'YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: sound/soc/codecs/tlv320aic32x4.c: In function 'aic32x4_setup_clocks': sound/soc/codecs/tlv320aic32x4.c:669:16: warning: variable 'mclk_rate' set but not used [-Wunused-but-set-variable] It is not used since introduction in commit 96c3bb00239d ("ASoC: tlv320aic32x4: Dynamically Determine Clocking") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: tlv320aic32x4: Add Playback PowerTune ControlsAnnaliese McDermond
PowerTune controls the power level of the chip. On playback this indirectly controls things like the gain of the various output amplifiers. This can allow for the decrease of output levels from the codec. This adds controls for those power levels to the driver. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: tlv320aic32x4: Add Switch for Setting Common Mode VoltageAnnaliese McDermond
Add a switch for setting common mode voltage. This can allow for higher drive levels on the amplifier outputs. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04Merge branch 'asoc-5.1' into asoc-5.2Mark Brown
2019-04-01ASoC: tlv320aic32x4: Fix Common PinsAnnaliese McDermond
The common pins were mistakenly not added to the DAPM graph. Adding these pins will allow valid graphs to be created. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Allow 192000 Sample RateAnnaliese McDermond
The clocking and processing blocks are now properly set up to support 192000 sample rates. Allow drivers to ask for that. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Remove mclk referencesAnnaliese McDermond
mclk is not used by anything anymore. Remove support for it. All that information now comes from the clock tree. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Restructure set_dai_sysclkAnnaliese McDermond
The sysclk is now managed by the CCF. Change this function to merely find the system clock and set it using clk_set_rate. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Dynamically Determine ClockingAnnaliese McDermond
The existing code uses a static lookup table to determine the settings of the various clock devices on board the chip. This is limiting in a couple of ways. First, this doesn't allow for any master clock rates other than the three that have been precalculated. Additionally, new sample rates are difficult to add to the table. Witness that the chip is capable of 192000 Hz sampling, but it is not provided by this driver. Last, if the driver is clocked by something that isn't a crystal, the upstream clock may not be able to achieve exactly the rate requested in the driver. This will mean that clocking will be slightly off for the sampling clock or that it won't work at all. This patch determines the settings for all of the clocks at runtime considering the real conditions of the clocks in the system. The rules for the clocks are in TI's SLAA557 application guide on pages 37, 51 and 77. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Move aosr and dosr setting to separate functionsAnnaliese McDermond
Move these to separate helper functions. This looks cleaner and fits better with the new clock setting in CCF. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Control clock gating with CCFAnnaliese McDermond
Control the clock gating to the various clock components to use the CCF. This allows us to prepare_enalbe only 3 clocks and the relationships assigned to them will cause upstream clockss to enable automatically. Additionally we can do this in a single call to the CCF. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Model BDIV divider in CCFAnnaliese McDermond
Model and manage BDIV divider as components in the Core Clock Framework. This should allow us to do some more complex clock management and power control. Also, some of the on-board chip clocks can be exposed to the outside, and this change will make those clocks easier to consume by other parts of the kernel. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Model DAC/ADC dividers in CCFAnnaliese McDermond
Model and manage DAC/ADC dividers as components in the Core Clock Framework. This should allow us to do some more complex clock management and power control. Also, some of the on-board chip clocks can be exposed to the outside, and this change will make those clocks easier to consume by other parts of the kernel. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Model CODEC_CLKIN in CCFAnnaliese McDermond
Model and manage codec clock input as a component in the Core Clock Framework. This should allow us to do some more complex clock management and power control. Also, some of the on-board chip clocks can be exposed to the outside, and this change will make those clocks easier to consume by other parts of the kernel. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: tlv320aic32x4: Model PLL in CCFAnnaliese McDermond
Model and manage the on-board PLL as a component in the Core Clock Framework. This should allow us to do some more complex clock management and power control. Also, some of the on-board chip clocks can be exposed to the outside, and this change will make those clocks easier to consume by other parts of the kernel. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-21ASoC: tlv320aic32x4: Properly Set Processing BlocksAnnaliese McDermond
Different processing blocks are required for different sampling rates and power parameters. Set the processing blocks based on this information. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-20ASoC: tlv320aic32x4: Break out clock setting into separate functionAnnaliese McDermond
Break the clock setting logic out from the main hw_params. It's rather large and unweildy and makes for a large function. This also better enables some of the following changes to the clock tree access in the driver. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-12tlv320aic32x4: delay i2c access by 1 ms after hardware resetPeter Seiderer
As stated in 'TLV320AIC3254 Application Reference Guide' ([1]): 3.2 Device Startup Lockout Times After the TLV320AIC3254 initializes through hardware reset at power-up or software reset, the internal registers initialize to default values. This initialization takes place within 1ms after pulling the RESET signal high. During this initialization phase, no register-read or register-write operation should be performed on ADC or DAC coefficient buffers. Also, no block within the codec should be powered up during the initialization phase. [1] http://www.ti.com/lit/an/slaa408a/slaa408a.pdf Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-18Merge tag 'asoc-fix-v5.0-rc2' into asoc-5.1Mark Brown
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.
2019-01-09ASoC: tlv320aic32x4: SND_SOC_DAPM_MICBIAS is deprecatedb-ak
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>
2019-01-07ASoC: tlv320aic32x4: Kernel OOPS while entering DAPM standby modeb-ak
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
2018-02-12ASoC: tlv320aic32x4: replace codec to componentKuninori Morimoto
Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-12-13ASoC: tlv320aic32x4: Use snd_soc_update_bits() in aic32x4_set_dai_fmt()Andrew F. Davis
Make the code easier to read by using snd_soc_update_bits() over read/modify/write sequences. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-12-13ASoC: tlv320aic32x4: Use snd_soc_update_bits() in aic32x4_hw_params()Andrew F. Davis
Make the code easier to read by using snd_soc_update_bits() over read/modify/write sequences. Also use separate per-register variables instead of re-using "data". This can prevent accidental over-writing and makes it clear for which register each bit value is intended. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-12-13ASoC: tlv320aic32x4: Use snd_soc_update_bits() in aic32x4_mute()Andrew F. Davis
Simplify mute function by using snd_soc_update_bits() over read/modify/write style code. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-12-13ASoC: tlv320aic32x4: Use BIT and GENMASK for bit field definitionsAndrew F. Davis
Inter-register definitions should use BIT and GENMASK definitions and also be grouped by what register they belong to. This makes it easy to cross-check with the datasheet and is consistent with other drivers. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>