Pierre-Louis Bossart
8b20aab8cf
ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire
...
commit e8444560b4d9302a511f0996f4cfdf85b628f4ca upstream.
The HDAudio ASoC support relies on the set_tdm_slots() helper to store
the HDaudio stream tag in the tx_mask. This only works because of the
pre-existing order in soc-pcm.c, where the hw_params() is handled for
codec_dais *before* cpu_dais. When the order is reversed, the
stream_tag is used as a mask in the codec fixup functions:
/* fixup params based on TDM slot masks */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
codec_dai->tx_mask)
soc_pcm_codec_params_fixup(&codec_params,
codec_dai->tx_mask);
As a result of this confusion, the codec_params_fixup() ends-up
generating bad channel masks, depending on what stream_tag was
allocated.
We could add a flag to state that the tx_mask is really not a mask,
but it would be quite ugly to persist in overloading concepts.
Instead, this patch suggests a more generic get/set 'stream' API based
on the existing model for SoundWire. We can expand the concept to
store 'stream' opaque information that is specific to different DAI
types. In the case of HDAudio DAIs, we only need to store a stream tag
as an unsigned char pointer. The TDM rx_ and tx_masks should really
only be used to store masks.
Rename get_sdw_stream/set_sdw_stream callbacks and helpers as
get_stream/set_stream. No functionality change beyond the rename.
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@intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Acked-By: Vinod Koul <vkoul@kernel.org >
Link: https://lore.kernel.org/r/20211224021034.26635-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Cc: Takashi Iwai <tiwai@suse.de >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-01-14 10:16:28 +01:00
Pierre-Louis Bossart
0bcfa99e8f
ASoC: Intel: sof_sdw: tag SoundWire BEs as non-atomic
...
[ Upstream commit 58eafe1ff52ee1ce255759fc15729519af180cbb ]
The SoundWire BEs make use of 'stream' functions for .prepare and
.trigger. These functions will in turn force a Bank Switch, which
implies a wait operation.
Mark SoundWire BEs as nonatomic for consistency, but keep all other
types of BEs as is. The initialization of .nonatomic is done outside
of the create_sdw_dailink helper to avoid adding more parameters to
deal with a single exception to the rule that BEs are atomic.
Suggested-by: Takashi Iwai <tiwai@suse.de >
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: Bard Liao <bard.liao@intel.com >
Link: https://lore.kernel.org/r/20210907184436.33152-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-10-17 10:43:32 +02:00
Pierre-Louis Bossart
3206433070
ASoC: Intel: sof_sdw: add mutual exclusion between PCH DMIC and RT715
...
[ Upstream commit 35564e2bf94611c3eb51d35362addb3cb394ad54 ]
When external RT714/715 devices are used for capture, we don't want
the PCH DMICs to be used.
Any information provided by the SOF platform driver or DMI quirks will
be overridden.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Libin Yang <libin.yang@intel.com >
Link: https://lore.kernel.org/r/20210505163705.305616-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-07-20 16:05:38 +02:00
Libin Yang
2938ffd568
ASoC: Intel: sof_sdw: add SOF_RT715_DAI_ID_FIX for AlderLake
...
[ Upstream commit 81cd42e5174ba7918edd3d006406ce21ebaa8507 ]
AlderLake needs the flag SOF_RT715_DAI_ID_FIX if it is using the
rt715 DMIC.
Reviewed-by: Bard Liao <bard.liao@intel.com >
Signed-off-by: Libin Yang <libin.yang@intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20210505163705.305616-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-07-14 16:56:48 +02:00
Vamshi Krishna Gopal
4ac5823083
ASoC: Intel: sof_sdw: add quirk for new ADL-P Rvp
...
[ Upstream commit d25bbe80485f8bcbbeb91a2a6cd8798c124b27b7 ]
Add quirks for jack detection, rt711 DAI and DMIC
Reviewed-by: Bard Liao <bard.liao@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20210415175013.192862-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-05-19 10:12:57 +02:00
Pierre-Louis Bossart
2dba0f8054
ASoC: Intel: sof_sdw: add quirk for HP Spectre x360 convertible
...
[ Upstream commit d92e279dee56b4b65c1af21f972413f172a9734a ]
This set of devices has SoundWire support along with DMICs.
The DMI information was provided by users for 3 separate skus.
BugLink: https://github.com/thesofproject/linux/issues/2700
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210208233336.59449-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-03-11 14:17:29 +01:00
Pierre-Louis Bossart
c08344abc9
ASoC: Intel: sof_sdw: reorganize quirks by generation
...
[ Upstream commit 3d09cf8d0d791a41a75123e135f604d59f4aa870 ]
The quirk table is a mess, let's reorganize it by generation before
making sure that the quirks are consistent for each generation.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210208233336.59449-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-03-11 14:17:29 +01:00
Pierre-Louis Bossart
ff72a41132
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A32
...
[ Upstream commit 45c92ec32b43c6cb42341ebf07577eefed9d87ec ]
We missed adding the TGL_HDMI quirk which is very much needed to
expose the 4 display pipelines and will be required on TGL topologies.
Fixes: 488cdbd8931fe ('ASoC: Intel: sof_sdw: add quirk for new TigerLake-SDCA device')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210204203312.27112-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-03-11 14:17:26 +01:00
Pierre-Louis Bossart
f7f227eb32
ASoC: Intel: sof_sdw: add quirk for new TigerLake-SDCA device
...
[ Upstream commit 488cdbd8931fe4bc7f374a8b429e81d0e4b7ac76 ]
Add quirks for jack detection, rt715 DAI and number of speakers.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@linux.intel.com >
Link: https://lore.kernel.org/r/20201111214318.150529-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-03-11 14:17:23 +01:00
Rander Wang
5883a3bb30
ASoC: Intel: sof_sdw: detect DMIC number based on mach params
...
[ Upstream commit f88dcb9b98d3f86ead04d2453475267910448bb8 ]
Current driver create DMIC dai based on quirk for each platforms,
so we need to add quirk for new platforms. Now driver reports DMIC
number to machine driver and machine driver can create DMIC dai based
on this information. The old check is reserved for some platforms
may be failed to set the DMIC number in BIOS.
Reviewed-by: Bard Liao <bard.liao@intel.com >
Signed-off-by: Rander Wang <rander.wang@intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20210208233336.59449-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-03-07 12:34:13 +01:00
Pierre-Louis Bossart
18de10ef48
ASoC: Intel: sof-sdw: indent and add quirks consistently
...
[ Upstream commit 8caf37e2be761688c396c609880936a807af490f ]
Use the same style for all quirks to avoid misses and errors
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210208233336.59449-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-03-07 12:34:13 +01:00
Pierre-Louis Bossart
2e0e7c91dd
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A3E
...
[ Upstream commit 5ab3ff4d66960be766a544886667e7c002f17fd6 ]
We missed adding the TGL_HDMI quirk which is very much needed to
expose the 4 display pipelines and will be required on TGL topologies.
Fixes: e787f5b5b1
('ASoC: Intel: add support for new SoundWire hardware layout on TGL')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210204203312.27112-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-03-04 11:37:47 +01:00
Pierre-Louis Bossart
6bbbb1dea7
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A5E
...
[ Upstream commit f12bbc50f3b14c9b8ed902c6d1da980dd5addcce ]
We missed adding the TGL_HDMI quirk which is very much needed to
expose the 4 display pipelines and will be required on TGL topologies.
Fixes: 9ad9bc59dde10 ('ASoC: Intel: sof_sdw: set proper flags for Dell TGL-H SKU 0A5E')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210204203312.27112-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-03-04 11:37:47 +01:00
Libin Yang
428831e8e9
ASoC: Intel: sof_sdw: set proper flags for Dell TGL-H SKU 0A5E
...
[ Upstream commit 9ad9bc59dde106e56dd59ce2bec7c1b08e1f0eb4 ]
Add flag "SOF_RT711_JD_SRC_JD2", flag "SOF_RT715_DAI_ID_FIX"
and "SOF_SDW_FOUR_SPK" to the Dell TGL-H based SKU "0A5E".
Signed-off-by: Libin Yang <libin.yang@intel.com >
Co-developed-by: Hui Wang <hui.wang@canonical.com >
Signed-off-by: Hui Wang <hui.wang@canonical.com >
Reviewed-by: Bard Liao <bard.liao@intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210125081117.814488-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-02-13 13:55:07 +01:00
Pierre-Louis Bossart
df64b9882b
ASoC: Intel: sof_sdw: add version_id to avoid rt714/rt715 confusion
...
RT715 and RT714 are essentially the same chip. In addition, there are
two versions, one supporting SoundWire 1.1 and one supporting
SoundWire 1.2 (SDCA).
The previous configurations assumed that RT714 was SDCA-only, which
isn't correct. Add support for the 4 possible combinations to avoid
confusions.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Jack Yu <jack.yu@realtek.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Link: https://lore.kernel.org/r/20201002211902.287692-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-10-05 14:40:22 +01:00
Rander Wang
7cc3b56f73
ASOC: Intel: sof_sdw: restore playback functionality with max98373 amps
...
The Max98373 amplifier provides I/V feedback information, which keeps
a DAPM path active even when there is no playback happening. This
prevents entry in low-power mode. Rather than adding new controls and
require UCM/user interaction, the method previously applied is to
enable/disable the Speaker pin during the dailink trigger operations.
Recent changes in the SoundWire stream management moved the stream
trigger to the dailink trigger. This change removed the Maxim-specific
pin handling and resulted in a regression. This patch restores
functionality by combining the SoundWire stream trigger with the pin
enable/disable.
Fixes: ae3a3918ed
('ASoC: Intel: sof_sdw: add dailink .trigger callback')
Fixes: 06998d49bc
('ASoC: Intel: sof_sdw: add dailink .prepare and .hw_free callback')
Signed-off-by: Rander Wang <rander.wang@intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Keyon Jie <yang.jie@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200923080514.3242858-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-23 18:13:17 +01:00
Bard Liao
e787f5b5b1
ASoC: Intel: add support for new SoundWire hardware layout on TGL
...
The creativity of hardware folks is endless, with a complete
permutation of rt711 (was link0 now link1), rt1308 (was link1 now
link2) and rt715 (was link3 now link0).
Someday we will get all this information from platform firmware, for
now let's add the mapping table.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200923080514.3242858-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-23 18:13:16 +01:00
Pierre-Louis Bossart
23c8aa3eba
ASoC: Intel: sof_sdw: remove hard-coded codec_conf table
...
Now that the ACPI machine params provide all the information needed,
allocate the card codec_conf dynamically and set .dlc and
.prefix_name.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200923080514.3242858-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-23 18:13:14 +01:00
Pierre-Louis Bossart
f1bf9a6b4e
ASoC: Intel: sof_sdw: remove ternary operator
...
cppcheck reports the following warning:
sound/soc/intel/boards/sof_sdw.c:866:46: style: Clarify calculation
precedence for '&' and '?'. [clarifyCalculation]
hdmi_num = sof_sdw_quirk & SOF_SDW_TGL_HDMI ?
^
There's no reason to use the ternary operator here, we might as well
use a regular if-else construct.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200923080514.3242858-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-23 18:13:12 +01:00
Pierre-Louis Bossart
06998d49bc
ASoC: Intel: sof_sdw: add dailink .prepare and .hw_free callback
...
Add .prepare and .hw_free callback to dailink.
The companion patch for this patch is the removal of stream operations
in the .prepare and .hw_free callbacks at the DAI level in
drivers/soundwire/intel.c
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Link: https://lore.kernel.org/r/20200904182854.3944-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-07 13:15:51 +01:00
Pierre-Louis Bossart
ae3a3918ed
ASoC: Intel: sof_sdw: add dailink .trigger callback
...
Add trigger functionality to dailink, so far only .startup() and
.shutdown() were implemented at the machine driver level.
The companion patch for this patch is the removal of the trigger
callback at the DAI level in drivers/soundwire/intel.c
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Link: https://lore.kernel.org/r/20200904182854.3944-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-07 13:15:50 +01:00
Bard Liao
b75bea4b88
ASoC: intel: sof_sdw: add rt711 rt1316 rt714 SDCA codec support.
...
Add rt711, rt1316, and rt714 SDCA codecs support in sof_sdw machine driver.
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20200821195603.215535-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-24 13:41:35 +01:00
Rander Wang
626200df24
SoC: Intel: sof_sdw: Add support for product Ripto
...
Ripto is another product based on TGL with the same
audio hardware configuration as Volteer.
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Rander Wang <rander.wang@intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20200821195603.215535-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-24 13:41:33 +01:00
Bard Liao
535df653f7
ASoC: Intel: sof_sdw: rename id as part_id
...
The "id" field in sof_sdw_codec_info struct is actually the "part
id". Rename to prevent confusions.
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20200821195603.215535-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-24 13:41:32 +01:00
Bard Liao
2e2d287bbe
ASoC: Intel: sof_sdw: check SoundWire version when matching codec
...
Some codecs with the same part id but different SoundWire versions
have different configurations. So we have to separate them in
codec_info_list[].
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20200821195603.215535-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-24 13:41:31 +01:00
Pierre-Louis Bossart
b161a12192
ASoC: Intel: sof-soundwire: add support for rt5682 on link2
...
The UpExtreme board provides support for SoundWire link2 in 2 of the 3
advanced modes. Let's use it w/ rt5682.
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20200821195603.215535-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-24 13:41:26 +01:00
Bard Liao
751365035b
ASoC: intel: sof_sdw: add .exit callback function
...
We may allocate some resources in sof_sdw_codec_info .init function.
Adding a corresponding .exit function can help to release these resources.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200820134542.8682-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-21 15:24:41 +01:00
Kai Vehmanen
15ef2ea035
ASoC: Intel: sof_sdw: add support for systems without i915 audio
...
Extend the generic SOF Soundwire machine driver to support systems where
iDisp HDMI/DP audio codec is disabled for some reason (i915 driver
disabled, HDMI/DP implemented with a discrete GPU, etc). Switch codecs
to SoC dummy in the affected DAI links. This allows to reuse existing
topologies for this case.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@linux.intel.com >
Link: https://lore.kernel.org/r/20200717211337.31956-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-07-20 16:08:21 +01:00
Pierre-Louis Bossart
cf0418cd06
ASoC: Intel: sof_sdw_rt711: remove properties in card remove
...
The rt711 jack detection properties are set from the machine drivers
during the card probe, as done in other ASoC examples.
KASAN reports a use-after-free error when unbinding drivers due to a
confusing sequence between the ACPI core, the device core and the
SoundWire device cleanups.
Rather than fixing this sequence, follow the recommendation to have
the same caller add and remove properties, add an explicit
device_remove_properties() in the card .remove() callback.
In future patches the use of device_add/remove_properties will be
replaced by a direct handling of a swnode, but the sequence will
remain the same.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200717211337.31956-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-07-20 16:08:20 +01:00
randerwang
be3afa120c
ASoC: Intel: sdw_max98373: add card_late_probe support
...
Disable Left and Right Spk pin after boot so that sof can get
suspended.
This follows the same logic added to another machine driver with
commit 94d2d08974
("ASoC: Intel: Boards: tgl_max98373: add dai_trigger function")
Signed-off-by: randerwang <rander.wang@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Link: https://lore.kernel.org/r/20200708203215.231776-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-07-09 21:01:28 +01:00
Naveen Manohar
be82e88895
ASoC: Intel: sof_sdw: Add MAX98373 support
...
Add max98373-sdw helper function, which configures 2x MAX98373 codecs to
Link1. This patch shares code between the I2S and SoundWire modes of
MAX98373 and adds the trigger already added for I2S.
Signed-off-by: Rander Wang <rander.wang@linux.intel.com >
Signed-off-by: Naveen Manohar <naveen.m@intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Link: https://lore.kernel.org/r/20200625192620.4312-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-06-26 16:10:59 +01:00
Pierre-Louis Bossart
2555ebe94d
ASoC: Intel: sof_sdw: add quirk override with kernel parameter
...
During the bring-up of new platforms, or to take care of specific
hardware reworks, it's useful to add a kernel parameter to override
the default DMI-based quirks.
For example, adding the following line in a .conf file in
/etc/modprobe.d/ will change the default quirk and log the changes if
dynamic debug is enabled.
options snd_soc_sof_sdw quirk=0x802
[ 735.025785] sof_sdw sof_sdw: Overriding quirk 0x10 => 0x802
[ 735.025787] sof_sdw sof_sdw: quirk realtek,jack-detect-source 2
[ 735.025790] sof_sdw sof_sdw: quirk SOF_RT715_DAI_ID_FIX enabled
Tested on ICL RVP with add-on board instead of default codec.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200625191308.3322-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-06-26 13:35:15 +01:00
Pierre-Louis Bossart
fb4b42f689
ASoC: Intel: sof_sdw: add missing .owner field
...
This field is required for ASoC cards. Not setting it will result in a
module->name pointer being NULL and generate problems such as
cat /proc/asound/modules
0 (efault)
Fixes: 52db12d193
('ASoC: Intel: boards: add sof_sdw machine driver')
Reported-by: Jaroslav Kysela <perex@perex.cz >
Suggested-by: Takashi Iwai <tiwai@suse.de >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200625191308.3322-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-06-26 13:35:13 +01:00
Libin Yang
38acab2d61
ASoC: sof-sdw: remove CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC condition
...
As CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC is always enabled in sof-soundwire
driver, let's remove the test of CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC
in the code.
Signed-off-by: Libin Yang <libin.yang@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: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200529193547.6077-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 21:23:50 +01:00
Pierre-Louis Bossart
9d05a1e50c
ASoC: Intel: sof_sdw: fix typo in components string
...
The component string attributes are separated by spaces, not commas.
Fixes: b1ca2f63e2
("ASoC: Intel: sof_sdw: add amp number in components string for ucm")
Reported-by: Jaroslav Kysela <perex@perex.cz >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200515210731.10942-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-18 14:01:45 +01:00
Pierre-Louis Bossart
e149ca29f3
ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only
...
Remove the ambiguity with GPL-2.0 and use an explicit GPL-2.0-only
tag.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Link: https://lore.kernel.org/r/20200501145850.15178-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-01 17:45:24 +01:00
randerwang
b1ca2f63e2
ASoC: Intel: sof_sdw: add amp number in components string for ucm
...
The number of speaker amplifiers may vary between platforms. UCM
needs to check amp number to include different configuration files.
This patch keeps track of the number of speaker amplifiers and
stores it in components string of the card.
Tested on Comet Lake platforms.
Signed-off-by: randerwang <rander.wang@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Link: https://lore.kernel.org/r/20200419183509.4134-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-04-27 14:08:40 +01:00
Bard Liao
5930d02c2d
ASoC: intel: sof_sdw: init all aggregated codecs
...
Init codecs which belong to the same group id on all links.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200409185827.16255-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-04-14 14:34:06 +01:00
Naveen Manohar
798313f29b
ASoC: Intel: sof_sdw: Add Volteer support with RT5682 SNDW helper function
...
Add support for Google Volteer device. As per new unified soundwire machine
driver, add rt5682-sdw helper function, which configures codec to Link0.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Naveen Manohar <naveen.m@intel.com >
Link: https://lore.kernel.org/r/20200325220746.29601-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-03-27 17:11:56 +00:00
Pierre-Louis Bossart
52db12d193
ASoC: Intel: boards: add sof_sdw machine driver
...
This machine driver provides support for different configurations:
RT700, RT711, RT1308 (1x and 2x, I2S or SoundWire mode), and RT715
CometLake, Icelake, TigerLake.
PDM digital microphones
HDMI
To avoid introducing one driver per configuration, this common machine
driver relies on platform-specific information, tables and quirks to
dynamically create the relevant dailinks.
Unlike a lot of machine drivers, we use different DAI links for
SoundWire capture and playback since the Cadence PDIs can do capture
OR playback, not both simultaneously.
For each configuration, the card component string is updated so that UCM
can select the relevant parts.
Signed-off-by: Rander Wang <rander.wang@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Link: https://lore.kernel.org/r/20200325220746.29601-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-03-27 17:11:54 +00:00