aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/atom/sst-atom-controls.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-06-09Specify clock provider directly to CPU DAIsMark Brown1-2/+2
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>: Currently the set_fmt callback always passes clock provider/consumer with respect to the CODEC. This made sense when the framework was directly broken down into platforms and CODECs. However, as things are now broken down into components which can be connected as either the CPU or CODEC side of a DAI link it simplifies things if each side of the link is just told if it is provider or consumer of the clocks. Making this change allows us to remove one of the last parts of the ASoC core that needs to know if a driver is a CODEC driver, where it flips the clock format specifier if a CODEC driver is used on the CPU side of a DAI link, as well as just being conceptually more consistent with componentisation. The basic idea of this patch chain is to change the set_fmt callback from specifying if the CODEC is provider/consumer into directly specifying if the component is provider/consumer. To do this we add some new defines, and then to preserve bisectability, the migration is done by adding a new callback, converting over all existing CPU side drivers, converting the core, and then finally reverting back to the old callback. Converting the platform drivers makes sense as the existing defines are from the perspective of the CODEC and there are more CODEC drivers than platform drivers. Obviously a fair amount of this patch chain I was only able to build test, so any testing that can be done would be greatly appreciated.
2022-06-06ASoC: Intel: atom: controls: remove useless initializationsPierre-Louis Bossart1-2/+2
cppcheck complains about invalid NULL dereferences but there's indeed no need to initialize loop variables or before allocating memory. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220520211719.607543-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: Intel: Update to use set_fmt_new callbackCharles Keepax1-2/+2
As part of updating the core to directly tell drivers if they are clock provider or consumer update these CPU side drivers to use the new direct callback. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220519154318.2153729-12-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-13ASoC: Intel: atom: use inclusive language for SSP bclk/fsyncPierre-Louis Bossart1-6/+6
Use 'provider' and 'consumer' terms. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20201112163100.5081-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18ASoC: Intel: Atom: sst-atom-controls: remove redundant assignmentsPierre-Louis Bossart1-2/+2
cppcheck complains of a possible NULL pointer dereference but setting a pointer before using list_for_each_entry() is not useful. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200813200147.61990-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01ASoC: Intel: atom: fix 'defined but not used' warningPierre-Louis Bossart1-1/+1
Fix W=1 warning. The VOIP controls were not used in the mainline but in special versions of Android. Keep and use __maybe_used to make warning go away. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200701183716.83314-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01ASoC: Intel: atom: fix kernel-docPierre-Louis Bossart1-19/+44
Fix W=1 warnings. The kernel-doc format was probably never supported, fix information as needed. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200701183716.83314-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-03ASoC: Intel: atom: Check drv->lock is locked in sst_fill_and_send_cmd_unlockedHans de Goede1-0/+2
sst_fill_and_send_cmd_unlocked must be called with the drv->lock mutex locked already. In the past there have been cases where this was not the case, add a WARN_ON to check for drv->lock being locked. 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/20200402185359.3424-2-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-03ASoC: Intel: atom: Take the drv->lock mutex before calling sst_send_slot_map()Hans de Goede1-0/+2
sst_send_slot_map() uses sst_fill_and_send_cmd_unlocked() because in some places it is called with the drv->lock mutex already held. So it must always be called with the mutex locked. This commit adds missing locking in the sst_set_be_modules() code-path. Fixes: 24c8d14192cc ("ASoC: Intel: mrfld: add DSP core controls") 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/20200402185359.3424-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-25ASoC: Intel: mrfld: fix incorrect check on p->sinkColin Ian King1-1/+1
The check on p->sink looks bogus, I believe it should be p->source since the following code blocks are related to p->source. Fix this by replacing p->sink with p->source. Fixes: 24c8d14192cc ("ASoC: Intel: mrfld: add DSP core controls") Signed-off-by: Colin Ian King <colin.king@canonical.com> Addresses-Coverity: ("Copy-paste error") Link: https://lore.kernel.org/r/20191119113640.166940-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285Thomas Gleixner1-9/+1
Based on 1 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 version 2 of the license 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 100 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141900.918357685@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-03ASoC: Intel: Atom: simplify boolean testsPierre-Louis Bossart1-1/+1
Detected with Coccinelle Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: intel: atom: replace platform to componentKuninori Morimoto1-18/+18
Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: "Kp, Jeeja" <jeeja.kp@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31Merge branch 'fix/intel' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intelMark Brown1-4/+2
2017-01-31ASoC: Intel: atom: fix frame polarityPierre-Louis Bossart1-4/+2
The current frame sync polarity definitions are inconsistent in the Atom/DPCM driver, fix to align with regular ASoC definitions and update code in platform and machine drivers for RT5640 and RT5651. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31ASoC: Intel: Atom: Configure media_loop1 and sprot_loop in stereoSebastien Guiriec1-2/+2
Most of the devices are using stereo speakers so media_loop1 and sprot_loop default mode should be stereo. As per default all the routing UCM configuration doesn't enable Post processing loops it is not impacting curent configurations. Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-29ASoC: Intel: atom: Make some messages to debug levelTakashi Iwai1-1/+1
Intel sst driver spews lots of kernel messages in INFO level; typically, it gives a kernel message at each time it allocates or frees a stream, or at each time when a stream is started or stopped. This will piles up quickly, and it's almost useless for normal users, so let's hide them to KERN_DEBUG level. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15ASoC: Intel: atom: enable configuration of SSP0Pierre-Louis Bossart1-3/+12
Existing code used SSP2, make selection of SSP id dependent on port name. This is required when the machine driver uses non-default settings Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15ASoC: Intel: Atom: add definitions for modem/SSP0 interfacePierre-Louis Bossart1-1/+16
The Atom DPCM driver only allowed for the SSP2 interface, add definitions for modem/SSP0. These definitions might be used to route audio to a codec connected to SSP0 (instead of a modem in traditional usages), but there is a restriction to 2ch I2S. SSP2 is capable of handling up to 4 slot TDM. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-22ASoC: Intel: Atom: fix boot warningVinod Koul1-1/+1
Users have reported seeing this false warning on atom driver [ 5.647469] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 0 doesn't have DAPM widget!!! [ 5.661612] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 1 doesn't have DAPM widget!!! [ 5.661646] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 2 doesn't have DAPM widget!!! [ 5.661681] sst-mfld-platform sst-mfld-platform: Slot control: codec_out tx interleaver slot 3 doesn't have DAPM widget!!! [ 5.661708] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in0_0 doesn't have DAPM widget!!! [ 5.661738] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in0_1 doesn't have DAPM widget!!! [ 5.661771] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in1_0 doesn't have DAPM widget!!! [ 5.661807] sst-mfld-platform sst-mfld-platform: Slot control: codec_in rx deinterleaver codec_in1_1 doesn't have DAPM widget!!! This is caused when check for control is not being associated with a dapm widget, but the check is wrong as the else case maybe triggered when widget is not powered up, so we should check if widget is associated before printing this message. Tested-by: Sandeep Tayal <sandeepx.tayal@intel.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-19ASoC: Intel: Atom: flip logic for gain SwitchPierre-Louis Bossart1-2/+2
The upstreamed code modified the control names from Mute to Switch without changing the logic. To get audio working the Switch needs to be off which isn't aligned with normal ALSA conventions. Inverting the logic now so that Switch Off means mute and Switch On means active audio using the specific volume setting. Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-19ASoc: Intel: Atom: add deep buffer definitions for atom platformsPierre-Louis Bossart1-0/+1
Add definitions for MERR_DPCM_DEEP_BUFFER AND PIPE_MEDIA3_IN Add relevant cpu-dai and dai link names Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/intel', 'asoc/topic/kirkwood', 'asoc/topic/lm49453', 'asoc/topic/max9768' and 'asoc/topic/max98088' into asoc-nextMark Brown1-1/+1
2015-07-29ASoC: dapm: Add widget path iteratorsLars-Peter Clausen1-2/+2
Add helper iterator macros for iterating over the source and sink paths of widget. This will make it easier to change the implementation later on. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-08ASoC: intel - atom: statify sst_slot_enum_infoVinod Koul1-1/+1
Sparse complains that sst_slot_enum_info should be static, so make it static sound/soc/intel/atom/sst-atom-controls.c:135:5: warning: symbol 'sst_slot_enum_info' was not declared. Should it be static? Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-15ASoC: Intel: mrfld: simplify sst_fill_widget_module_infoRasmus Villemoes1-12/+8
Some tiny improvements, cutting 180 bytes off the generated code. - use strchr() for single-character needle - compute index using pointer subtraction instead of two strlen() calls - factor out the common check for whether the initial part of kctl->id.name (before the space) is identical to w->name. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Vinod Koul <vinod.koul@intel.com> Tested-by: Fang, Yang A <yang.a.fang@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06ASoC: Intel: add support for configuring TDM slots for SSPVinod Koul1-0/+13
With this machines can now configure TDM settings for SSP port using set_tdm_slot API Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06ASoC: intel: add support for specifying PCM formatVinod Koul1-0/+99
With this machines can configure the PCM format applied on SSP port using the set_fmt API Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06ASoC: Intel: use local values for ssp configurationVinod Koul1-23/+30
So right now SSP configuration is statically coded in the driver. While we would like to keep this configuration intact for the users who are using these defaults, we need to provide a way for users to program it. So create a local value in driver structure which is populate with default value for now Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06ASoC: Intel: add frame and data polarity to ssp configVinod Koul1-0/+2
The current ssp configuration was not configuring the frame sync polarity and data polarity. Some codecs do need these different so add them in ssp configuration now Signed-off-by: Praveen Diwakar <praveen.diwakar@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-06ASoC: Intel: create atom folder and move atom platform files inJie Yang1-0/+1422
Restructure the sound/soc/intel/ directory: create atom folder, and move sst atom platform files here. Signed-off-by: Jie Yang <yang.jie@intel.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>