Commit Graph

40340 Commits

Author SHA1 Message Date
Mark Brown
06a0fc36a5
Merge series "Add reset-gpios handling for max98927" from Alejandro Tafalla <atafalla@dnyon.com>:
The max98927 codec on some devices (i.e. Xiaomi Mi A2 Lite phone) requires
hardware-resetting the codec by driving a reset-gpio. This series adds
support for it through an optional reset-gpios property.

v4:
* Correctly assert/deassert the GPIO states
* Wait for the i2c port to be ready after reset
* Reset device when removed

v3:
* Fix indentation on the dev_err_probe line

v2:
* Use dev_err_probe instead of dev_err

Alejandro Tafalla (2):
  ASoC: max98927: Handle reset gpio when probing i2c
  dt-bindings: sound: max98927: Add reset-gpios optional property

 .../devicetree/bindings/sound/max9892x.txt    |  3 +++
 sound/soc/codecs/max98927.c                   | 25 +++++++++++++++++++
 sound/soc/codecs/max98927.h                   |  1 +
 3 files changed, 29 insertions(+)

--
2.33.0
2021-10-07 22:24:59 +01:00
Mark Brown
99f11b6552
Merge series "Introduce new SOF helpers" from Daniel Baluta <daniel.baluta@oss.nxp.com>
Daniel Baluta <daniel.baluta@nxp.com>:

From: Daniel Baluta <daniel.baluta@nxp.com>

This patchseries adds new helpers in order to reduce code duplication
and prepare for compress audio support with SOF.

Bud Liviu-Alexandru (1):
  ASoC: SOF: Make Intel IPC stream ops generic

Daniel Baluta (3):
  ASoC: SOF: Introduce snd_sof_mailbox_read / snd_sof_mailbox_write
    callbacks
  ASoC: SOF: imx: Use newly introduced generic IPC stream ops
  ASoC: SOF: Introduce fragment elapsed notification API

 sound/soc/sof/Kconfig                         |  4 ++
 sound/soc/sof/Makefile                        |  3 +-
 sound/soc/sof/compress.c                      | 51 +++++++++++++++++++
 sound/soc/sof/imx/Kconfig                     |  2 +
 sound/soc/sof/imx/imx8.c                      | 39 +++++++-------
 sound/soc/sof/imx/imx8m.c                     | 26 ++++------
 sound/soc/sof/intel/Makefile                  |  3 --
 sound/soc/sof/intel/apl.c                     |  4 ++
 sound/soc/sof/intel/bdw.c                     | 12 +++--
 sound/soc/sof/intel/byt.c                     | 24 ++++++---
 sound/soc/sof/intel/cnl.c                     |  4 ++
 sound/soc/sof/intel/icl.c                     |  4 ++
 sound/soc/sof/intel/pci-tng.c                 | 12 +++--
 sound/soc/sof/intel/tgl.c                     |  4 ++
 sound/soc/sof/ipc.c                           |  6 ++-
 sound/soc/sof/ops.h                           | 15 ++++++
 sound/soc/sof/pcm.c                           |  7 ++-
 sound/soc/sof/sof-audio.h                     | 11 +++-
 sound/soc/sof/sof-priv.h                      | 28 ++++++----
 .../sof/{intel/intel-ipc.c => stream-ipc.c}   | 50 +++++++++---------
 sound/soc/sof/topology.c                      |  6 ++-
 21 files changed, 218 insertions(+), 97 deletions(-)
 create mode 100644 sound/soc/sof/compress.c
 rename sound/soc/sof/{intel/intel-ipc.c => stream-ipc.c} (58%)

--
2.27.0
2021-10-07 22:24:58 +01:00
Mark Brown
1cfd7c2ee9
Merge series "ASoC: SOF: Improvements for debugging" from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
Hi,

The aim of this series is to clean up, make it easier to interpret and less
'chatty' prints aimed for debugging errors.

For example currently the DSP/IPC dump is printed every time we have an IPC
timeout and it is posible to lost the first and more indicative dump to find the
rootcause.

Regards,
Peter
---
Peter Ujfalusi (18):
  ASoC: SOF: debug: Swap the dsp_dump and ipc_dump sequence for
    fw_exception
  ASoC: SOF: ipc and dsp dump: Add markers for better visibility
  ASoC: SOF: Print the dbg_dump and ipc_dump once to reduce kernel log
    noise
  ASoC: SOF: loader: Print the DSP dump if boot fails
  ASoC: SOF: intel: atom: No need to do a DSP dump in atom_run()
  ASoC: SOF: debug/ops: Move the IPC and DSP dump functions out from the
    header
  ASoC: SOF: debug: Add SOF_DBG_DUMP_OPTIONAL flag for DSP dumping
  ASoC: SOF: intel: hda-loader: Use snd_sof_dsp_dbg_dump() for DSP dump
  ASoC: SOF: Drop SOF_DBG_DUMP_FORCE_ERR_LEVEL and sof_dev_dbg_or_err
  ASoC: SOF: debug: Print out the fw_state along with the DSP dump
  ASoC: SOF: ipc: Re-enable dumps after successful IPC tx
  ASoC: SOF: ops: Force DSP panic dumps to be printed
  ASoC: SOF: Introduce macro to set the firmware state
  ASoC: SOF: intel: hda: Drop 'error' prefix from error dump functions
  ASoC: SOF: core: Clean up snd_sof_get_status() prints
  ASoC: SOF: loader: Drop SOF_DBG_DUMP_REGS flag when firmware start
    fails
  ASoC: SOF: Intel: hda-loader: Drop SOF_DBG_DUMP_REGS flag from
    dbg_dump calls
  ASoC: SOF: Intel: hda: Dump registers and stack when SOF_DBG_DUMP_REGS
    is set

Pierre-Louis Bossart (1):
  ASoC: SOF: core: debug: force all processing on primary core

 sound/soc/sof/core.c             | 24 ++++++-------
 sound/soc/sof/debug.c            | 61 ++++++++++++++++++++++++++++++--
 sound/soc/sof/intel/atom.c       |  5 +--
 sound/soc/sof/intel/hda-loader.c | 11 +++---
 sound/soc/sof/intel/hda.c        | 16 +++------
 sound/soc/sof/ipc.c              | 10 ++++--
 sound/soc/sof/loader.c           | 11 ++++--
 sound/soc/sof/ops.c              |  3 ++
 sound/soc/sof/ops.h              | 12 +------
 sound/soc/sof/pm.c               |  6 ++--
 sound/soc/sof/sof-priv.h         | 31 ++++++++++------
 sound/soc/sof/topology.c         |  6 ++++
 12 files changed, 131 insertions(+), 65 deletions(-)

--
2.33.0
2021-10-07 22:24:56 +01:00
Mark Brown
43b058698f
Merge series "Rockchip I2S/TDM controller" from Nicolas Frattaroli <frattaroli.nicolas@gmail.com>:
Hello,

this is version 5 of the I2S/TDM driver patchset. A big thanks
to everyone who has provided their valuable feedback so far.

Changes in v5:
 driver:
 - change comment style of the first comment to C++ style
 - make refcount non-atomic, as it's only ever used inside
   a spinlock
 - use newer SND_SOC_DAIFMT_CB* defines
 - change ternary statements to if/else conditions
 - make _clk_compensation_put return 1 if clock changed
 - implement set_bclk_ratio callback
 - always set half frame sync mode in TDM mode
 - automatically enable mclk-calibrate mode when the clocks for
   it are specified in the device tree
 bindings:
 - add Reviewed-by: Rob Herring
 - drop rockchip,frame-width property (done by set_bclk_ratio)
 - drop rockchip,fsync-half-frame property
 - drop rockchip,mclk-calibrate property
 dts:
 - drop empty codec block from Quartz64 device tree

Changes in v4:
 driver:
 - factor TDE/RDE enable/disable into their own inlined functions
 - add an RDE disable in a location where it looks like it was
   forgotten (rxctrl else), judging by corresponding TDE code
 - remove parentheses around CLK_PPM_MIN/MAX values
 - wording + titlecasing in the clock compensation control
 - use if statement in precious_reg instead
 - refactor rockchip_i2s_io_multiplex to have the switch statements
   in a function call to make the function less unwieldy
 - get rid of IS_ERR checks around clk enable/disable calls where
   already checked before by the probe
 - reworded some error message strings
 - fix potential deadlock in txrxctrl found by Sugar Zhang
   using spin_lock_irqsave
 - fix potential deadlock in trcm_mode found by Sugar Zhang
   using spin_lock_irqsave
 - use devm_platform_get_and_ioremap_resource in probe
 - only set DMA things if controller has capture/playback ability.
   Did not move this into init_dai because I'd then need to pass in
   the res and probe it earlier in the function, and it's also used
   elsewhere in the probe function
 - use _get_optional_exclusive for reset controls, as some controllers
   only have capture or playback capability
 bindings:
 - remove status = "okay" since that's the default
 - change the path configs to be an enum
 - rename "foo" to "bus"
 - make resets optional as controller may lack either playback or
   capture capability, and therefore also doesn't have a reset.
   At least one reset is still required, because a controller with
   no playback and no capture is not very useful

Changes in v3:
 driver:
 - alphabetically sort includes
 - check pm_runtime_get_sync return value, act on it
 - remove unnecessary initialisers in set_fmt
 - use udelay(15) in retry code: 10 retries * 15 = 150, so at worst
   we wait the full i2s register access delay
 - fix some weird returns to return directly
 - use __maybe_unused instead of #ifdef CONFIG_PM_SLEEP, also put
   __maybe_unused on the runtime callbacks
 - use (foo) instead of foo in header macros for precedence reasons
 - when using mclk-calibrate, also turn off/on those clocks during
   suspend and resume operations
 - remove mclk_tx and mclk_rx reenablement code in remove
 - move hclk enablement further down the probe, and disable it
   on probe failure
 - make reset controls mandatory, since the bindings state this too
 - use _exclusive for getting the reset controls
 - change reset assert/deassert delays to both be 10 usec
   (thank you Sugar Zhang!)
 - properly prepare and enable all mclks in probe, especially before
   calling clk_get_rate on them
 - if registering PCM fails, also use the cleanup error path instead of
   returning directly
 - bring back playback and capture only but in the way Sugar Zhang
   suggested it: set those modes depending on dma-names
 - rework clock enablement in general. Probe now always enables these,
   instead of relying on the pm resume thing
 - add myself to MAINTAINERS for this driver
 dt bindings:
 - fix a description still mentioning clk-trcm in the schema
 - document rockchip,io-multiplex, a property that describes the
   hardware as having multiplexed I2S GPIOs so direction needs to
   be changed dynamically
 - document rockchip,mclk-calibrate, which allows specifying
   different clocks for the two sample rate bases and switch between
   them as needed
 - dma-names now doesn't have a set order and items can be absent to
   indicate that the controller doesn't support this mode
 - add myself to MAINTAINERS for these bindings

Changes in v2:
 - remove ad-hoc writeq and needless (and broken) optimisation in
   reset assert/deassert. This wouldn't have worked on Big Endian,
   and would've been pointless on any other platform, as the
   overhead for saving one write was comparatively big
 - fix various checkpatch issues
 - get rid of leftover clk-trcm in schema
 - set status = "okay" in example in schema instead of "disabled"
 - change dma-names so rx is first, adjust device trees as necessary
 - properly reference uint32-array for rx-route and tx-route
   instead of uint32
 - replace trcm-sync with two boolean properties, adjust DT changes
   accordingly and also get rid of the header file
 - get rid of rockchip,no-dmaengine. This was only needed for
   some downstream driver and shouldn't be in the DT
 - get rid of rockchip,capture-only/playback-only. Rationale being
   that I have no way to test whether they're needed, and
   unconditionally setting channels_min to 0 breaks everything
 - change hclk description in "clocks"

Nicolas Frattaroli (4):
  ASoC: rockchip: add support for i2s-tdm controller
  ASoC: dt-bindings: rockchip: add i2s-tdm bindings
  arm64: dts: rockchip: add i2s1 on rk356x
  arm64: dts: rockchip: add analog audio on Quartz64

 .../bindings/sound/rockchip,i2s-tdm.yaml      |  198 ++
 MAINTAINERS                                   |    7 +
 .../boot/dts/rockchip/rk3566-quartz64-a.dts   |   31 +-
 arch/arm64/boot/dts/rockchip/rk356x.dtsi      |   26 +
 sound/soc/rockchip/Kconfig                    |   11 +
 sound/soc/rockchip/Makefile                   |    2 +
 sound/soc/rockchip/rockchip_i2s_tdm.c         | 1848 +++++++++++++++++
 sound/soc/rockchip/rockchip_i2s_tdm.h         |  398 ++++
 8 files changed, 2520 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml
 create mode 100644 sound/soc/rockchip/rockchip_i2s_tdm.c
 create mode 100644 sound/soc/rockchip/rockchip_i2s_tdm.h

--
2.33.0
2021-10-07 22:24:55 +01:00
Pierre-Louis Bossart
9609cfcda0
ASoC: soc-pcm: restore mixer functionality
Recent changes in soc-pcm completely broke basic support for mixers on
Intel systems: the filters on BE states prevent the connection of a
second mixer input while the back-end is already active.

Rather than reverting the changes, which would be problematic for
Tegra systems, this patch suggests an additional filter which will
only apply to Tegra systems. This is a temporary solution which will
have to be revisited - additional issues have been reported with DPCM.

Fixes: 0c25db3f76 ('ASoC: soc-pcm: Don't reconnect an already active BE')
Suggested-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212141.193136-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 19:20:00 +01:00
Derek Fang
06096537b7
ASoC: rt5682s: Fix hp pop produced immediately after resuming
When the system plays a sound immediately after resuming from S3,
it could hear a little pop from headphones.
It is due to the HP was unmuted before the completion of
jack re-detection finished in parallel.

This patch adds a lock to make sure the HP unmute after jack detect handler,
and adds a few depop changes.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211007085519.12543-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 19:19:58 +01:00
Nicolas Frattaroli
081068fd64
ASoC: rockchip: add support for i2s-tdm controller
This commit adds support for the rockchip i2s-tdm controller,
which enables audio output on the following rockchip SoCs:
- px30
- rk1808
- rk3308
- rk3566
- rk3568
- rv1126

This is a cleaned up version of the downstream vendor kernel's
driver. It can be enabled through the SND_SOC_ROCKCHIP_I2S_TDM
configuration option.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211001171531.178775-2-frattaroli.nicolas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 16:58:16 +01:00
Daniel Baluta
858f7a5c45
ASoC: SOF: Introduce fragment elapsed notification API
This patch prepares the introduction of the compress API with SOF.

After each fragment is accepted by the DSP we need to inform
the userspace applications that they can send the next fragment.
This is done via snd_compr_fragment_elapsed.

Similar with the PCM case, in order to avoid sending an IPC before
the previous IPC is handled we need to schedule a delayed work to
call snd_compr_fragment_elapsed().

See snd_sof_pcm_period_elapsed.

To sum up this patch offers the following API to SOF code:
	* snd_sof_compr_init_elapsed_work
	* snd_sof_compr_fragment_elapsed

Note that implementation for compressed function is in a new file
selected via CONFIG_SND_SOC_SOF_COMPRESS invisible config option.
This option is automatically selected for platforms that support
the compress interface. For now only i.MX8 platforms support this.

For symmetry we introduce snd_sof_pcm_init_elapsed_work to setup
the work struct for PCM case.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 16:57:57 +01:00
Daniel Baluta
40834190aa
ASoC: SOF: imx: Use newly introduced generic IPC stream ops
This makes IMX use the newly introduced generic IPC ops
instead of imx specific ones, and removes the old IMX
ipc ops, as they are no longer needed.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 16:57:56 +01:00
Bud Liviu-Alexandru
97e22cbd0d
ASoC: SOF: Make Intel IPC stream ops generic
This operations should be generic as there is nothing Intel
specific. This works well for NXP i.MX8 stream IPC ops.

We start by moving sof/intel/intel-ipc.c into sof/stream-ipc.c and
rename the functions to be generic.

Notice that we use newly introduced snd_sof_dsp_mailbox_read
instead of sof_mailbox_read, to make sure that we are not
bound to existing MMIO memory access, and we allow platform
to implement their own memory access routines.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 16:57:54 +01:00
Daniel Baluta
f71f59dd45
ASoC: SOF: Introduce snd_sof_mailbox_read / snd_sof_mailbox_write callbacks
We need to introduce snd_sof_mailbox_{read/write} in order to provide
a generic way for mailbox access. These routines are optional, each
platform can implement their own specific routines.

So far, all platforms use mmapped I/O thus they can use custom made
routines sof_mailbox_read / sof_mailbox_write that use MMIO.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 16:57:53 +01:00
Peter Ujfalusi
d8a15e5fca
ASoC: SOF: pipelines: Harmonize all functions to use struct snd_sof_dev
First thing the pipelines function which have "struct device *dev" as
parameter do is:
struct snd_sof_dev *sdev = dev_get_drvdata(dev);

and in all cases the passed dev is actually coming from sdev->dev.

Skip this steps and pass directly the sdev to all pipelines related
functions as few of them already does this.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006111651.10027-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:45 +01:00
Ranjani Sridharan
ec626334ea
ASoC: SOF: topology: do not power down primary core during topology removal
When removing the topology components, do not power down
the primary core. Doing so will result in an IPC timeout
when the SOF PCI device runtime suspends.

Fixes: 0dcdf84289 ("ASoC: SOF: add a "core" parameter to widget loading functions")

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211006104041.27183-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:44 +01:00
Peter Ujfalusi
3ad7b8f481
ASoC: SOF: Intel: hda: Dump registers and stack when SOF_DBG_DUMP_REGS is set
Instead of checking the fw_state to decide what information should be
printed, use the SOF_DBG_DUMP_REGS bit in the flags to dump registers and
stack.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-20-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:41 +01:00
Peter Ujfalusi
7511b0edf1
ASoC: SOF: Intel: hda-loader: Drop SOF_DBG_DUMP_REGS flag from dbg_dump calls
In cl_dsp_init() we are powering up the DSP, register dump is not valid.
In hda_dsp_cl_boot_firmware() we are downloading the firmware to DSP, again
the register dump is not a valid concept.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-19-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:40 +01:00
Peter Ujfalusi
f8c3ec4368
ASoC: SOF: loader: Drop SOF_DBG_DUMP_REGS flag when firmware start fails
snd_sof_dsp_run() failure indicates that the DSP did not even booted up,
thus asking for dumping registers at this point is not valid.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-18-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:39 +01:00
Peter Ujfalusi
e51838909b
ASoC: SOF: core: Clean up snd_sof_get_status() prints
Clean up the error prints when decoding the status in snd_sof_get_status():
Drop the "error:" prefixes from the prints,
Use %# to print hexadecimal numbers,
Reword some of the messages to be more precise,
For a known error print out the panic code as well,
For unknown error print only the panic code without the magic

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20211006110645.26679-17-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:38 +01:00
Peter Ujfalusi
4fade25dfb
ASoC: SOF: intel: hda: Drop 'error' prefix from error dump functions
Drop the 'error' prefix printed in hda_dsp_dump_ext_rom_status(),
hda_ipc_irq_dump() and hda_ipc_dump() as it gives no value to the
information we print.

The DSP and IPC dump is marked now, which makes the 'error' prefix more
redundant.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20211006110645.26679-16-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:37 +01:00
Peter Ujfalusi
58a5c9a4aa
ASoC: SOF: Introduce macro to set the firmware state
Add sof_set_fw_state() macro to wrap the sdev->fw_state management to allow
actions to be taken when certain state is set or when state is changing.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20211006110645.26679-15-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:36 +01:00
Peter Ujfalusi
705f4539c4
ASoC: SOF: ops: Force DSP panic dumps to be printed
If a DSP panic happens we want to see the dumps.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20211006110645.26679-14-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:35 +01:00
Peter Ujfalusi
e6ff3db9ef
ASoC: SOF: ipc: Re-enable dumps after successful IPC tx
The dumps are silenced after an IPC tx timeout by default.
The IPC timeout can indicate severe error (firmware crash) or in some cases
it is less devastating and the firmware remains operational, the timeout
was due to a scheduling spike or other anomaly.

In any case consequent IPC timeouts will not print dumps but if any IPC do
succeed than we should re-enable the dumps to print dumps the next time
a timeout might happen.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20211006110645.26679-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:34 +01:00
Peter Ujfalusi
c05ec07143
ASoC: SOF: debug: Print out the fw_state along with the DSP dump
The fw state can be an important information along with the DSP dump.
Print it out before the dump.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20211006110645.26679-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:33 +01:00
Peter Ujfalusi
23013335bc
ASoC: SOF: Drop SOF_DBG_DUMP_FORCE_ERR_LEVEL and sof_dev_dbg_or_err
The sof_dev_dbg_or_err() is only used by intel/hda.c when dumping dsp
debug information.
It was used to print the extended rom status in either dev_dbg (during
retries) and finally with dev_err, but other lines were printed with
dev_err regardless.

Since we now only print the dump once, the flag and the macros is no longer
needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:31 +01:00
Peter Ujfalusi
0ecaa2fff2
ASoC: SOF: intel: hda-loader: Use snd_sof_dsp_dbg_dump() for DSP dump
Do not call directly the hda_dsp_dump(), use the generic wrapper instead
to provide consistent output.

Mark the DSP dumps as optional to not spam the kernel log with the
exception of the last dump in case the DSP fails to run.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:30 +01:00
Peter Ujfalusi
34346a383d
ASoC: SOF: debug: Add SOF_DBG_DUMP_OPTIONAL flag for DSP dumping
The new SOF_DBG_DUMP_OPTIONAL flag can be used to mark a DSP dump that
should only be printed when the SOF_DBG_PRINT_ALL_DUMPS sof_core_debug
flag is set, otherwise it should be ignored and not printed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:29 +01:00
Peter Ujfalusi
360fa3234e
ASoC: SOF: debug/ops: Move the IPC and DSP dump functions out from the header
To be usable in platform code, move the IPC and DSP dump function to
debug.c and export it in a similar way as the snd_sof_handle_fw_exception()

Make the snd_sof_ipc_dump() static as it is only used in debug.c

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:28 +01:00
Peter Ujfalusi
e131bc5886
ASoC: SOF: intel: atom: No need to do a DSP dump in atom_run()
The core already prints a dump if the DSP failed to start in
snd_sof_run_firmware(), there is no need to print it locally as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:27 +01:00
Peter Ujfalusi
247ac64073
ASoC: SOF: loader: Print the DSP dump if boot fails
It can be useful to print the DSP dump from the core in case the DSP boot
failed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:26 +01:00
Peter Ujfalusi
9ff90859b9
ASoC: SOF: Print the dbg_dump and ipc_dump once to reduce kernel log noise
Do not print the dump more than once to keep the kernel log cleaner in case
of a firmware failure.

When the DSP is rebooted due to suspend or runtime_suspend reset the flags
to re-enable the dump prints.

Add also a debug flag to print all dumps to get more coverage if needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:25 +01:00
Peter Ujfalusi
3f7561f741
ASoC: SOF: ipc and dsp dump: Add markers for better visibility
Add markers to identify the start and end of the IPC and DSP dumps in the
kernel log.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:24 +01:00
Peter Ujfalusi
e85c26eca6
ASoC: SOF: debug: Swap the dsp_dump and ipc_dump sequence for fw_exception
snd_sof_dsp_panic() only prints dsp_dump followed by flushing the DMA trace
buffer.

To retain similar 'sequence' first do an ipc_dump then the dsp_dump and
finally flush the trace buffer in case of fw_exception.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:22 +01:00
Pierre-Louis Bossart
1539c8c5fc
ASoC: SOF: core: debug: force all processing on primary core
The topology file currently provides information on which
pipeline/processing is to be scheduled on which DSP core.

To help diagnose potential issues, this patch provides an override of
the 'core' tokens to use the primary core (typically core0). Of course
this may result in a Core0 activity that exceeds hardware
capabilities, so this should only be used when the total processing
fits on DSP - possibly using firmware mockup processing and stubs.

No new dmesg log was added to avoid adding noise during topology
parsing, but the existing logs will show the primary core being used.

This is strictly for validation/debug, products should NEVER use this
override, the topology is assumed to be the description of the
firmware graph.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:21 +01:00
Alejandro Tafalla
4d67dc1998
ASoC: max98927: Handle reset gpio when probing i2c
The max98927 codec on some devices requires pulling a reset gpio before
responding to any i2c command. This commit adds support for it through
an optional reset-gpios property.

Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
Link: https://lore.kernel.org/r/d74b12a79ae9ca728d5d9e64c55b3e59e8c0e509.1633572679.git.atafalla@dnyon.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:18 +01:00
Mark Brown
dc1fad25bb
Merge series "ASoC: Intel: machine driver updates for 5.16" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
One quirk for a Dell TigerLake/SoundWire device, and initial support
for platforms based on the ES8336 codec (aka ES8316). For full
functionality, an update of the codec driver will be needed.

Pierre-Louis Bossart (5):
  ASoC: Intel: soc-acpi: apl/glk/tgl: add entry for devices based on
    ES8336 codec
  ALSA: intel-dsp-config: add quirk for APL/GLK/TGL devices based on
    ES8336 codec
  ASoC: Intel: add machine driver for SOF+ES8336
  ASoC: Intel: soc-acpi: add missing quirk for TGL SDCA single amp
  ASoC: Intel: sof_sdw: add missing quirk for Dell SKU 0A45

 sound/hda/intel-dsp-config.c                  |  22 +-
 sound/soc/intel/boards/Kconfig                |  14 +
 sound/soc/intel/boards/Makefile               |   2 +
 sound/soc/intel/boards/sof_es8336.c           | 569 ++++++++++++++++++
 sound/soc/intel/boards/sof_sdw.c              |  10 +
 .../intel/common/soc-acpi-intel-bxt-match.c   |   6 +
 .../intel/common/soc-acpi-intel-glk-match.c   |   7 +-
 .../intel/common/soc-acpi-intel-tgl-match.c   |  47 ++
 8 files changed, 674 insertions(+), 3 deletions(-)
 create mode 100644 sound/soc/intel/boards/sof_es8336.c

--
2.25.1
2021-10-05 16:25:24 +01:00
Mark Brown
6d0c1f787c
Merge series "ASoC: SOF: Intel: add flags to turn on SSP clocks early" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
With the chip shortage, some GeminiLake Intel-based designs were
respun and now rely on codecs that need the SSP bit clock turned on in
the hw_params stage, not the trigger stage. This patchset mirrors the
flags added in the SOF DAI_CONFIG IPC, and sets the flags when this
capability is indicated as necessary in the topology files where the
SSP configuration is stored.

We initially considered a more generic solution with an on-demand SSP
clock activation using the common clock framework. This would be a
more elegant solution indeed, but it would have required more
intrusive changes that would conflict with the SOF multi-client
support (in-development), and more backport hassles on product
branches. The on-demand activation of clocks is still a desired
feature that will be enabled at a later point.

Bard Liao (1):
  ASoC: SOF: dai-intel: add SOF_DAI_INTEL_SSP_CLKCTRL_MCLK/BCLK_ES bits

Pierre-Louis Bossart (4):
  ASoC: SOF: dai: mirror group_id definition added in firmware
  ASoC: SOF: dai: include new flags for DAI_CONFIG
  ASoC: SOF: Intel: hda: add new flags for DAI_CONFIG
  ASoC: SOF: Intel: hda-dai: improve SSP DAI handling for dynamic
    pipelines

 include/sound/sof/dai-intel.h |  4 ++
 include/sound/sof/dai.h       | 10 ++++-
 sound/soc/sof/intel/hda-dai.c | 82 ++++++++++++++++++++++++++++++++++-
 sound/soc/sof/intel/hda.c     |  6 +++
 sound/soc/sof/sof-audio.c     |  4 ++
 5 files changed, 103 insertions(+), 3 deletions(-)

--
2.25.1
2021-10-05 16:25:23 +01:00
Mark Brown
84a96720f3
Merge series "ASoC: SOF: topology: minor updates" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Two patches to visualize settings and override dynamic pipelines + one
correction for errors on connections.

Pierre-Louis Bossart (2):
  ASoC: SOF: topology: show clks_control value in dynamic debug
  ASoC: SOF: topology: allow for dynamic pipelines override for debug

Ranjani Sridharan (1):
  ASoC: SOF: topology: return error if sof_connect_dai_widget() fails

 sound/soc/sof/sof-priv.h |  6 ++++++
 sound/soc/sof/topology.c | 24 +++++++++++++++---------
 2 files changed, 21 insertions(+), 9 deletions(-)

--
2.25.1
2021-10-05 16:25:22 +01:00
Daniel Baluta
7b84fd262d
ASoC: SOF: OF: Add fw_path and tplg_path parameters
This allows specifying an alternate path for SOF firmware or
SOF topology.

This is particularly useful for i.MX when running Linux vs Android.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.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/20211005071949.1277613-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:59 +01:00
Rikard Falkeborn
d54aa2aeaa
ASoC: amd: acp-rt5645: Constify static snd_soc_ops
The struct cz_aif1_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211004224514.8783-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:58 +01:00
Ranjani Sridharan
4a23076987
ASoC: SOF: topology: return error if sof_connect_dai_widget() fails
Return the error if sof_connect_dai_widget() fails to
abort topology loading and prevent card registration.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:56 +01:00
Pierre-Louis Bossart
ea6bfbbe3e
ASoC: SOF: topology: allow for dynamic pipelines override for debug
For debug and community support, it's useful to expose a kernel
parameter to prevent the use of dynamic pipelines exposed in a
topology file, or conversely to force an existing topology to use
dynamic pipelines.

Add an override bit and an enable bit which is valid only when the
override is set.

For products, the intent is that the topology file defines the
behavior, these two bits are only intended for diagnosis and
performance checks.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:55 +01:00
Pierre-Louis Bossart
cf9f3fffae
ASoC: SOF: topology: show clks_control value in dynamic debug
We log most of the SSP configurations except the clks_control. This
will be used to enable bclk/mclk early start so it's useful to show
the information to the user.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:54 +01:00
Pierre-Louis Bossart
84e3cfd16a
ASoC: SOF: Intel: hda-dai: improve SSP DAI handling for dynamic pipelines
In order to keep the widget use_count balanced, make sure the DAI
widgets are allocated once in hw_params and released in hw_free. A
'setup' status flag is used to deal with cases where the .hw_params
callback is invoked multiple times, and likewise with cases where
hw_free is invoked without hw_params being called first (which can
happen if the FE hw_params fails).

In addition, this patch frees the widgets in the suspend transition,
and reallocates them in the .prepare callback. The 'setup' flag helps
in this case differentiate between resume (setup needed) and
xruns (setup not needed).

This balanced operation was not needed previously but will be required
when SOF dynamic pipelines are enabled.

Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004171430.103674-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:08:14 +01:00
Pierre-Louis Bossart
b30b60a26a
ASoC: SOF: Intel: hda: add new flags for DAI_CONFIG
The DAI_CONFIG is used for both hw_params and hw_free. Use flags to
specify what stage the configuration applies to.

the DAI_CONFIG IPC may be sent also during the widget setup so each
flag is cleared after the IPC to restore the state.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211004171430.103674-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:08:12 +01:00
Pierre-Louis Bossart
64ba6d2ce7
ASoC: Intel: sof_sdw: add missing quirk for Dell SKU 0A45
This device is based on SDCA codecs but with a single amplifier
instead of two.

BugLink: https://github.com/thesofproject/linux/issues/3161
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Link: https://lore.kernel.org/r/20211004213512.220836-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:06:03 +01:00
Pierre-Louis Bossart
f2470679b0
ASoC: Intel: soc-acpi: add missing quirk for TGL SDCA single amp
We don't have a configuration for a single amp on link1.

BugLink: https://github.com/thesofproject/linux/issues/3161
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Link: https://lore.kernel.org/r/20211004213512.220836-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:06:02 +01:00
Pierre-Louis Bossart
a164137ce9
ASoC: Intel: add machine driver for SOF+ES8336
Add machine driver to support APL/GLK/TGL platforms.
The TGL platform supports DMIC, APL and GLK do not.

Co-developed-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Huajun Li <huajun.li@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/20211004213512.220836-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:06:00 +01:00
Pierre-Louis Bossart
9d36ceab94
ALSA: intel-dsp-config: add quirk for APL/GLK/TGL devices based on ES8336 codec
These devices are based on an I2C/I2S device, we need to force the use
of the SOF driver otherwise the legacy HDaudio driver will be loaded -
only HDMI will be supported.

Co-developed-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Huajun Li <huajun.li@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/20211004213512.220836-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:05:58 +01:00
Pierre-Louis Bossart
790049fb66
ASoC: Intel: soc-acpi: apl/glk/tgl: add entry for devices based on ES8336 codec
A number of devices, such as the "Chuwi HI10x" and "UNIQCELL Q15.6",
are based on APL/GLK with an I2C/I2S ES8336 codec.

Add table to find topology and firmware files.

Co-developed-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Huajun Li <huajun.li@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/20211004213512.220836-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:05:56 +01:00
Hans de Goede
7924f1bc94
ASoC: Intel: cht_bsw_nau8824: Set card.components string
Set the card.components string using the new nau8824_components() helper
which returns a components string based on the DMI quirks inside the
nau8824 codec driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211002211459.110124-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04 15:55:30 +01:00
Hans de Goede
efee0fca19
ASoC: nau8824: Add a nau8824_components() helper
Some devices using the NAU8824 have only one speaker. To still have things
working properly this requires the left + right channels to both be mixed
to the left speaker output.

This mixer setup is done by userspace based on UCM profiles. But this
requires userspace to know that there is a mono-speaker. Add a helper
function (for the machine driver) to get a components string providing
this info.

This is done inside the codec driver because the codec driver already
has a DMI quirk table.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211002211459.110124-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04 15:55:29 +01:00