20 Jan, 2021

2 commits

  • commit a84dfb3d55934253de6aed38ad75990278a2d21e upstream.

    The signal captured on from tdm decoder of the AXG SoC is incorrect. It
    appears amplified. The skew offset of the decoder is wrong.

    Setting the skew offset to 3, like the g12 and sm1 SoCs, solves and gives
    correct data.

    Fixes: 13a22e6a98f8 ("ASoC: meson: add tdm input driver")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20201217150834.3247526-1-jbrunet@baylibre.com
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Jerome Brunet
     
  • commit 671ee4db952449acde126965bf76817a3159040d upstream.

    When the axg-tdm-interface was introduced, the backend DAI was marked as an
    endpoint when DPCM was walking the DAPM graph to find a its BE.

    It is no longer the case since this
    commit 8dd26dff00c0 ("ASoC: dapm: Fix handling of custom_stop_condition on DAPM graph walks")
    Because of this, when DPCM finds a BE it does everything it needs on the
    DAIs but it won't power up the widgets between the FE and the BE if there
    is no actual endpoint after the BE.

    On meson-axg HWs, the loopback is a special DAI of the tdm-interface BE.
    It is only linked to the dummy codec since there no actual HW after it.
    >From the DAPM perspective, the DAI has no endpoint. Because of this, the TDM
    decoder, which is a widget between the FE and BE is not powered up.

    >From the user perspective, everything seems fine but no data is produced.

    Connecting the Loopback DAI to a dummy DAPM endpoint solves the problem.

    Fixes: 8dd26dff00c0 ("ASoC: dapm: Fix handling of custom_stop_condition on DAPM graph walks")
    Cc: Charles Keepax
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20201217150812.3247405-1-jbrunet@baylibre.com
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Jerome Brunet
     

30 Dec, 2020

1 commit

  • [ Upstream commit 299fe9937dbd1a4d9a1da6a2b6f222298534ca57 ]

    When compiled with CONFIG_HAVE_CLK, the kernel need to get provider for the
    clock API. This is usually selected by the platform and the sound drivers
    should not really care about this. However COMPILE_TEST is special and the
    platform required may not have been selected, leading to this type of
    error:

    > aiu-encoder-spdif.c:(.text+0x3a0): undefined reference to `clk_set_parent'

    Since we need a sane provider of the API with COMPILE_TEST, depends on
    COMMON_CLK.

    Fixes: 6dc4fa179fb8 ("ASoC: meson: add axg fifo base driver")
    Reported-by: kernel test robot
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20201116172423.546855-1-jbrunet@baylibre.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Jerome Brunet
     

06 Oct, 2020

1 commit


17 Sep, 2020

1 commit


29 Aug, 2020

1 commit

  • On g12 and following platforms, The first channel of record with more than
    2 channels ends being placed randomly on an even channel of the output.

    On these SoCs, a bit was added to force the first channel to be placed at
    the beginning of the output. Apparently the behavior if the bit is not set
    is not easily predictable. According to the documentation, this bit is not
    present on the axg series.

    Set the bit on g12 and fix the problem.

    Fixes: a3c23a8ad4dc ("ASoC: meson: axg-toddr: add g12a support")
    Reported-by: Nicolas Belin
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200828151438.350974-1-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

18 Aug, 2020

2 commits

  • Use the new common snd_soc_of_parse_aux_devs() helper function
    to parse auxiliary devices from the device tree. The new helper
    is just a copy of meson_card_add_aux_devices() so there is no
    functional change.

    Signed-off-by: Stephan Gerhold
    Link: https://lore.kernel.org/r/20200801100257.22658-3-stephan@gerhold.net
    Signed-off-by: Mark Brown

    Stephan Gerhold
     
  • Drop the repeated words {related, we, is, the} in comments.

    Signed-off-by: Randy Dunlap
    Cc: Liam Girdwood
    Cc: Mark Brown
    Cc: alsa-devel@alsa-project.org
    Link: https://lore.kernel.org/r/20200808012209.10880-1-rdunlap@infradead.org
    Signed-off-by: Mark Brown

    Randy Dunlap
     

01 Aug, 2020

2 commits

  • Mark Brown
     
  • Commit b73287f0b074 ("ASoC: soc-pcm: dpcm: fix playback/capture checks")
    changed the meaning of dpcm_playback/dpcm_capture and now requires the
    CPU DAI BE to aligned with those flags.

    This broke all Amlogic cards with uni-directional backends (All gx and
    most axg cards).

    While I'm still confused as to how this change is an improvement, those
    cards can't remain broken forever. Hopefully, next time an API change is
    done like that, all the users will be updated as part of the change, and
    not left to fend for themselves.

    Fixes: b73287f0b074 ("ASoC: soc-pcm: dpcm: fix playback/capture checks")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200731120603.2243261-1-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     

31 Jul, 2020

5 commits

  • This patcheset is collection of fixes for the TDM input and output the
    axg audio architecture. Its fixes:
    - slave mode format setting
    - g12 and sm1 skew offset
    - tdm clock inversion
    - standard daifmt props names which don't require a specific prefix

    Jerome Brunet (4):
    ASoC: meson: axg-tdm-interface: fix link fmt setup
    ASoC: meson: axg-tdmin: fix g12a skew
    ASoC: meson: axg-tdm-formatters: fix sclk inversion
    ASoC: meson: cards: remove DT_PREFIX for standard daifmt properties

    sound/soc/meson/axg-tdm-formatter.c | 11 ++++++-----
    sound/soc/meson/axg-tdm-formatter.h | 1 -
    sound/soc/meson/axg-tdm-interface.c | 26 +++++++++++++++++---------
    sound/soc/meson/axg-tdmin.c | 16 +++++++++++++++-
    sound/soc/meson/axg-tdmout.c | 3 ---
    sound/soc/meson/meson-card-utils.c | 2 +-
    6 files changed, 39 insertions(+), 20 deletions(-)

    --
    2.25.4

    Mark Brown
     
  • Standard dai format property don't need the "amlogic," prefix.
    There nothing amlogic specific about them. Just remove it.

    Fixes: 435857e015dc ("ASoC: meson: align axg card driver with DT bindings documentation")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200729154456.1983396-5-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     
  • After carefully checking, it appears that both tdmout and tdmin require the
    rising edge of the sclk they get to be synchronized with the frame sync
    event (which should be a rising edge of lrclk).

    TDMIN was improperly set before this patch. Remove the sclk_invert quirk
    which is no longer needed and fix the sclk phase.

    Fixes: 1a11d88f499c ("ASoC: meson: add tdm formatter base driver")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200729154456.1983396-4-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     
  • After carefully checking the result provided by the TDMIN on the g12a and
    sm1 SoC families, the TDMIN skew offset appears to be 3 instead of 2 on the
    axg.

    Fixes: f01bc67f58fd ("ASoC: meson: axg-tdm-formatter: rework quirks settings")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200729154456.1983396-3-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     
  • The .set_fmt() callback of the axg tdm interface incorrectly
    test the content of SND_SOC_DAIFMT_MASTER_MASK as if it was a
    bitfield, which it is not.

    Implement the test correctly.

    Fixes: d60e4f1e4be5 ("ASoC: meson: add tdm interface driver")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200729154456.1983396-2-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     

24 Jul, 2020

1 commit


20 Jul, 2020

1 commit

  • …sart <pierre-louis.bossart@linux.intel.com>:

    Small patchset to harden the SoundWire machine driver, change bad
    HIDs, update PLL settings and avoid memory leaks. Given that the
    SoundWire core parts are not upstream it's probably not necessary to
    provide the patches to stable branches.

    Bard Liao (1):
    ASoC: Intel: sof_sdw_rt711: remove hard-coded codec name

    Kai Vehmanen (2):
    ASoC: Intel: sof_sdw: add support for systems without i915 audio
    ASoC: Intel: sof_sdw: avoid crash if invalid DSP topology loaded

    Libin Yang (1):
    ASoC: Intel: common: change match table ehl-rt5660

    Pierre-Louis Bossart (1):
    ASoC: Intel: sof_sdw_rt711: remove properties in card remove

    Yong Zhi (1):
    ASoC: intel: board: sof_rt5682: Update rt1015 pll input clk freq

    sound/soc/intel/boards/sof_rt5682.c | 9 +++++-
    sound/soc/intel/boards/sof_sdw.c | 31 +++++++++++++------
    sound/soc/intel/boards/sof_sdw_common.h | 2 ++
    sound/soc/intel/boards/sof_sdw_hdmi.c | 6 ++++
    sound/soc/intel/boards/sof_sdw_rt711.c | 17 +++++++++-
    .../intel/common/soc-acpi-intel-ehl-match.c | 2 +-
    6 files changed, 54 insertions(+), 13 deletions(-)

    base-commit: 22e9b54307987787efa0ee534aa9e31982ec1161
    --
    2.25.1

    Mark Brown
     

17 Jul, 2020

2 commits

  • axg_card_add_tdm_loopback() misses to call kfree() in an error path. We
    can use devm_kasprintf() to fix the issue, also improve maintainability.
    So use it instead.

    Fixes: c84836d7f650 ("ASoC: meson: axg-card: use modern dai_link style")
    Signed-off-by: Jing Xiangfeng
    Reviewed-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200717082242.130627-1-jingxiangfeng@huawei.com
    Signed-off-by: Mark Brown

    Jing Xiangfeng
     
  • snd_soc_dai_digital_mute() is internally using both
    mute_stream() (1) or digital_mute() (2), but the difference between
    these 2 are only handling direction.
    We can merge digital_mute() into mute_stream

    int snd_soc_dai_digital_mute(xxx, int direction)
    {
    ...
    else if (dai->driver->ops->mute_stream)
    (1) return dai->driver->ops->mute_stream(xxx, direction);
    else if (direction == SNDRV_PCM_STREAM_PLAYBACK &&
    dai->driver->ops->digital_mute)
    (2) return dai->driver->ops->digital_mute(xxx);
    ...
    }

    Signed-off-by: Kuninori Morimoto
    Reviewed-by: Peter Ujfalusi
    Link: https://lore.kernel.org/r/878sftxxie.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     

22 Jun, 2020

1 commit

  • We had read/write function for Codec, Platform, etc,
    but these has been merged into snd_soc_component_read/write().

    Internally, it is using regmap or driver function.
    In read case, each styles are like below

    regmap
    ret = regmap_read(..., reg, &val);

    driver function
    val = xxx->read(..., reg);

    Because of this kind of different style, to keep same read style,
    when we merged each read function into snd_soc_component_read(),
    we created snd_soc_component_read32(), like below.
    commit 738b49efe6c6 ("ASoC: add snd_soc_component_read32")

    (1) val = snd_soc_component_read32(component, reg);

    (2) ret = snd_soc_component_read(component, reg, &val);

    Many drivers are using snd_soc_component_read32(), and
    some drivers are using snd_soc_component_read() today.

    In generally, we don't check read function successes,
    because, we will have many other issues at initial timing
    if read function didn't work.

    Now we can use soc_component_err() when error case.
    This means, it is easy to notice if error occurred.

    This patch aggressively merge snd_soc_component_read() and _read32(),
    and makes snd_soc_component_read/write() as generally style.

    This patch do
    1) merge snd_soc_component_read() and snd_soc_component_read32()
    2) it uses soc_component_err() when error case (easy to notice)
    3) keeps read32 for now by #define
    4) update snd_soc_component_read() for all drivers

    Because _read() user drivers are not too many, this patch changes
    all user drivers.

    Signed-off-by: Kuninori Morimoto
    Reviewed-by: Kai Vehmanen
    Link: https://lore.kernel.org/r/87sgev4mfl.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     

18 Jun, 2020

1 commit


09 Jun, 2020

1 commit


05 Jun, 2020

1 commit

  • Currently if the allocation of ldata fails the error return path
    does not kfree the allocated links object. Fix this by adding
    an error exit return path that performs the necessary kfree'ing.

    Fixes: 7864a79f37b5 ("ASoC: meson: add axg sound card support")
    Signed-off-by: Colin Ian King
    Addresses-Coverity: ("Resource leak")
    Link: https://lore.kernel.org/r/20200604171216.60043-1-colin.king@canonical.com
    Signed-off-by: Mark Brown

    Colin Ian King
     

18 May, 2020

1 commit


20 Apr, 2020

2 commits

  • Since the addition of commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow
    playback/capture if supported"), meson-axg cards which have codec-to-codec
    links fail to init and Oops.

    Unable to handle kernel NULL pointer dereference at virtual address 0000000000000128
    Internal error: Oops: 96000044 [#1] PREEMPT SMP
    CPU: 3 PID: 1582 Comm: arecord Not tainted 5.7.0-rc1
    pc : invalidate_paths_ep+0x30/0xe0
    lr : snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
    Call trace:
    invalidate_paths_ep+0x30/0xe0
    snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
    dpcm_path_get+0x38/0xd0
    dpcm_fe_dai_open+0x70/0x920
    snd_pcm_open_substream+0x564/0x840
    snd_pcm_open+0xfc/0x228
    snd_pcm_capture_open+0x4c/0x78
    snd_open+0xac/0x1a8
    ...

    While this error was initially reported the axg-card type, it also applies
    to the gx-card type.

    While initiliazing the links, ASoC treats the codec-to-codec links of this
    card type as a DPCM backend. This error eventually leads to the Oops.

    Most of the card driver code is shared between DPCM backends and
    codec-to-codec links. The property "no_pcm" marking DCPM BE was left set on
    codec-to-codec links, leading to this problem. This commit fixes that.

    Fixes: e37a0c313a0f ("ASoC: meson: gx: add sound card support")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200420114511.450560-3-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     
  • Since the addition of commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow
    playback/capture if supported"), meson-axg cards which have codec-to-codec
    links fail to init and Oops:

    Unable to handle kernel NULL pointer dereference at virtual address 0000000000000128
    Internal error: Oops: 96000044 [#1] PREEMPT SMP
    CPU: 3 PID: 1582 Comm: arecord Not tainted 5.7.0-rc1
    pc : invalidate_paths_ep+0x30/0xe0
    lr : snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
    Call trace:
    invalidate_paths_ep+0x30/0xe0
    snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
    dpcm_path_get+0x38/0xd0
    dpcm_fe_dai_open+0x70/0x920
    snd_pcm_open_substream+0x564/0x840
    snd_pcm_open+0xfc/0x228
    snd_pcm_capture_open+0x4c/0x78
    snd_open+0xac/0x1a8
    ...

    While initiliazing the links, ASoC treats the codec-to-codec links of this
    card type as a DPCM backend. This error eventually leads to the Oops.

    Most of the card driver code is shared between DPCM backends and
    codec-to-codec links. The property "no_pcm" marking DCPM BE was left set on
    codec-to-codec links, leading to this problem. This commit fixes that.

    Fixes: 0a8f1117a680 ("ASoC: meson: axg-card: add basic codec-to-codec link support")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200420114511.450560-2-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     

27 Mar, 2020

1 commit


10 Mar, 2020

1 commit

  • This patch switch to use plural form macro.

    - for_each_rtd_codec_dai()
    + for_each_rtd_codec_dais()

    - for_each_rtd_codec_dai_rollback()
    + for_each_rtd_codec_dais_rollback()

    - for_each_rtd_cpu_dai()
    + for_each_rtd_cpu_dais()

    - for_each_rtd_cpu_dai_rollback()
    + for_each_rtd_cpu_dais_rollback()

    Signed-off-by: Kuninori Morimoto
    Reviewed-by: Ranjani Sridharan
    Reviewed-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/87y2sagoh7.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     

25 Feb, 2020

1 commit


24 Feb, 2020

1 commit

  • sound/soc/meson/aiu-encoder-i2s.c:129:2-3: Unneeded semicolon

    Remove unneeded semicolon.

    Generated by: scripts/coccinelle/misc/semicolon.cocci

    Fixes: 3e25c44598aa ("ASoC: meson: aiu: add support for the Meson8 and Meson8b SoC families")
    Signed-off-by: kbuild test robot
    CC: Martin Blumenstingl
    Link: https://lore.kernel.org/r/20200222170154.GA119396@e50d7db646c3
    Signed-off-by: Mark Brown

    kbuild test robot
     

22 Feb, 2020

2 commits

  • Make sure the axg audio card driver recognise the dai_link as a
    codec-to-codec link if the cpu dai is the internal dac glue.

    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200221153607.1585499-4-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     
  • Add support for the internal audio DAC glue found on the Amlogic g12a
    and sm1 SoC families. This allows to connect the TDM outputs of the SoC
    to the internal t9015 audio DAC.

    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200221153607.1585499-3-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     

21 Feb, 2020

3 commits

  • The AIU audio controller on the Meson8 and Meson8b SoC families is
    compatible with the one found in the later GXBB family. Add compatible
    strings for these two older SoC families so the driver can be loaded for
    them.

    Instead of using the I2S divider from the AIU_CLK_CTRL_MORE register we
    need to use the I2S divider from the AIU_CLK_CTRL register. This older
    register is less flexible because it only supports four divider settings
    (1, 2, 4, 8) compared to the AIU_CLK_CTRL_MORE register (which supports
    dividers in the range 0..64).

    Signed-off-by: Martin Blumenstingl
    Reviewed-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200220205711.77953-4-martin.blumenstingl@googlemail.com
    Signed-off-by: Mark Brown

    Martin Blumenstingl
     
  • Introduce a struct aiu_platform_data to make the driver aware of
    platform specific information. Convert the existing check for the
    internal stereo audio codec (only available on GXL) to this new struct.
    Support for the 32-bit SoCs will need this as well because the
    AIU_CLK_CTRL_MORE register doesn't have the I2S divider bits (and we
    need to use the I2S divider from AIU_CLK_CTRL instead).

    Signed-off-by: Martin Blumenstingl
    Reviewed-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200220205711.77953-3-martin.blumenstingl@googlemail.com
    Signed-off-by: Mark Brown

    Martin Blumenstingl
     
  • Reset the g12a hdmi codec glue on probe. This ensure a sane startup state.

    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200221121146.1498427-1-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     

20 Feb, 2020

1 commit


18 Feb, 2020

1 commit

  • Now that the component name is unique within ASoC, there is no need to
    hack the debugfs prefix to add more than one ASoC component to a linux
    device. Remove the unnecessary function and use
    snd_soc_register_component() directly.

    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200217092019.433402-1-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     

15 Feb, 2020

2 commits

  • Clarify the cast of snd_pcm_format_t and fix the sparse warning:
    restricted snd_pcm_format_t degrades to integer

    Fixes: 9c29fd9bdf92 ("ASoC: meson: g12a: extract codec-to-codec utils")
    Reported-by: kbuild test robot
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200214131350.337968-6-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet
     
  • Remove the double initialization of the dai input name as reported by
    sparse.

    Fixes: 65816025d461 ("ASoC: meson: aiu: add internal dac codec control support")
    Signed-off-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20200214131350.337968-5-jbrunet@baylibre.com
    Signed-off-by: Mark Brown

    Jerome Brunet