summaryrefslogtreecommitdiff
path: root/sound/soc/codecs
AgeCommit message (Collapse)Author
2019-04-08ASoC: ab8500: add range to usleep_rangeNicholas Mc Guire
Providing a range for usleep_range() allows the hrtimer subsystem to coalesce timers - as this delay has no upper limit anyway (interrupts or context switch is possible) it should not hurt to extend this from 2 to 2-4 milliseconds. Signed-off-by: Nicholas Mc Guire <hofrat@opentech.at> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-05ASoC: cs42l51: change mic bias DAPMOlivier Moysan
Use SND_SOC_DAPM_SUPPLY for mic bias DAPM instead of deprecated SND_SOC_DAPM_MICBIAS. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-05ASoC: cs35l35: Disable regulators on driver removalCharles Keepax
The chips main power supplies VA and VP are enabled during probe but then never disabled, this will cause warnings from the regulator framework on driver removal. Fix this by adding a remove callback and disabling the supplies, whilst doing so follow best practice and put the chip back into reset as well. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: cs42l51: add adc volume controlOlivier Moysan
Add ADC boost volume control for CS42L51 codec. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: cs42l51: add power managementOlivier Moysan
Add sleep PM callbacks to support system low power modes. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: cs42l51: add support of master modeOlivier Moysan
Add support of master mode for cs42l51 cirrus audio codec. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: cs42l51: add reset managementOlivier Moysan
Manage cs42l51 audio codec reset pin. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: cs42l51: add regulator managementOlivier Moysan
Add cs42l51 audio codec power supply management through regulator framework. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: wm_adsp: Avoid calling snd_compr_stop_error from WDT expiryCharles Keepax
It is unsafe to call snd_compr_stop_error from outside of the compressed ops. Firstly the compressed device lock needs to be held and secondly it queues error work to issue a trigger stop which should not happen after the stream has been freed. To avoid these issues use the same trick used for the IRQ handling, simply send a snd_compr_fragment_elapsed to cause user-space to wake on the poll, then report the error when user-space issues the pointer request after it wakes. Fixes: a2bcbc1b9ac2f ("ASoC: wm_adsp: Shutdown any compressed streams on DSP watchdog timeout") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@kernel.org
2019-04-04ASoC: max98357a: add missing supported ratesJerome Brunet
According the publicly available datasheet (and some test) the max98357a also supports 32, 44.1 and 88.2 kHz sample rate. Signed-off-by: Jerome Brunet <jbrunet@baylibre.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-04ASoC: tlv320aic32x4: Update copyright and use SPDX identifierAnnaliese McDermond
Update the copyright dates and use the SPDX identifier instead of reciting the license. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-04ASoC: tlv320aic32x4: Change author's nameAnnaliese McDermond
The author of these files has changed her name. Update instances in the code of her dead name to current legal name. Signed-off-by: Annaliese McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-03ASoC: wm_adsp: Make use of local variablesCharles Keepax
Tidy up some instances of dereferencing to obtain things that are already stored in local variables. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-03ASoC: wm_adsp: Remove redundant NULL check in wm_adsp_buffer_freeCharles Keepax
wm_adsp_compr_detach is NULL aware so there is no need to check for NULL before calling it, remove the redundant check. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-03ASoC: tlv320aic31xx: aic31xx_set_jack() can be statickbuild test robot
Fixes: ebf3326cd969 ("ASoC: tlv320aic31xx: Add headphone/headset detection") Signed-off-by: kbuild test robot <lkp@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-03ASoC: wm_adsp: Check for buffer in trigger stopCharles Keepax
Trigger stop can be called in situations where trigger start failed and as such it can't be assumed the buffer is already attached to the compressed stream or a NULL pointer may be dereferenced. Fixes: 639e5eb3c7d6 ("ASoC: wm_adsp: Correct handling of compressed streams that restart") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-02ASoC: wcd9335: fix a leaked reference by adding missing of_node_putWen Yang
The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./sound/soc/codecs/wcd9335.c:5193:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 5183, but without a correspon ding object release within this function. Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> 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: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Vinod Koul <vkoul@kernel.org> Cc: Dan Carpenter <dan.carpenter@oracle.com> (commit_signer:1/11=9%,authored:1/11=9%) Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-02ASoC: fix SND_SOC_LOCHNAGAR_SC kconfig warningRandy Dunlap
Fix kconfig warning for SND_SOC_LOCHNAGAR_SC: WARNING: unmet direct dependencies detected for SND_SOC_LOCHNAGAR_SC Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && MFD_LOCHNAGAR [=n] Selected by [m]: - SND_SOC_ALL_CODECS [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && COMPILE_TEST [=y] Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Piotr Stankiewicz <piotrs@opensource.cirrus.com> Cc: Charles Keepax <ckeepax@opensource.cirrus.com> Cc: Richard Fitzgerald <rf@opensource.cirrus.com> Cc: patches@opensource.cirrus.com Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: alsa-devel@alsa-project.org Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-02ASoC: tlv320aic31xx: Add button press detectionAndrew F. Davis
This device can optionally detect headset or microphone button presses. Add support for this by passing this event to the jack layer. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-02ASoC: tlv320aic31xx: Add headphone/headset detectionAndrew F. Davis
This device can detect the insertion/removal of headphones and headsets. Enable reporting this status by enabling this interrupt and forwarding this to upper-layers if a jack has been defined. This jack definition and the resulting operation from a jack detection event must currently be defined by sound card platform code until CODEC outputs to jack mappings can be defined generically. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-01ASoC: es8316: Add support for inverted jack detectPaul Cercueil
On some devices (Teclast X98+ II tablet, maybe others), the jack detection has been wired backwards, so when the ES8316 reports headphones being present it means they are actually not plugged. Use a quirk around this incorrect behaviour, which can be enabled through the 'everest,jack-detect-inverted' boolean device property. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-01ASoC: wm_adsp: Fix typo in commentCharles Keepax
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-01ASoC: rt5677-spi: Add ACPI IDOder Chiou
Add the ACPI ID for the product "chromebook pixel 2015" to match the coreboot settings. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-01ASoC: cs42l51: add multi endpoint supportOlivier Moysan
Support multiple endpoints on cs42L51 codec port when used in of_graph context. This patch allows to share the codec port between two CPU DAIs. Example: STM32MP157C-DK2 board uses CS42L51 audio codec. This codec is connected to two serial audio interfaces, which are configured either as rx or tx. From AsoC point of view the topolgy is the following: // 2 CPU DAIs (SAI2A/B), 1 Codec (CS42L51) Playback: CPU-A-DAI(slave) -> (master)CODEC-DAI/port0 Record: CPU-B-DAI(slave) <- (master)CODEC-DAI/port0 In the DT two endpoints have to be associated to the codec port: cs42l51_port: port { cs42l51_tx_endpoint: endpoint@0 { remote-endpoint = <&sai2a_endpoint>; }; cs42l51_rx_endpoint: endpoint@1 { remote-endpoint = <&sai2b_endpoint>; }; }; However, when the audio graph card parses the codec nodes, it expects to find DAI interface indexes matching the endpoints indexes. The current patch forces the use of DAI id 0 for both endpoints, which allows to share the codec DAI between the two CPU DAIs for playback and capture streams respectively. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
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-26ASoC: tlv320aic32x4: Only enable with common clockMark Brown
Some architectures do not yet support the common clock API at all but the tlv320aic32x4 driver now requires it. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> 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-25ASoC: sirf-audio: Remove redundant of_match_node callAditya Pakki
Unlike other drivers probe method, of_match_node return value is not used or checked. This patch removes the redundant code. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-25ASoC: nau8810: fix the issue of 64 bits divisionJohn Hsu
Do division with div_u64 for the PLL calculation. These errors are fixed and list as follows: 1."__udivdi3" [sound/soc/codecs/snd-soc-nau8810.ko] undefined! 2."__aeabi_uldivmod" [sound/soc/codecs/snd-soc-nau8810.ko] undefined! 3. nau8810.c:(.text.nau8810_calc_pll+0xd8): undefined reference to `__udivdi3' Signed-off-by: John Hsu <KCHSU0@nuvoton.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-21ASoC: lochnagar: Add driver to support Lochnagar 2 sound cardPiotr Stankiewicz
Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform. Lochnagar 2 provides a set of line inputs/outputs, and a USB audio device. This driver adds support for these analog line connections and the Lochnagar side of the USB audio link. Signed-off-by: Piotr Stankiewicz <piotrs@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> 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-21ASoC: da7219: Expose BCLK and WCLK control through CCFAdam Thomson
For the purposes of platforms which use the codec as DAI clock master for the CPU and other codec devices, there is the need to not only expose the clock gating of BCLK and WCLK but also the ability to set those rates without going through the ASoC APIs. To make this possible, the previous CCF implementation in the driver has been extended to separate BCLK and WCLK out. WCLK is the parent clock to BCLK, and is also the clock gate for both. BCLK in HW is a factor/multiplier of WCLK so derives from whatever SR is chosen for WCLK, hence the need to make it a child of WCLK for the purposes of CCF. Enabling/disabling either BCLK or WCLK will result in clocks being ungated/gated accordingly. To simplify matters, these clocks can only be configured if the codec is set as master, otherwise CCF control is disallowed. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-21ASoC: cs4270: Set auto-increment bit for register writesDaniel Mack
The CS4270 does not by default increment the register address on consecutive writes. During normal operation it doesn't matter as all register accesses are done individually. At resume time after suspend, however, the regcache code gathers the biggest possible block of registers to sync and sends them one on one go. To fix this, set the INCR bit in all cases. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-20ASoC: wm_adsp: Correct some minor issuesCharles Keepax
The wm_adsp_ops structures should be static and correct two printf specifiers. Fixes: 170b1e123f38 ("ASoC: wm_adsp: Add support for new Halo core DSPs") Fixes: 4e08d50d1fb6 ("ASoC: wm_adsp: Factor out DSP specific operations") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> 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-03-19ASoC: wm_adsp: Add WDT expiry IRQ handling support for Halo coreStuart Henderson
Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-19ASoC: wm_adsp: Add HALO MPU fault loggingRichard Fitzgerald
A Halo Core DSP has a memory protection unit that can trap and signal memory access faults. This patch adds a function that dumps the fault information. The interrupt reaches the host via the parent codec interrupt controller so this fault function is exported to be called by the codec driver. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-19ASoC: wm_adsp: Add support for new Halo core DSPsWen Shi
The Halo core is a new generation of audio DSP architecture from Cirrus Logic. A new iteration of the WMFW file format (v3) is also added, for this new architecture. Currently this format is not supported on the old ADSP2 architecture however support may be added for it in the future. Signed-off-by: Wen Shi <wenshi@opensource.cirrus.com> Signed-off-by: Piotr Stankiewicz <piotrs@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>