summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: max98396: add amplifier driverRyan Lee2022-04-264-0/+1953
| | | | | | | | | | | | | This series of patches adds support for Analog Devices MAX98396 mono amplifier with IV sense. The device provides a PCM interface for audio data and a standard I2C interface for control data communication. This driver also supports MAX98397 which is a variant of MAX98396 with wide input supply range. Signed-off-by: Ryan Lee <ryan.lee.analog@gmail.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20220423021558.1773598-1-ryan.lee.analog@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tas6424: Return zero in remove callbackUwe Kleine-König2022-04-261-3/+1
| | | | | | | | | | | | | | | The only effect of returning an error code in an i2c remove callback (compared to returning zero) is that the i2c core emits a generic warning. The device is still removed. So even if disabling the regulators fails it's sensible to return zero to suppress the additional generic and little helpful error message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220425193206.61710-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: SOF: Intel: improve HDaudio DAI supportMark Brown2022-04-2511-230/+312
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: The SOF CI and daily tests exposed a number of issues with corner cases on platforms using the HDaudio DAI, such as UpExtreme boards or usual HDaudio+DMIC laptops. This patchset provides improvements for pause_push/pause_release, suspend-resume, mixing use cases and combinations of all three. The initial patches provide a cleanup, the last patches improve the state machine and DMA handling.
| * ASoC: SOF: Intel: hda-dai: protect hw_params against successive callsPierre-Louis Bossart2022-04-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once we've set-up the HDA stream and its format, we currently don't support additional format changes. We already have a protection in the .prepare case, but this needs to be added in the hw_params too. In mixing use cases where two DPCM FEs are connected to the same BE, if can happen that there are multiple calls to the BE hw_params when the two FEs are configured simultaneously. This could alternatively be fixed at the DPCM level but that's a more intrusive change requiring infrastructure changes: this would need to be paired with the definition of fixed hw_params at the mixer level. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: add helper for link DMA cleanupsPierre-Louis Bossart2022-04-251-67/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | We do the same operations from different places, add a helper to enforce consistency and make the programming sequences clearer. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: hda-dai: reset dma_data and release streamPierre-Louis Bossart2022-04-251-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sequences are missing a call to snd_soc_dai_set_dma_data() when the stream is cleared, as well as a release of the stream, and tests to avoid pointer dereferences. This fixes an underflow issue in a corner case with two streams paused before a suspend-resume cycle. After resume, the pause_release of the last stream causes an underflow due to an invalid sequence. This problem probably existed since the beginning and is only see with prototypes of a 'deep-buffer' capability, which depends on additional ASoC fixes, so there's is no Fixes: tag and no real requirement to backport this patch. BugLink: https://github.com/thesofproject/linux/issues/3151 Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: hda-dai: improve suspend casePierre-Louis Bossart2022-04-251-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Add comments and re-align with the TRIGGER_SUSPEND case with an additional call to hda_dai_hw_free_ipc() to free-up resources. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: hda-dai: move code to deal with hda dai/dailink suspendPierre-Louis Bossart2022-04-253-36/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The location of the code was not optimal and prevents us from using helpers, let's move it to hda-dai.c. No functionality change in this patch. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASOC: SOF: Intel: hda-dai: add hda_dai_hw_free_ipc() helperPierre-Louis Bossart2022-04-251-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | We do the same thing from different places, let's use a helper. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: sof-audio: flag errors on pipeline teardownPierre-Louis Bossart2022-04-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before suspending, walk through all the widgets to make sure all refcounts are zero. If not, the resume will not work and random errors will be reported. Adding this paranoia check will help identify leaks and broken sequences. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: hda-dai: regroup dai and link DMA operationsPierre-Louis Bossart2022-04-251-101/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | Just code move with no functionality change, to clearly separate out the 'dai' operation from the link DMA ones. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: hda-dai: split link DMA and dai operationsPierre-Louis Bossart2022-04-251-82/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The link DMA state management is handled completely on the host side, while the DAI operations require an IPC. Split the first part in dedicated helpers. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: hda-dai: use snd_soc_dai_get_widget() helperPierre-Louis Bossart2022-04-251-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | Use helper instead of open-coding the same thing multiple times. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: hda-dai: simplify hda_dai_widget_update() prototypePierre-Louis Bossart2022-04-251-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | the argument "struct sof_intel_hda_stream *hda_stream" is not used, remove. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASOC: SOF: Intel: hda-dai: consistent naming for HDA DAI and HDA link DMAPierre-Louis Bossart2022-04-251-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Intel documentation refers to the concepts of 'HDAudio host DMA' (system memory <--> DSP) and 'HDaudio link DMA' (DSP <--> peripherals). We currently use the prefix 'hda_link' to describe DAI operations, which can be confused for dailink operations. Since the topology tokens refer unambiguously to the 'HDA' dai, let's drop the link prefix for dai-related ops/callbacks. Conversely let's use 'hda_link_dma' for routines related to the DMA management. In a follow-up patch we will introduce the 'hda_dai_link' prefix for dailink ops/callbacks. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: Add IPC-specific dai ops for IPC3Ranjani Sridharan2022-04-256-21/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BE DAI driver ops involve operations that are IPC-specific. For ex: for the HDA DAI, the trigger op involves sending the DAI_CONFIG IPC to the DSP to stop the DMA for the stop/pause commands. This sequence is different for IPC3 and IPC4. So, make the dai driver ops IPC-specific and set the IPC3-specific ops during the ops_init() callback. Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: remove incorrect clearing of prepared flagRanjani Sridharan2022-04-253-38/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the system is suspended while a PCM is paused, it doesn't receive the SUSPEND trigger. So, the SOF driver has to ensure that the PCM and the widgets associated with the paused PCM are freed in the firmware during suspend. This is handled in the sof_tear_down_left_over_pipelines() call. But since the state of this PCM is SUSPENDED, we end up clearing the prepared flag for the PCM before freeing it. This results in IPC errors while freeing the widgets. But because the widget use_counts are reset to 0 even though the IPC fails, releasing the paused stream after resuming from suspend proceeds normally. Fix the IPC errors by removing the clearing of the prepared flag in sof_set_hw_params_upon_resume(). In fact, we can remove the sof_set_hw_params_upon_resume() and call snd_sof_dsp_hw_params_upon_resume() directly. This will ensure that the PCM is freed in the firmware before the IPC's for freeing the widgets are sent. BugLink: https://github.com/thesofproject/linux/issues/3543 Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: SOF: Rework the firmware ready message handlingMark Brown2022-04-2512-261/+307
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: The firmware ready (fw_ready) message is sent by the firmware to notify the host that it has been booted up and caries additional information about it's configuration. All of this is IPC specific, the message itself is IPC version specific and the information itself also. Move the code to handle the fw_ready message under ipc3.c since the parsing and interpretation is IPC specific. A followup series is going to take care of the rest of the loader.c to make it IPC agnostic.
| * | ASoC: SOF: loader: Remove the old fw_ready related codePeter Ujfalusi2022-04-253-250/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fw_ready is handled internally to ipc3, we can remove the old code from the loader.c along with the functions only used by the fw_ready() Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Ajit Pandey <ajitkumar.pandey@amd.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20220421080735.31698-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: Intel: Do not set fw_ready callbackPeter Ujfalusi2022-04-254-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fw_ready is handled internally to ipc3 and the callback no longer in use. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Ajit Pandey <ajitkumar.pandey@amd.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20220421080735.31698-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: imx: Do not set fw_ready callbackPeter Ujfalusi2022-04-252-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fw_ready is handled internally to ipc3 and the callback no longer in use. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Ajit Pandey <ajitkumar.pandey@amd.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20220421080735.31698-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: amd: Do not set fw_ready callbackPeter Ujfalusi2022-04-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fw_ready is handled internally to ipc3 and the callback no longer in use. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Ajit Pandey <ajitkumar.pandey@amd.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20220421080735.31698-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: Do not check for the fw_ready callbackPeter Ujfalusi2022-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fw_ready is handled internally to ipc3, the callback no longer in use and it is going to be removed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Ajit Pandey <ajitkumar.pandey@amd.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20220421080735.31698-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc3: Add local implementation for handling fw_ready messagePeter Ujfalusi2022-04-251-1/+305
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The handling of fw_ready is IPC3 specific, move the needed code from the loader.c to ipc3.c and stop using the sof_ops(sdev)->fw_ready() callback. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Ajit Pandey <ajitkumar.pandey@amd.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20220421080735.31698-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Add macros for signed TLV controls with callbacksMark Brown2022-04-251-0/+17
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: This adds SOC_DOUBLE_R_S_EXT_TLV and SOC_SINGLE_S_EXT_TLV macros for signed TLV controls that need custom get/put callbacks. These will be needed by future Cirrus codec drivers, but are not particularly exotic so could be useful for others.
| * | ASoC: soc.h: Add SOC_SINGLE_S_EXT_TLV macroRichard Fitzgerald2022-04-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a SOC_SINGLE_S_EXT_TLV macro as a convenience wrapper around SOC_DOUBLE_R_S_EXT_TLV for mono volume controls. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220425125012.3044919-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: soc.h: Introduce SOC_DOUBLE_R_S_EXT_TLV() macroSimon Trimmer2022-04-251-0/+11
| |/ | | | | | | | | | | | | | | | | | | A straightforward extension of the SOC_DOUBLE_R_S_TLV() macro that allows the get and put functions to be customised. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220425125012.3044919-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: remaining i2c_match_id i2c probe changesMark Brown2022-04-2515-137/+158
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Stephen Kitt <steve@sk2.org>: This series covers all the remaining changes to migrate sound/soc/codecs i2c probes to probe_new, where the const struct i2c_client * argument is still used. Instead of relying on the parameter passed in, i2c_match_id is used instead. With this set of patches, all the sound/soc/codecs i2c probes use the new probe definition. Changes since v1: two missing files were added. Stephen Kitt (7): ASoC: ak*: use i2c_match_id and simple i2c probe ASoC: alc56*: use i2c_match_id and simple i2c probe ASoC: max980*: use i2c_match_id and simple i2c probe ASoC: pcm186x: use i2c_match_id and simple i2c probe ASoC: tas*: use i2c_match_id and simple i2c probe ASoC: tlv320*: use i2c_match_id and simple i2c probe ASoC: tpa6130: use i2c_match_id and simple i2c probe sound/soc/codecs/ak4613.c | 10 +++++---- sound/soc/codecs/ak4642.c | 8 ++++--- sound/soc/codecs/alc5623.c | 24 +++++++++++---------- sound/soc/codecs/alc5632.c | 20 +++++++++-------- sound/soc/codecs/max98088.c | 21 +++++++++--------- sound/soc/codecs/max98090.c | 23 ++++++++++---------- sound/soc/codecs/max98095.c | 19 +++++++++-------- sound/soc/codecs/pcm186x-i2c.c | 24 ++++++++++----------- sound/soc/codecs/tas2562.c | 25 +++++++++++----------- sound/soc/codecs/tas571x.c | 11 ++++++---- sound/soc/codecs/tas5720.c | 21 +++++++++--------- sound/soc/codecs/tlv320adc3xxx.c | 21 +++++++++--------- sound/soc/codecs/tlv320aic31xx.c | 32 ++++++++++++++-------------- sound/soc/codecs/tlv320aic32x4-i2c.c | 11 ++++++---- sound/soc/codecs/tlv320aic3x-i2c.c | 25 +++++++++++----------- sound/soc/codecs/tpa6130a2.c | 19 +++++++++-------- 16 files changed, 168 insertions(+), 146 deletions(-) base-commit: 5d763a740e5b24e4a2ca04317255e7e941876338 -- 2.27.0
| * | ASoC: tlv320*: use i2c_match_id and simple i2c probeStephen Kitt2022-04-254-42/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. In the context of an i2c probe, i2c_match_id with the module id table and the probed client never returns null, so removing the null check on the i2c_device_id pointer is safe. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang, except where the existing code already had a declaration for the of_device_id table. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220415160613.148882-7-steve@sk2.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: tas*: use i2c_match_id and simple i2c probeStephen Kitt2022-04-253-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang, except where the existing code already had a declaration for the of_device_id table. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220415160613.148882-6-steve@sk2.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: pcm186x: use i2c_match_id and simple i2c probeStephen Kitt2022-04-251-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. The i2c id table is moved up before the probe function, as suggested by Wolfram Sang. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220415160613.148882-5-steve@sk2.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: max980*: use i2c_match_id and simple i2c probeStephen Kitt2022-04-253-30/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. In the context of an i2c probe, i2c_match_id with the module id table and the probed client never returns null, so removing the null check on the i2c_device_id pointer is safe. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220415160613.148882-4-steve@sk2.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: alc56*: use i2c_match_id and simple i2c probeStephen Kitt2022-04-252-20/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220415160613.148882-3-steve@sk2.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: ak*: use i2c_match_id and simple i2c probeStephen Kitt2022-04-252-7/+11
| |/ | | | | | | | | | | | | | | | | | | | | As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220415160613.148882-2-steve@sk2.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | Add support of MediaTek mt8186 to SOFMark Brown2022-04-259-0/+693
|\ \ | | | | | | | | | | | | | | | Merge series from Tinghan Shen <tinghan.shen@mediatek.com>: Add support of MediaTek mt8186 SoC DSP to SOF.
| * | ASoC: SOF: mediatek: Add DSP system PM callback for mt8186Tinghan Shen2022-04-251-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add DSP system PM callback for suspend and resume Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Yaochun Hung <yc.hung@mediatek.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220422055659.8738-5-tinghan.shen@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: mediatek: Add mt8186 dsp clock supportTinghan Shen2022-04-254-1/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add adsp clock on/off support on mt8186 SoC. Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Yaochun Hung <yc.hung@mediatek.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220422055659.8738-4-tinghan.shen@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: mediatek: Add mt8186 sof fw loader and dsp opsTinghan Shen2022-04-254-1/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mt8186-loader module with ops callback to load and run firmware on mt8186 SoC. Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Yaochun Hung <yc.hung@mediatek.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220422055659.8738-3-tinghan.shen@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: mediatek: Add mt8186 hardware supportTinghan Shen2022-04-256-0/+451
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support of SOF on Mediatek mt8186 SoC. MT8186 has 2 Cortex A76 cores paired with 6 Cortex A55 cores. It also has Cadence HiFi-5 DSP single core. The IPC communication between AP and DSP is based on shared DRAM and mailbox interrupt. Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Yaochun Hung <yc.hung@mediatek.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220422055659.8738-2-tinghan.shen@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: img-i2s-in: using pm_runtime_resume_and_get instead of pm_runtime_get_syncMinghao Chi2022-04-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220414085310.2541546-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: img-parallel-out: using pm_runtime_resume_and_getMinghao Chi2022-04-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220420030246.2575629-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: qcom: Use MCLK as RT5682I-VS sysclk sourceJudy Hsiao2022-04-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Both MCLK and BCLK can be the clock source of sysclk via PLL according to its datasheet. This patch sets MCLK as the clock source as we use MCLK in the previous projects. Fixes: c5198db82d4c ("ASoC: qcom: Add driver support for ALC5682I-VS") Signed-off-by: Judy Hsiao <judyhsiao@chromium.org> Link: https://lore.kernel.org/r/20220419062952.356017-1-judyhsiao@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: imx-hdmi: remove useless null check before call of_node_put()Haowen Bai2022-04-251-2/+1
| | | | | | | | | | | | | | | | | | No need to add null check before call of_node_put(), since the implementation of of_node_put() has done it. Signed-off-by: Haowen Bai <baihaowen@meizu.com> Link: https://lore.kernel.org/r/1650509120-25377-1-git-send-email-baihaowen@meizu.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: avs: Depend on SND_INTEL_DSP_CONFIGAmadeusz Sławiński2022-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to enable NHLT support one must select SND_INTEL_DSP_CONFIG, which will select SND_INTEL_NHLT. Otherwise the file containing NHLT code doesn't get build leading to errors when linking. Fixes: 274d79e51875 ("ASoC: Intel: avs: Configure modules according to their type") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20220425091646.545216-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: avs: Enable AVS driver only on x86 platformsAmadeusz Sławiński2022-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Only supported platform for AVS are x86 machines, so there is no reason for it to be enabled on other architectures. Allow exception for compile tests. Fixes: 274d79e51875 ("ASoC: Intel: avs: Configure modules according to their type") Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20220425091646.545216-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: img-spdif-out: using pm_runtime_resume_and_get to simplify the codeMinghao Chi2022-04-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220420030439.2575817-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: img-spdif-in: using pm_runtime_resume_and_get instead of ↵Minghao Chi2022-04-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220419110718.2574674-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* | firmware: cirrus: cs_dsp: Avoid padding bytes in cs_dsp_coeff_ctlRichard Fitzgerald2022-04-251-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the order of members in struct cs_dsp_coeff_ctl to avoid the compiler having to insert alignment padding bytes. On a x86_64 build this saves 16 bytes per control. - Pointers are collected to the top of the struct (with the exception of priv, as noted below), so that they are inherently aligned. - The set and enable bitflags are placed together so they can be merged. - priv is placed at the end of the struct - it is for use by the client so it is helpful to make it stand out, and since the compiler will always pad the struct size to an alignment multiple putting a pointer last won't introduce any more padding. - struct cs_dsp_alg_region is placed at the end, right before priv, for the same reasoning as priv. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220425095159.3044527-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sh: Make SND_SOC_RZ depend on ARCH_RZG2LBiju Das2022-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The SSI block is identical on Renesas RZ/G2L, RZ/G2UL and RZ/V2L SoC's, so instead of adding dependency for each SoC's add dependency on ARCH_RZG2L. The ARCH_RZG2L config option is already selected by ARCH_R9A07G043, ARCH_R9A07G044 and ARCH_R9A07G054. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20220423164443.146299-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: fsl_asrc: using pm_runtime_resume_and_get to simplify the codeMinghao Chi2022-04-251-4/+2
|/ | | | | | | | | | | Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220420030402.2575755-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>