1. Oct 08, 2021
    • Andy Shevchenko's avatar
      ASoC: Intel: bytcht_es8316: Use temporary variable for struct device · e8ccf82b
      Andy Shevchenko authored
      
      
      Use temporary variable for struct device to make code neater.
      
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Message-Id: <20211007164523.27094-3-andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e8ccf82b
    • Andy Shevchenko's avatar
      ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata() · 5f6c1341
      Andy Shevchenko authored
      
      
      Access to platform data via dev_get_platdata() getter to make code cleaner.
      
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Message-Id: <20211007164523.27094-2-andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      5f6c1341
    • Mark Brown's avatar
      Merge series "Add reset-gpios handling for max98927" from Alejandro Tafalla <atafalla@dnyon.com>: · 06a0fc36
      Mark Brown authored
      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
      06a0fc36
    • Mark Brown's avatar
      Merge series "Introduce new SOF helpers" from Daniel Baluta <daniel.baluta@oss.nxp.com> · 99f11b65
      Mark Brown authored
      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
      99f11b65
    • Mark Brown's avatar
      Merge series "ASoC: SOF: Improvements for debugging" from Peter Ujfalusi... · 1cfd7c2e
      Mark Brown authored
      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
      1cfd7c2e
    • Mark Brown's avatar
      Merge series "Rockchip I2S/TDM controller" from Nicolas Frattaroli <frattaroli.nicolas@gmail.com>: · 43b05869
      Mark Brown authored
      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
      43b05869
    • Pierre-Louis Bossart's avatar
      ASoC: soc-pcm: restore mixer functionality · 9609cfcd
      Pierre-Louis Bossart authored
      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: 0c25db3f
      
       ('ASoC: soc-pcm: Don't reconnect an already active BE')
      Suggested-by: default avatarSameer Pujar <spujar@nvidia.com>
      Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
      Reviewed-by: default avatarPé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: default avatarMark Brown <broonie@kernel.org>
      9609cfcd
    • Derek Fang's avatar
      ASoC: rt5682s: Fix hp pop produced immediately after resuming · 06096537
      Derek Fang authored
      
      
      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: default avatarDerek Fang <derek.fang@realtek.com>
      Link: https://lore.kernel.org/r/20211007085519.12543-1-derek.fang@realtek.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      06096537
  2. Oct 07, 2021
  3. Oct 05, 2021
    • Mark Brown's avatar
      Merge series "ASoC: Intel: machine driver updates for 5.16" from Pierre-Louis... · dc1fad25
      Mark Brown authored
      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
      dc1fad25
    • Mark Brown's avatar
      Merge series "ASoC: SOF: Intel: add flags to turn on SSP clocks early" from... · 6d0c1f78
      Mark Brown authored
      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
      6d0c1f78
    • Mark Brown's avatar
      Merge series "ASoC: SOF: topology: minor updates" from Pierre-Louis Bossart... · 84a96720
      Mark Brown authored
      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
      84a96720