1. 21 Apr, 2024 3 commits
    • Luca Ceresoli's avatar
      ASoC: dapm-graph: new tool to visualize DAPM state · e7bb4389
      Luca Ceresoli authored
      Add a tool to generate a picture of the current DAPM state for a sound
      card.
      
      dapm-graph is inspired by vizdapm which used to be published on a Wolfson
      Micro git repository now disappeared, and has a few forks around:
      
        https://github.com/mihais/asoc-tools
        https://github.com/alexandrebelloni/asoc-tools
      
      dapm-graph is a full reimplementation with several improvements while still
      being a self-contained shell script:
      
      Improvements to rendered output:
       - shows the entire card, not one component hierarchy only
       - each component is rendered in a separate box
       - shows widget on/off status based on widget information alone (the
         original vizdapm propagates the "on" green colour to the first input
         widget)
       - use bold line and gray background and not only green/red line to show
         on/off status (for the color blind)
      
      Improvements for embedded system developers:
       - remote mode: get state of remote device (possibly with minimal rootfs)
         via SSH, but parsing locally for faster operation
       - compatible with BusyBox shell, not only bash
      
      Usability improvements:
       - flexible command line (uses getopts for parsing)
       - detailed help text
       - flag to enable detailed debug logging
       - graphviz output format detected from file extension, not hard coded
       - a self-contained shell script
      
      Usage is designed to be simple:
      
        dapm-grpah -c CARD                  - get state from debugfs for CARD
        dapm-grpah -c CARD -r REMOTE_TARGET - same, but remotely via SSH
        dapm-grpah -d STATE_DIR             - from a local copy of the debugfs
                                              tree for a card
      Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      Reviewed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Link: https://lore.kernel.org/r/20240416-vizdapm-ng-v1-3-5d33c0b57bc5@bootlin.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      e7bb4389
    • Luca Ceresoli's avatar
      ASoC: dapm: debugfs: show the widget type · 5b1047dc
      Luca Ceresoli authored
      To make the widget debugfs files more informative, add a line showing the
      widget type string.
      
      Keeping backward compatibility is nice to have being debugfs, and ease of
      parsing by both humans and software is also good. To maximize both with a
      reasonable effort add a new line without thouching the already complex
      format of the first line. The syntax is meant to be a key/value pair.
      
      The existing vizdapm tool continues working after this change, ignoring the
      new line.
      
      The new format is:
      
        Left ADC: Off  in 1 out 0 - R2(0x2) mask 0x2
         stream Left HiFi Capture inactive
         widget-type adc
         out  "static" "Capture" "cs42l51.0-004a"
         in  "static" "Left PGA" "cs42l51.0-004a"
      Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      Reviewed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Link: https://lore.kernel.org/r/20240416-vizdapm-ng-v1-2-5d33c0b57bc5@bootlin.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      5b1047dc
    • Luca Ceresoli's avatar
      ASoC: dapm: debugfs: add component to route lines · cbd9eed8
      Luca Ceresoli authored
      debugfs entries for DAPM widgets have the following form:
      
        Left ADC: Off  in 1 out 0 - R2(0x2) mask 0x2
         stream Left HiFi Capture inactive
         out  "static" "Capture"
         in  "static" "Left PGA"
      
      Lines with the "in" and "out" prefixes describe routes from/to other
      widgets presenting the path name and the connected widget name.
      
      This is ambiguous in case of cards having multiple widgets with the same
      name in different components. For example the STM32MP157A-DK1 board
      (arch/arm/boot/dts/st/stm32mp15xx-dkx.dtsi) has a "Capture" widget in both
      the "cs42l51.0-004a" and the "hdmi-audio-codec.1.auto" components.
      
      Avoid the ambiguity by adding the component name to the "in" and "out"
      lines. Add the new field at the end to minimize backward compatibility
      issues. The existing vizdapm tool continues working after this change.
      
      The output becomes:
      
        Left ADC: Off  in 1 out 0 - R2(0x2) mask 0x2
         stream Left HiFi Capture inactive
         out  "static" "Capture" "cs42l51.0-004a"
         in  "static" "Left PGA" "cs42l51.0-004a"
      Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      Reviewed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Link: https://lore.kernel.org/r/20240416-vizdapm-ng-v1-1-5d33c0b57bc5@bootlin.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      cbd9eed8
  2. 20 Apr, 2024 1 commit
    • Mark Brown's avatar
      ASoC: Intel: avs: Refactor IRQ handling · 27a153e0
      Mark Brown authored
      Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:
      
      The existing code can be both improved and simplified. To make this
      change easier to manage, first add new implementation and then remove
      deadcode in a separate patch.
      
      Simplification achieved with:
      
      - reduce the amount of resources requested by the driver i.e.: IPC and
        CLDMA request_irq() merged into one
      - reduce the number of DSP ops from 2 to 1:
        irq_handler/thread() vs dsp_interrupt()
      - drop ambiguity around CLDMA interrupt, let skl.c handle that
        explicitly as it is the only user
      
      With that done, switch to the new implementation and remove unused
      members. While the change is non-trivial, from functional perspective
      status quo is achieved.
      27a153e0
  3. 19 Apr, 2024 3 commits
  4. 17 Apr, 2024 4 commits
    • John Watts's avatar
      ASoC: sunxi: sun4i-i2s: Fix pcm_formats type specification · 9be51470
      John Watts authored
      pcm_formats should be a u64 as it is a SNDRV_PCM_FMTBIT_* not a
      SNDRV_PCM_FORMAT_*.
      
      Also fix a small grammar error while we're here.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202404170103.ySYwieqi-lkp@intel.com/Signed-off-by: default avatarJohn Watts <contact@jookia.org>
      Link: https://lore.kernel.org/r/20240417-sunxi_s32_fix-v1-1-d82e451565c0@jookia.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      9be51470
    • Frank Li's avatar
      ASoC: dt-bindings: fsl-esai: Add ref: dai-common.yaml · 9aea6d64
      Frank Li authored
      Add ref: dai-common.yaml to fix below warning.
      arch/arm/boot/dts/nxp/imx/imx6q-sabreauto.dtb: esai@2024000: Unevaluated properties are not allowed ('#sound-dai-cells' was unexpected)
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarFrank Li <Frank.Li@nxp.com>
      Link: https://lore.kernel.org/r/20240416-esai_arm_dts_warning-v2-2-879e59c0c3b8@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      9aea6d64
    • Frank Li's avatar
      ASoC: dt-bindings: fsl-esai: Remove 'fsl,*' from required list · 5894ff6c
      Frank Li authored
      fsl,fifo-depth have default value 64 in driver(sound/soc/fsl/fsl_esai.c).
      
      fsl,esai-synchronous is flag(bool) type. It doesn't make sense to put flag
      type into 'required'.
      
      Fix warning:
      
      arch/arm/boot/dts/nxp/imx/imx6q-sabreauto.dtb: esai@2024000: 'fsl,fifo-depth' is a required property
      arch/arm/boot/dts/nxp/imx/imx6q-sabreauto.dtb: esai@2024000: 'fsl,esai-synchronous' is a required property
      Signed-off-by: default avatarFrank Li <Frank.Li@nxp.com>
      Link: https://lore.kernel.org/r/20240416-esai_arm_dts_warning-v2-1-879e59c0c3b8@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      5894ff6c
    • Mark Brown's avatar
      ASoC: Cleanup MediaTek soundcard machine drivers · 4b73a4cd
      Mark Brown authored
      Merge series from AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:
      
      Changes in v5:
       - Cleaned up MT8186 soundcard migration commit which erroneously
         had leftovers from development
       - Changed the mtk_pcm_constraints_data structure to hold pointers
         to snd_pcm_hw_constraint_list, as to really reuse the const data
       - Tested again on all of the listed MTK platforms.
      
      Changes in v4:
       - Rebased over next-20240409
       - Dropped the first 4 patches from v3 as were already picked by Mark
       - Fixed W=1 build issue
      
      Changes in v3:
       - Added audio-routing names in enum in all yaml files
       - Added mention of disallowing old and new properties together in
         commit message of bindings patches
       - Fixed validation errors with sound-card-common.yaml inclusion
         due to missing model property in examples
       - Removed `else` enforcing headset-codec/speaker-codecs requirement
         if xxx-dai-link not present to avoid future commit noise as the
         deprecated statement will disallow deprecated properties as required
      
      Changes in v2:
       - Bindings: Changed link-name/codec/clk-provider to remove `items`
         and leave just the enum
       - Moved .*-dai-link pattern additionalProperties after `type: object`
       - Added ref to sound-card-common.yaml
       - Fixed dai-link-xxx -> xxx-dai-link typo in example comment
      
      This series performs a cleanup of most of the MediaTek AFE drivers and
      soundcard machine drivers, reducing code duplication and setting a base
      to be consistent with their devicetree bindings, as many of those are
      using different properties and nodes for no good reason.
      
      Summarizing:
       - Commonizes functions and ops where possible
       - Adds a common probe mechanism, increasing maintainability of
         soundcard drivers for older MediaTek SoCs
       - Migrates all drivers to support the new bindings
         - Obviously retains compatibility with old device trees
       - Reduces machine-specific parameters hardcoding in drivers
         - Can now set machine-specific params in device tree
         - Uses the `audio-routing` and `dai-link` nodes like some
           other non-MediaTek SoC sound drivers
       - Imposes consistency between MediaTek ASoC machine soundcard
         drivers bindings
       - Reduces code size and greatly reduces the amount of code that
         will be required for newer drivers (retaining compatibility with
         the old bindings was costly in terms of code size, otherwise
         this series would've removed ~1000 more lines, or something
         along that line).
      
      This series was (manually) tested on MT8173, MT8192, MT8195 and MT8186
      Chromebooks.
      
      AngeloGioacchino Del Regno (18):
        ASoC: mediatek: Add common machine soundcard driver probe mechanism
        ASoC: mediatek: common: Constify struct mtk_sof_priv
        ASoC: mediatek: mt8188: Migrate to mtk_soundcard_common_probe
        ASoC: mediatek: mt8195: Migrate to mtk_soundcard_common_probe
        ASoC: mediatek: mt8192: Migrate to mtk_soundcard_common_probe
        ASoC: mediatek: mt8186: Migrate to mtk_soundcard_common_probe
        ASoC: mediatek: Add common snd_soc_ops .startup() callback
        ASoC: mediatek: mt8195: Migrate to the common mtk_soundcard_startup
        ASoC: mediatek: mt8192: Migrate to the common mtk_soundcard_startup
        ASoC: mediatek: mt8186-rt1019: Migrate to the common
          mtk_soundcard_startup
        ASoC: mediatek: Add common mtk_afe_component_probe callback
        ASoC: mediatek: Use common mtk_afe_pcm_platform with common probe cb
        ASoC: mediatek: mt8186: Unify mt8186-mt6366 machine drivers
        ASoC: dt-bindings: mt8195: Document audio-routing and dai-link subnode
        ASoC: dt-bindings: mt8192: Document audio-routing and dai-link subnode
        ASoC: dt-bindings: mt8186: Document audio-routing and dai-link subnode
        arm64: dts: mediatek: mt8195-cherry: Specify sound DAI links and
          routing
        arm64: dts: mediatek: mt8186-corsola: Specify sound DAI links and
          routing
      
       .../sound/mt8186-mt6366-da7219-max98357.yaml  |  131 +-
       .../sound/mt8186-mt6366-rt1019-rt5682s.yaml   |  120 +-
       .../sound/mt8192-mt6359-rt1015-rt5682.yaml    |  139 +-
       .../bindings/sound/mt8195-mt6359.yaml         |  134 ++
       .../boot/dts/mediatek/mt8186-corsola.dtsi     |   42 +-
       .../boot/dts/mediatek/mt8195-cherry.dtsi      |   45 +
       sound/soc/mediatek/Kconfig                    |   24 +-
       .../mediatek/common/mtk-afe-platform-driver.c |   18 +
       .../soc/mediatek/common/mtk-dsp-sof-common.c  |   15 +-
       .../soc/mediatek/common/mtk-dsp-sof-common.h  |    1 -
       sound/soc/mediatek/common/mtk-soc-card.h      |    7 +-
       .../mediatek/common/mtk-soundcard-driver.c    |  199 +++
       .../mediatek/common/mtk-soundcard-driver.h    |   42 +
       sound/soc/mediatek/mt6797/mt6797-afe-pcm.c    |   14 +-
       sound/soc/mediatek/mt7986/mt7986-afe-pcm.c    |   14 +-
       sound/soc/mediatek/mt8183/mt8183-afe-pcm.c    |   14 +-
       sound/soc/mediatek/mt8186/Makefile            |    3 +-
       .../mt8186/mt8186-mt6366-da7219-max98357.c    | 1189 -----------------
       ...t6366-rt1019-rt5682s.c => mt8186-mt6366.c} |  578 ++++----
       sound/soc/mediatek/mt8188/mt8188-afe-pcm.c    |   21 +-
       sound/soc/mediatek/mt8188/mt8188-mt6359.c     |  203 +--
       sound/soc/mediatek/mt8192/mt8192-afe-pcm.c    |   25 +-
       .../mt8192/mt8192-mt6359-rt1015-rt5682.c      |  301 ++---
       sound/soc/mediatek/mt8195/mt8195-afe-pcm.c    |   21 +-
       sound/soc/mediatek/mt8195/mt8195-mt6359.c     |  487 +++----
       25 files changed, 1597 insertions(+), 2190 deletions(-)
       delete mode 100644 sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
       rename sound/soc/mediatek/mt8186/{mt8186-mt6366-rt1019-rt5682s.c => mt8186-mt6366.c} (72%)
      
      --
      2.44.0
      4b73a4cd
  5. 16 Apr, 2024 17 commits
  6. 15 Apr, 2024 8 commits
  7. 14 Apr, 2024 4 commits