Mark Brown [Mon, 22 Nov 2021 23:56:00 +0000 (23:56 +0000)]
Support BCLK input clock in tlv320aic31xx
Merge series from Ariel D'Alessandro <ariel.dalessandro@collabora.com>:
This patchset modifies the tlv320aic31xx driver to update its sysclk if
BCLK is used as the input clock. This allows to be used by the generic
fsl-asoc-card, without having to add a specific driver.
Mark Brown [Mon, 22 Nov 2021 23:55:59 +0000 (23:55 +0000)]
ASoC: SOF: enable multicore with dynamic pipelines
Merge series from Kai Vehmanen <kai.vehmanen@linux.intel.com>:
When a pipeline is marked dynamic in the SOF DSP firmware
topology definition (the tplg file kernel loads from filesystem),
it means the pipeline resources are not allocated when DSP is
booted (at driver probe, or at runtime resume), but rather delayed
until the pipeline is actually used.
Ariel D'Alessandro [Fri, 19 Nov 2021 15:32:48 +0000 (12:32 -0300)]
ASoC: fsl-asoc-card: Support fsl,imx-audio-tlv320aic31xx codec
Add entry for fsl,imx-audio-tlv320aic31xx audio codec. This codec is
configured to use BCLK as clock input.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20211119153248.419802-6-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ariel D'Alessandro [Fri, 19 Nov 2021 15:32:47 +0000 (12:32 -0300)]
ASoC: tlv320aic31xx: Handle BCLK set as PLL input configuration
If BCLK is used as PLL input, the sysclk is determined by the hw
params. So it must be updated here to match the input frequency, based
on sample rate, format and channels.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/r/20211119153248.419802-5-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ariel D'Alessandro [Fri, 19 Nov 2021 15:32:46 +0000 (12:32 -0300)]
ASoC: tlv320aic31xx: Add divs for bclk as clk_in
Add divisors for rates needed when the clk_in is set to BCLK.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20211119153248.419802-4-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ariel D'Alessandro [Fri, 19 Nov 2021 15:32:45 +0000 (12:32 -0300)]
ASoC: tlv320aic31xx: Add support for pll_r coefficient
When the clock used by the codec is BCLK, the operation parameters need
to be calculated from input sample rate and format. Low frequency rates
required different r multipliers, in order to achieve a higher PLL
output frequency.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20211119153248.419802-3-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ariel D'Alessandro [Fri, 19 Nov 2021 15:32:44 +0000 (12:32 -0300)]
ASoC: tlv320aic31xx: Fix typo in BCLK clock name
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20211119153248.419802-2-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Fri, 19 Nov 2021 12:48:54 +0000 (12:48 +0000)]
ASoC: cs42l42: Report initial jack state
When a jack handler is registered in cs42l42_set_jack() the
initial state should be reported if an attached headphone/headset
has already been detected.
The jack detect sequence takes around 1 second: typically long
enough for the machine driver to probe and register the jack handler
in time to receive the first report from the interrupt handler. So
it is possible on some systems that the correct initial state was seen
simply because of lucky timing. Modular builds were more likely to
miss the reporting of the initial state.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes:
4ca239f33737 ("ASoC: cs42l42: Always enable TS_PLUG and TS_UNPLUG interrupts")
Link: https://lore.kernel.org/r/20211119124854.58939-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Pierre-Louis Bossart [Fri, 19 Nov 2021 23:13:27 +0000 (17:13 -0600)]
ASoC: SOF: sof-pci-dev: use community key on all Up boards
There are already 3 versions of the Up boards with support for the SOF
community key (ApolloLake, WhiskyLake, TigerLake). Rather than
continue to add quirks for each version, let's add a wildcard.
For WHL and TGL, the authentication supports both the SOF community
key and the firmware signed with the Intel production key. Given two
choices, the community key is the preferred option to allow developers
to sign their own firmware. The firmware signed with production key
can still be selected if needed with a kernel module
option (snd-sof-pci.fw_path="intel/sof")
Tested-by: Péter Ujfalusi <peter.ujfalusi@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: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211119231327.211946-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:21 +0000 (21:26 +0200)]
ASoC: SOF: Intel: hda: free DAI widget during stop and suspend
To keep the widget use_counts balanced, free the DAI widget
during suspend and also during the stop trigger.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-11-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:20 +0000 (21:26 +0200)]
ASoC: SOF: add support for dynamic pipelines with multi-core
This patch adds support for dynamic pipelines with multi-core
by using the platform-specific core_get/put() ops to
power up/down a core when a widget is set up/freed.
Along with this, a few redundant functions are removed:
1. sof_pipeline_core_enable() is no longer needed as the
pipeline core will be set up when the pipeline widget
is set up
2. sof_core_enable() is replaced with snd_sof_core_get()
4. core_power_up/down() DSP ops are deprecated and replaced with
core get/put ops.
5. Core power down in sof_widget_unload() during topology
removal is also removed as it is not really needed. For dynamic
pipelines, the cores will be powered off when they are not used.
For static pipelines, the cores will be powered off in the device
remove callback.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-10-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:19 +0000 (21:26 +0200)]
ASoC: SOF: hda: don't use the core op for power up/power down
The core_power_up/down() ops will be deprecated. Use the
HDA platform-specific functions for powering up/down
the cores during probe/suspend/remove. The enabled_cores_mask
and the core ref_count's are manually updated in each of
these functions.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-9-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:18 +0000 (21:26 +0200)]
ASoC: SOF: free widgets in sof_tear_down_pipelines() for static pipelines
Free widgets for static pipelines in sof_tear_down_pipelines().
But this feature is unavailable in older firmware with ABI < 3.19.
Just reset widget use_count's for this case. This would ensure that
the secondary cores enabled required for topology setup are powered
down properly before the primary core is powered off during
system suspend.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-8-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:17 +0000 (21:26 +0200)]
ASoC: SOF: topology: remove sof_load_pipeline_ipc()
Remove the function sof_load_pipeline_ipc() and directly
send the IPC instead. The pipeline core is already enabled
with the call to sof_pipeline_core_enable() in sof_widget_setup().
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:16 +0000 (21:26 +0200)]
ASoC: SOF: Intel: CNL/ICL/APL: set core_get/core_put ops
Set core_get/put ops for CNL/ICL platforms. These platforms
do not support enabling/disabling secondary cores
dynamically. So skip sending the IPC to power off the
cores in the core_put op.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:15 +0000 (21:26 +0200)]
ASoC: SOF: Intel: TGL: set core_get/put ops
Set core_get/put() ops for TGL. When core_get()
is requested for a core, its ref_count is incremented
and the PM_CORE_ENABLE IPC sent to the firmware to
power up the core if the current ref_count is 1.
Conversely, the ref_count is decremented in core_put()
and an IPC is sent to the DSP to power off the core
if the ref_count is 0.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:14 +0000 (21:26 +0200)]
ASoC: SOF: Add ops for core_get and core_put
Add ops to get/put a core that will be used to power
up/down a core along with incrementing/decrementing
its ref_count.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:13 +0000 (21:26 +0200)]
ASoC: SOF: Introduce num_cores and ref count per core
Add two fields num_cores and dsp_cores_ref_count to
struct snd_sof_dev. These will be used to maintain the
ref count for each core to determine when it should be
powered up or down.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Fri, 19 Nov 2021 19:26:12 +0000 (21:26 +0200)]
ASoC: SOF: Intel: hda: expose get_chip_info()
expose get_chip_info().
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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/20211119192621.4096077-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Thu, 18 Nov 2021 18:57:42 +0000 (18:57 +0000)]
ASoC: SOF: Add support for Mediatek MT8195
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:
This adds sound open firmware driver support for MT8915 platform.
Srinivasa Rao Mandadapu [Thu, 18 Nov 2021 11:20:11 +0000 (16:50 +0530)]
ASoC: codecs: MBHC: Remove useless condition check
Remove redundant conditional check and clean code in special
headset support functions.
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Link: https://lore.kernel.org/r/1637234411-554-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
YC Hung [Thu, 18 Nov 2021 10:07:49 +0000 (12:07 +0200)]
ASoC: SOF: mediatek: Add DSP system PM callback for mt8195
Add DSP system PM callback for suspend and resume
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-9-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
YC Hung [Thu, 18 Nov 2021 10:07:48 +0000 (12:07 +0200)]
ASoC: SOF: mediatek: Add mt8195 dsp clock support
Add adsp clock on/off support on mt8195 platform.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-8-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
YC Hung [Thu, 18 Nov 2021 10:07:47 +0000 (12:07 +0200)]
ASoC: SOF: mediatek: Add dai driver dsp ops callback for mt8195
Add dsp ops callback to register AFE DL2/DL3/UL4/UL5 sof dai's with ALSA
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-7-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
YC Hung [Thu, 18 Nov 2021 10:07:46 +0000 (12:07 +0200)]
ASoC: SOF: Add mt8195 device descriptor
Add SOF device and DT descriptor for Mediatek mt8195 platform.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter 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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-6-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
YC Hung [Thu, 18 Nov 2021 10:07:45 +0000 (12:07 +0200)]
ASoC: SOF: mediatek: Add fw loader and mt8195 dsp ops to load firmware
Add mt8195-loader module with ops callback to load and run firmware
on mt8195 platform.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter 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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
YC Hung [Thu, 18 Nov 2021 10:07:44 +0000 (12:07 +0200)]
ASoC: SOF: topology: Add support for Mediatek AFE DAI
Add new sof dai and config to pass topology file configuration
to SOF firmware running on Mediatek platform DSP core.
Add mediatek audio front end(AFE) to the list of supported sof_dais
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter 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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
YC Hung [Thu, 18 Nov 2021 10:07:43 +0000 (12:07 +0200)]
ASoC: SOF: tokens: add token for Mediatek AFE
Add the definition for Mediatek audio front end(AFE) tokens,include
AFE sampling rate, channels, and format.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter 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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
YC Hung [Thu, 18 Nov 2021 10:07:42 +0000 (12:07 +0200)]
ASoC: SOF: mediatek: Add mt8195 hardware support
This patch initialize to support SOF on Mediatek mt8195 platform.
MT8195 has four Cortex A78 cores paired with four Cortex A55 cores.
It also has Cadence HiFi-4 DSP single core. There are shared DRAM and
mailbox interrupt between AP and DSP to use for IPC communication.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter 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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Wed, 17 Nov 2021 22:29:46 +0000 (22:29 +0000)]
ASoC: SOF: Platform updates for AMD and Mediatek
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:
This patchseries adds AMD Renoir ACP HW support.
Mark Brown [Wed, 17 Nov 2021 22:29:45 +0000 (22:29 +0000)]
ASoC: SOF: New debug feature: IPC message injector
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:
Add a test/debug feature allowing IPC messages to the DSP to be injected
via debugfs.
Mark Brown [Wed, 17 Nov 2021 22:29:44 +0000 (22:29 +0000)]
ASoC: cs42l42: Remove redundant code
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:
Cleanups and code clarifications for the cs42l42 driver.
Charles Keepax [Wed, 17 Nov 2021 13:23:00 +0000 (13:23 +0000)]
firmware: cs_dsp: Allow creation of event controls
Some firmwares contain controls intended to convey firmware state back
to the host. Whilst more infrastructure will probably be needed for
these in time, as a first step allow creation of the controls, so said
firmwares arn't completely rejected.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-10-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:59 +0000 (13:22 +0000)]
firmware: cs_dsp: Add offset to cs_dsp read/write
Provide a mechanism to access only part of a control through the cs_dsp
interface.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-9-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:58 +0000 (13:22 +0000)]
firmware: cs_dsp: Clarify some kernel doc comments
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-8-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:57 +0000 (13:22 +0000)]
firmware: cs_dsp: Perform NULL check in cs_dsp_coeff_write/read_ctrl
Add a NULL check to the cs_dsp_coeff_write/read_ctrl functions. This is
a major convenience for users of the cs_dsp library as it allows the call
to cs_dsp_get_ctl to be inlined with the call to read/write the control
itself.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:56 +0000 (13:22 +0000)]
firmware: cs_dsp: Add support for rev 2 coefficient files
Add support for the revision 2 coefficient file, this format is
identical to revision 1 and was simply added by accident to some
firmware. However unfortunately many firmwares have leaked into
production using this and as such driver support really needs to
be added for it.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:55 +0000 (13:22 +0000)]
firmware: cs_dsp: Print messages from bin files
The coefficient file contains various info strings, and the equivalent
strings are printed from the WMFW file as it is loaded. Add support
for printing these from the coefficient file as well.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:54 +0000 (13:22 +0000)]
firmware: cs_dsp: Add pre_run callback
The code already has a post_run callback, add a matching pre_run
callback to the client_ops that is called before execution is started.
This callback provides a convenient place for the client code to
set DSP controls or hardware that requires configuration before
the DSP core actually starts execution. Note that placing this callback
before cs_dsp_coeff_sync_controls is important to ensure that any
control values are then correctly synced out to the chip.
Co-authored-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:53 +0000 (13:22 +0000)]
firmware: cs_dsp: Add version checks on coefficient loading
The firmware coefficient files contain version information that is
currently ignored by the cs_dsp code. This information specifies which
version of the firmware the coefficient were generated for. Add a check
into the code which prints a warning in the case the coefficient and
firmware differ in version, in many cases this will be ok but it is not
always, so best to let the user know there is a potential issue.
Co-authored-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:52 +0000 (13:22 +0000)]
firmware: cs_dsp: Add lockdep asserts to interface functions
Some of the control functions exposed by the cs_dsp code require the
pwr_lock to be held by the caller. Add lockdep_assert_held calls to
ensure this is done correctly.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Wed, 17 Nov 2021 13:22:51 +0000 (13:22 +0000)]
ASoC: wm_adsp: Remove the wmfw_add_ctl helper function
The helper function wmfw_add_ctl is only called from one place and that
place is a function with only 2 lines of code. Merge the helper function
into the work function to simplify the code.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:26 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add support for SOF firmware authentication
Add callback to notify PSP after loading firmware on DSP. PSP will
validate the loaded firmware and set qualifier bit to run firmware
on secured AMD systems.
Signed-off-by: Julian Schroeder <Julian.Schroeder@amd.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-14-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
V sujith kumar Reddy [Wed, 17 Nov 2021 09:37:25 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add trace logger support
Add trace support and configure trace stream for ACP firmware.
Signed-off-by: Vishnuvardhanrao Ravuapati <vishnuvardhanrao.ravulapati@amd.com>
Signed-off-by: V sujith kumar Reddy <vsreddy@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-13-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:24 +0000 (11:37 +0200)]
ASoC: SOF: topology: Add support for AMD ACP DAIs
Add new sof dais and config to pass topology file configuration
to SOF firmware running on ACP's DSP core. ACP firmware support
I2S_BT, I2S_SP and DMIC controller hence add three new dais to
the list of supported sof_dais
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-12-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:23 +0000 (11:37 +0200)]
ASoC: amd: acp-config: Remove legacy acpi based machine struct
We have moved legacy based machine struct into platform driver to
resolve module dependency with non-SOF ALSA build, hence removed
it from acp-config driver module.
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-11-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:22 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add Renoir PCI driver interface
Add PCI driver module to enable sof pci device support for Renoir.
If machine flag set to FLAG_SOF_ONLY_DMIC this pci driver register
platform device for non dsp based I2S platform device. If machine
flag is not enabled for SOF pci probe will return without invoking
sof device probe and registration
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-10-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:21 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add machine driver dsp ops for Renoir platform
Add dsp ops callback to select and register machine driver.
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-9-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:20 +0000 (11:37 +0200)]
ASoC: amd: Add module to determine ACP configuration
ACP hw block configuration differs across various distributions
and hence it's required to register different drivers module for
distributions. For now we support three ACP drivers:
* ACP without SOF use case
* ACP with SOF use case
* ACP with SOF use case for DMIC and non SOF for I2S endpoints
As all above driver registers with common PCI ID for ACP hw block
we need code to determine ACP configuration and auto select driver
module. This patch expose function that return configuration flag
based on dmi checks for a system. ACP driver module probe register
platform device based on such configuration flag to avoid conflict
with other ACP drivers probed for same PCI ID.
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-8-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:19 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add PCM stream callback for Renoir dai's
Add module to support ALSA pcm stream configurations for ACP I2S
and DMIC endpoints
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-7-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:18 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add dai driver dsp ops callback for Renoir
Add dsp ops callback to register I2S and DMIC sof dai's with ALSA
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-6-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:17 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add IPC support for ACP IP block
Add IPC module for generic ACP block and exposed ops callback for
to synchronize SOF IPC message between host and DSP
Signed-off-by: Balakishore Pati <Balakishore.pati@amd.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:16 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add fw loader and renoir dsp ops to load firmware
Add acp-loader module with ops callback to load and run firmware
on ACP DSP block on Renoir platform.
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:15 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add helper callbacks for ACP's DMA configuration
ACP DMA is used for loading SOF firmware into DSP memory and data
transfer from system memory to DSP memory. Add helper callbacks to
initialize and configure ACP DMA block for fw loading.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ajit Kumar Pandey [Wed, 17 Nov 2021 09:37:14 +0000 (11:37 +0200)]
ASoC: SOF: amd: Add Renoir ACP HW support
This patch initializes ACP HW block to support SOF on
AMD Renoir platform.
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Olivier Moysan [Wed, 17 Nov 2021 11:00:31 +0000 (12:00 +0100)]
ASoC: stm32: sai: increase channels_max limit
The SAI peripheral supports up to 16 channels in TDM mode (8L+8R).
The driver currently supports TDM over two channels.
Increase SAI DAI playback/record channels_max,
to also allow up to 16 channels in TDM mode.
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20211117110031.19345-1-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Tue, 16 Nov 2021 15:21:37 +0000 (17:21 +0200)]
ASoC: SOF: debug: Add support for IPC message injection
In order to stress test the firmware's ability to handle (mis)crafted
IPC messages this patch adds a debugfs interface where a binary file
(message) can be written and the message is sent to the firmware as it is.
Read on the same file will return the reply from the firmware if it is
available as a binary.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Tue, 16 Nov 2021 15:21:36 +0000 (17:21 +0200)]
ASoC: SOF: intel: Use the generic helper to get the reply
Make use of the generic snd_sof_ipc_process_reply() from the core instead
the local implementation.
snd_sof_ipc_process_reply() handles the reply retrieving and the ipc reply
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Tue, 16 Nov 2021 15:21:35 +0000 (17:21 +0200)]
ASoC: SOF: imx: Use the generic helper to get the reply
Make use of the generic snd_sof_ipc_process_reply() from the core instead
the local implementation.
snd_sof_ipc_process_reply() handles the reply retrieving and the ipc reply
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Tue, 16 Nov 2021 15:21:34 +0000 (17:21 +0200)]
ASoC: SOF: utils: Add generic function to get the reply for a tx message
The code to get the reply for a tx is identical in all but one place:
imx8_get_reply(), imx8m_get_reply(), atom_get_reply(), bdw_get_reply().
hda_dsp_ipc_get_reply() have additional check in place for PROBES and
special handling of PM messages.
Add a generic implementation to the core which can be used as drop in
replacement.
The reply size check is changed to be able to handle cases when the reply
size is not know beforehand (this is the case for PROBES and
DEBUG_MEM_USAGE for example).
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Tue, 16 Nov 2021 16:39:01 +0000 (16:39 +0000)]
ASoC: cs42l42: Remove redundant pll_divout member
Now that struct cs42l42_private has pll_config, the current PLL
configuration can be looked up directly in pll_ratio_table. This
makes the pll_divout member of cs42l42_private redundant since it
was only a copy of the value from pll_ratio_table.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211116163901.45390-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Tue, 16 Nov 2021 16:39:00 +0000 (16:39 +0000)]
ASoC: cs42l42: Simplify reporting of jack unplug
When reporting a jack unplug there's no need to make the reported
flags conditional on which flags were reported during the plug
event. It's perfectly safe to report all flags and buttons as
not-present and let the higher code filter for changes.
There's also no need to make two separate snd_soc_jack_report()
calls for presence flags and button flags. It can all be done in
one report.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211116163901.45390-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Tue, 16 Nov 2021 16:38:59 +0000 (16:38 +0000)]
ASoC: cs42l42: Remove redundant writes to RS_PLUG/RS_UNPLUG masks
The RS_PLUG and RS_UNPLUG interrupt masks are always written as 1 so
those writes are redundant and can be deleted.
This makes it completely clear in the code that only the TS_PLUG and
TS_UNPLUG masks are being changed.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211116163901.45390-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Tue, 16 Nov 2021 16:38:58 +0000 (16:38 +0000)]
ASoC: cs42l42: Remove redundant writes to DETECT_MODE
There are multiple places where DETECT_MODE is included in a register
write, but in every case it is written as 0. Removing these redundant
writes makes the code less cluttered and also makes it obvious that
DETECT_MODE is never changed.
A single initialization to 0 is added to cs42l42_setup_hs_type_detect().
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211116163901.45390-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Pierre-Louis Bossart [Tue, 16 Nov 2021 12:41:31 +0000 (14:41 +0200)]
ASoC: SOF: i.MX: simplify Kconfig
Follow the Intel example and simplify the Kconfig
a) start from the end-product for 'select' chains
b) use 'depends on' to filter out configurations.
c) use snd-sof-of as a common module without any 'select'
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116124131.46414-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Srinivas Kandagatla [Tue, 16 Nov 2021 11:50:21 +0000 (11:50 +0000)]
ASoC: qcom: sdm845: only setup slim ports once
Currently same slim channel map setup for every dai link, which is redundant.
Fix this by adding a flag and conditionally setting these channel maps.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116115021.14213-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
David Heidelberg [Thu, 28 Oct 2021 12:46:38 +0000 (14:46 +0200)]
ASoC: wm8903: Convert txt bindings to yaml
Convert the Wolfson WM8903 Ultra-Low Power Stereo CODEC Device Tree
binding documentation to json-schema.
Signed-off-by: David Heidelberg <david@ixit.cz>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211028124639.38420-1-david@ixit.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
Srinivasa Rao Mandadapu [Mon, 15 Nov 2021 07:11:28 +0000 (12:41 +0530)]
ASoC: codecs: MBHC: Add support for special headset
Update MBHC driver to support special headset such as apple
and huwawei headsets.
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1636960288-27537-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Tue, 2 Nov 2021 09:47:56 +0000 (11:47 +0200)]
ASoC: SOF: core: Unregister machine driver before IPC and debugfs
To ensure clean unload of the machine driver, components and topology, do
the unregister before we free IPC and debugfs.
It is a possibility that part of the unregister we would have IPC
communication with the firmware.
Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
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>
Link: https://lore.kernel.org/r/20211102094756.9317-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Maíra Canal [Sun, 24 Oct 2021 18:42:07 +0000 (15:42 -0300)]
ASoC: adau1701: Replace legacy gpio interface for gpiod
Considering the current transition of the GPIO subsystem, remove all
dependencies of the legacy GPIO interface (linux/gpio.h and linux
/of_gpio.h) and replace it with the descriptor-based GPIO approach.
Signed-off-by: Maíra Canal <maira.canal@usp.br>
Link: https://lore.kernel.org/r/YXWo/9o7ye9a11aR@fedora
Signed-off-by: Mark Brown <broonie@kernel.org>
Simon Trimmer [Mon, 15 Nov 2021 12:02:15 +0000 (12:02 +0000)]
firmware: cs_dsp: tidy includes in cs_dsp.c and cs_dsp.h
This patch removes unused included header files and moves others into
cs_dsp.h to ensure that types referenced in the header file are properly
described to prevent compiler warnings.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211115120215.56824-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Mon, 1 Nov 2021 10:10:06 +0000 (10:10 +0000)]
ASoC: cs42l42: Add control for audio slow-start switch
This adds an ALSA control so that the slow-start audio ramp feature
can be disabled. This is useful for high-definition audio applications.
The register field is unusual in that it is a 3-bit field with only
two valid values, 000=off and 111=on.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211101101006.13092-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mac Chiang [Tue, 9 Nov 2021 13:38:08 +0000 (08:38 -0500)]
ASoC: Intel: add sof-nau8825 machine driver
The machine driver is a generic machine driver for SOF with nau8825
codec w or w/o speaker additionally. Depending on the SOC
HDMI, DMIC, Bluetooth offload support are added dynamically.
Only add information related to SOF since the machine driver was
only tested with SOF.
There are currently 4 i2s machine variants of ADL.
This supports the headphone NUA8825(SSP0) alone or with smart or dumb
speakers.
Board 2,3,4 use SSP2 for Bluetooth offload support except board 1.
Board 1 : NAU8825 + RT1019P(SSP2)
Board 2 : NAU8825 + MAX98373(SSP1)
Board 3 : NAU8825 + MAX98360A(SSP1)
Board 4 : NAU8825
Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Co-developed-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211109133808.8729-1-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Christophe JAILLET [Wed, 3 Nov 2021 19:19:27 +0000 (20:19 +0100)]
ASoC: codecs: Axe some dead code in 'wcd_mbhc_adc_hs_rem_irq()'
'hphpa_on' is know to be false, so this is just dead code that should be
removed.
Suggested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/57a89cc31eb2312addd3c77896d7df8206aef138.1635967035.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
David Rhodes [Fri, 29 Oct 2021 21:40:28 +0000 (16:40 -0500)]
ASoC: cs35l41: DSP Support
Support for HALO DSP and firmware
Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211029214028.401284-2-drhodes@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Thu, 28 Oct 2021 14:09:02 +0000 (15:09 +0100)]
ASoC: dt-bindings: cs42l42: Convert binding to yaml
Replace the old .txt binding with a new schema binding.
At the same time, some of the descriptions are updated to make them
clearer, fix errors, or just make them fit better into the style
of schema binding.
The cirrus,hs-bias-ramp-rate property was missing from the old .txt
binding and has been added to the yaml.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211028140902.11786-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Mon, 15 Nov 2021 19:23:56 +0000 (19:23 +0000)]
Merge series "ASoC: Intel: sof_sdw: Use fixed DAI link id" from Bard Liao <yung-chuan.liao@linux.intel.com>:
This series provides a way to use constant dailink numbers for different
devices. So that we don't need to renumber them in topologies.
Some patches with different purpose are sent together in this series
since they are dependent.
Bard Liao (8):
ASoC: intel: sof_sdw: return the original error number
ASoC: intel: sof_sdw: rename be_index/link_id to link_index
ASoC: intel: sof_sdw: Use a fixed DAI link id for AMP
ASoC: intel: sof_sdw: move DMIC link id overwrite to
create_sdw_dailink
ASoC: intel: sof_sdw: remove SOF_RT715_DAI_ID_FIX quirk
ASoC: intel: sof_sdw: remove sof_sdw_mic_codec_mockup_init
ASoC: intel: sof_sdw: remove get_next_be_id
ASoC: intel: sof_sdw: add link adr order check
Pierre-Louis Bossart (2):
ASoC: Intel: sof_sdw: fix jack detection on HP Spectre x360
convertible
ASoC: Intel: sof_sdw: add SKU for Dell Latitude 9520
sound/soc/intel/boards/sof_sdw.c | 152 ++++++++++----------
sound/soc/intel/boards/sof_sdw_common.h | 7 +-
sound/soc/intel/boards/sof_sdw_rt715.c | 7 -
sound/soc/intel/boards/sof_sdw_rt715_sdca.c | 7 -
4 files changed, 85 insertions(+), 88 deletions(-)
--
2.17.1
Mark Brown [Mon, 15 Nov 2021 19:23:54 +0000 (19:23 +0000)]
Merge series "Add tfa9897 rcv-gpios support" from Vincent Knecht <vincent.knecht@mailoo.org>:
This is the continuation of a previous series [1] where
- patch 1/4 is removed in favor of using pin switch
This will be posted independently of tfa989x support,
since it mainly require changes to sound/soc/qcom/common.c
and device DTS.
- patch 2/4 is already merged
so here are reworked patch 3/4 (bindings fixed and example added)
and patch 4/4 unchanged.
[1] https://patchwork.kernel.org/project/alsa-devel/cover/
20211024085840.1536438-1-vincent.knecht@mailoo.org/
Vincent Knecht (2):
ASoC: dt-bindings: nxp, tfa989x: Add rcv-gpios property for tfa9897
ASoC: codecs: tfa989x: Add support for tfa9897 optional rcv-gpios
.../bindings/sound/nxp,tfa989x.yaml | 41 +++++++++++++++++++
sound/soc/codecs/tfa989x.c | 20 ++++++++-
2 files changed, 60 insertions(+), 1 deletion(-)
--
2.31.1
Bard Liao [Wed, 27 Oct 2021 02:18:24 +0000 (10:18 +0800)]
ASoC: intel: sof_sdw: add link adr order check
We assume the adr order described in a snd_soc_acpi_link_adr array is
jack -> amp -> mic. We follow the same order to implement the topology.
We will need a special topology if we configure a snd_soc_acpi_link_adr
array with different order. Adding a check and a warning message can
remind people to keep the order when adding a new snd_soc_acpi_link_adr
array.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bard Liao [Wed, 27 Oct 2021 02:18:23 +0000 (10:18 +0800)]
ASoC: intel: sof_sdw: remove get_next_be_id
DAI link id will not be set from sdw codec init feedback function,
and be_id is changed by create_sdw_dailink() now. So we don't need
get_next_be_id() anymore.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bard Liao [Wed, 27 Oct 2021 02:18:22 +0000 (10:18 +0800)]
ASoC: intel: sof_sdw: remove sof_sdw_mic_codec_mockup_init
Now, we set DAI link id as SDW_DMIC_DAI_ID for all DMICs.
No need to set it in sof_sdw_mic_codec_mockup_init.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bard Liao [Wed, 27 Oct 2021 02:18:21 +0000 (10:18 +0800)]
ASoC: intel: sof_sdw: remove SOF_RT715_DAI_ID_FIX quirk
SOF_RT715_DAI_ID_FIX is not used anywhere. Remove it.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bard Liao [Wed, 27 Oct 2021 02:18:20 +0000 (10:18 +0800)]
ASoC: intel: sof_sdw: move DMIC link id overwrite to create_sdw_dailink
We can apply the fixed dai link id for DMICs in create_sdw_dailink().
No need to set it in each DMIC's callback.
The fixed dai link id is not only for rt715 and rt715-sdca, but for all
DMICs, therefore we remove the SOF_RT715_DAI_ID_FIX check as well.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bard Liao [Wed, 27 Oct 2021 02:18:19 +0000 (10:18 +0800)]
ASoC: intel: sof_sdw: Use a fixed DAI link id for AMP
Currently, we assign SoundWire DAI link id according to the order in
the link address table, with the assumption that the headset codec is
listed first, then amplifiers and last capture devices. If the headset
codec is not present in a platform, the dai link for amplifiers will be
shifted, which can be handled in two ways
a) modify the topology to renumber the dailink changes
b) keep the dailink numbers constant in topology but also avoid the
variations in the machine driver.
This patch adds support for option b), the dailink index for amplifiers
and capture devices becomes fixed.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bard Liao [Wed, 27 Oct 2021 02:18:18 +0000 (10:18 +0800)]
ASoC: intel: sof_sdw: rename be_index/link_id to link_index
The link_id variable in sof_card_dai_links_create() and be_index argument
in create_sdw_dailink() is actually links' index. Rename them to link_index
to be consistent.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Pierre-Louis Bossart [Wed, 27 Oct 2021 02:18:17 +0000 (10:18 +0800)]
ASoC: Intel: sof_sdw: add SKU for Dell Latitude 9520
Different SKUs seem to be used for the same design.
BugLink: https://github.com/thesofproject/linux/issues/3206
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Pierre-Louis Bossart [Wed, 27 Oct 2021 02:18:16 +0000 (10:18 +0800)]
ASoC: Intel: sof_sdw: fix jack detection on HP Spectre x360 convertible
Tests on device show the JD2 mode does not work at all, the 'Headphone
Jack' and 'Headset Mic Jack' are shown as 'on' always.
JD1 seems to be the better option, with at least a change between the
two cases.
Jack not plugged-in:
[root@fedora ~]# amixer -Dhw:0 cget numid=12
numid=12,iface=CARD,name='Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
Jack plugged-in:
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on
The 'Headset Mic Jack' is updated with a delay which seems normal with
additional calibration needed.
Fixes:
d92e279dee56 ('ASoC: Intel: sof_sdw: add quirk for HP Spectre x360 convertible')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bard Liao [Wed, 27 Oct 2021 02:18:15 +0000 (10:18 +0800)]
ASoC: intel: sof_sdw: return the original error number
We don't want to convert create_sdw_dailink()'s return value to -ENOMEM.
Signed-off-by: Bard Liao <yung-chuan.liao@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: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Tue, 2 Nov 2021 10:10:19 +0000 (12:10 +0200)]
ASoC: SOF: trace: send DMA_TRACE_FREE IPC during release
Send the DMA_TRACE_FREE IPC during release to stop and free the trace
DMA in the DSP.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211102101019.14037-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Tue, 2 Nov 2021 10:10:18 +0000 (12:10 +0200)]
ASoC: SOF: IPC: update ipc_log_header()
Parse all the trace DMA IPC commands in ipc_log_header().
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211102101019.14037-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ranjani Sridharan [Tue, 2 Nov 2021 10:10:17 +0000 (12:10 +0200)]
ASoC: SOF: IPC: Add new IPC command to free trace DMA
Add a new SOF_IPC_TRACE_DMA_FREE IPC command to stop and free trace DMA
in the FW.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211102101019.14037-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Vincent Knecht [Sun, 31 Oct 2021 21:09:56 +0000 (22:09 +0100)]
ASoC: codecs: tfa989x: Add support for tfa9897 optional rcv-gpios
Some OEM use a GPIO in addition to the tfa9897 RCV bit to
switch between loudspeaker and earpiece/receiver mode.
Add support for the GPIO switching by specifying rcv-gpios in DT.
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20211031210956.812101-3-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Vincent Knecht [Sun, 31 Oct 2021 21:09:55 +0000 (22:09 +0100)]
ASoC: dt-bindings: nxp, tfa989x: Add rcv-gpios property for tfa9897
Add optional rcv-gpios property specific to tfa9897 receiver mode.
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211031210956.812101-2-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Mon, 15 Nov 2021 13:25:03 +0000 (13:25 +0000)]
Merge existing fixes from asoc/for-5.16 into new branch
Linus Torvalds [Sun, 14 Nov 2021 21:56:52 +0000 (13:56 -0800)]
Linux 5.16-rc1
Gustavo A. R. Silva [Sun, 14 Nov 2021 00:57:25 +0000 (18:57 -0600)]
kconfig: Add support for -Wimplicit-fallthrough
Add Kconfig support for -Wimplicit-fallthrough for both GCC and Clang.
The compiler option is under configuration CC_IMPLICIT_FALLTHROUGH,
which is enabled by default.
Special thanks to Nathan Chancellor who fixed the Clang bug[1][2]. This
bugfix only appears in Clang 14.0.0, so older versions still contain
the bug and -Wimplicit-fallthrough won't be enabled for them, for now.
This concludes a long journey and now we are finally getting rid
of the unintentional fallthrough bug-class in the kernel, entirely. :)
Link: https://github.com/llvm/llvm-project/commit/9ed4a94d6451046a51ef393cd62f00710820a7e8
Link: https://bugs.llvm.org/show_bug.cgi?id=51094
Link: https://github.com/KSPP/linux/issues/115
Link: https://github.com/ClangBuiltLinux/linux/issues/236
Co-developed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Co-developed-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sun, 14 Nov 2021 20:18:22 +0000 (12:18 -0800)]
Merge tag 'xfs-5.16-merge-5' of git://git./fs/xfs/xfs-linux
Pull xfs cleanups from Darrick Wong:
"The most 'exciting' aspect of this branch is that the xfsprogs
maintainer and I have worked through the last of the code
discrepancies between kernel and userspace libxfs such that there are
no code differences between the two except for #includes.
IOWs, diff suffices to demonstrate that the userspace tools behave the
same as the kernel, and kernel-only bits are clearly marked in the
/kernel/ source code instead of just the userspace source.
Summary:
- Clean up open-coded swap() calls.
- A little bit of #ifdef golf to complete the reunification of the
kernel and userspace libxfs source code"
* tag 'xfs-5.16-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: sync xfs_btree_split macros with userspace libxfs
xfs: #ifdef out perag code for userspace
xfs: use swap() to make dabtree code cleaner
Linus Torvalds [Sun, 14 Nov 2021 19:53:59 +0000 (11:53 -0800)]
Merge tag 'for-5.16/parisc-3' of git://git./linux/kernel/git/deller/parisc-linux
Pull more parisc fixes from Helge Deller:
"Fix a build error in stracktrace.c, fix resolving of addresses to
function names in backtraces, fix single-stepping in assembly code and
flush userspace pte's when using set_pte_at()"
* tag 'for-5.16/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc/entry: fix trace test in syscall exit path
parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page
parisc: Fix implicit declaration of function '__kernel_text_address'
parisc: Fix backtrace to always include init funtion names
Linus Torvalds [Sun, 14 Nov 2021 19:37:49 +0000 (11:37 -0800)]
Merge tag 'sh-for-5.16' of git://git.libc.org/linux-sh
Pull arch/sh updates from Rich Felker.
* tag 'sh-for-5.16' of git://git.libc.org/linux-sh:
sh: pgtable-3level: Fix cast to pointer from integer of different size
sh: fix READ/WRITE redefinition warnings
sh: define __BIG_ENDIAN for math-emu
sh: math-emu: drop unused functions
sh: fix kconfig unmet dependency warning for FRAME_POINTER
sh: Cleanup about SPARSE_IRQ
sh: kdump: add some attribute to function
maple: fix wrong return value of maple_bus_init().
sh: boot: avoid unneeded rebuilds under arch/sh/boot/compressed/
sh: boot: add intermediate vmlinux.bin* to targets instead of extra-y
sh: boards: Fix the cacography in irq.c
sh: check return code of request_irq
sh: fix trivial misannotations
Linus Torvalds [Sun, 14 Nov 2021 19:30:50 +0000 (11:30 -0800)]
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King:
- Fix early_iounmap
- Drop cc-option fallbacks for architecture selection
* tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
ARM: 9156/1: drop cc-option fallbacks for architecture selection
ARM: 9155/1: fix early early_iounmap()