30 Dec, 2020

40 commits

  • commit 55d8e6a85bce21f748c42eedea63681219f70523 upstream.

    The Raven and Renoir ACP can be distinguished by the PCI revision.
    Let's do the check very early, otherwise the wrong probe code
    can be run.

    Link: https://lore.kernel.org/alsa-devel/2e4587f8-f602-cf23-4845-fd27a32b1cfc@amd.com/
    Cc:
    Cc: Vijendar Mukunda
    Cc: Mark Brown
    Signed-off-by: Jaroslav Kysela
    Link: https://lore.kernel.org/r/20201208181233.2745726-1-perex@perex.cz
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Jaroslav Kysela
     
  • commit 718c406e1ffaca4eac987b957bbb36ce1090797a upstream.

    Users reported that some Lenovo AMD platforms do not have ACP microphone,
    but the BIOS advertises it via ACPI.

    This patch create a simple DMI table, where those machines with the broken
    BIOS can be added. The DMI description for Lenovo IdeaPad 5 and
    IdeaPad Flex 5 devices are added there.

    Also describe the dmic_acpi_check kernel module parameter in a more
    understandable way.

    Cc:
    Cc: Vijendar Mukunda
    Cc: Mark Brown
    Signed-off-by: Jaroslav Kysela
    Link: https://lore.kernel.org/r/20201208171200.2737620-1-perex@perex.cz
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Jaroslav Kysela
     
  • commit 0d024a8bec084205fdd9fa17479ba91f45f85db3 upstream.

    The cx2072x codec driver defines multiple DAIs with the same stream
    name "Playback" and "Capture". Although the current code works more
    or less as is as the secondary streams are never used, it still leads
    the error message like:
    debugfs: File 'Playback' in directory 'dapm' already present!
    debugfs: File 'Capture' in directory 'dapm' already present!

    Fix it by renaming the secondary streams to unique names.

    Fixes: a497a4363706 ("ASoC: Add support for Conexant CX2072X CODEC")
    Cc:
    Signed-off-by: Takashi Iwai
    Link: https://lore.kernel.org/r/20201208135154.9188-1-tiwai@suse.de
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 74c64efa1557fef731b59eb813f115436d18078e upstream.

    Since mmap for userspace is based on page alignment, add page alignment
    for iram alloc from pool, otherwise, some good data located in the same
    page of dmab->area maybe touched wrongly by userspace like pulseaudio.

    Signed-off-by: Robin Gong
    Cc:
    Link: https://lore.kernel.org/r/1608221747-3474-1-git-send-email-yibin.gong@nxp.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Robin Gong
     
  • commit 525d9c57d0eeeb660d9b25e5b2d1c95975e3ba95 upstream.

    ASUS PRIME TRX40 PRO-S mobo with 0b05:1918 needs the same quirk alias
    for another ASUS mobo (0b05:1917) for the proper mixer mapping, etc.
    Add the corresponding entry.

    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210783
    Cc:
    Link: https://lore.kernel.org/r/20201221080159.24468-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 9df28edce7c6ab38050235f6f8b43dd7ccd01b6d upstream.

    Some buggy firmware don't give the current sample rate but leaves
    zero. Handle this case more gracefully without warning but just skip
    the current rate verification from the next time.

    Cc:
    Link: https://lore.kernel.org/r/20201218145858.2357-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 725124d10d00b2f56bb5bd08b431cc74ab3b3ace upstream.

    Add VID to support native DSD reproduction on FiiO devices.

    Tested-by: Amadej Kastelic
    Signed-off-by: Emilio Moretti
    Signed-off-by: Amadej Kastelic
    Cc:
    Link: https://lore.kernel.org/r/X9j7wdXSr4XyK7Bd@ryzen.localdomain
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Amadej Kastelic
     
  • commit 150927c3674d7db4dd51a7269e01423c8c78e53b upstream.

    This platform only supported iphone type headset.
    It can't support Dell headset mode.

    Signed-off-by: Kailang Yang
    Cc:
    Link: https://lore.kernel.org/r/b97e971978034bc9b772a08ec91265e8@realtek.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit 34cdf405aa5de827b8bef79a6c82c39120b3729b upstream.

    Acer TravelMate laptops P648/P658 series with codec ALC282 only have
    one physical jack for headset but there's a confusing lineout pin on
    NID 0x1b reported. Audio applications hence misunderstand that there
    are a speaker and a lineout, and take the lineout as the default audio
    output.

    Add a new quirk to remove the useless lineout and enable the pin 0x18
    for jack sensing and headset microphone.

    Signed-off-by: Chris Chiu
    Signed-off-by: Jian-Hong Pan
    Cc:
    Link: https://lore.kernel.org/r/20201216125200.27053-1-chiu@endlessos.org
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Chris Chiu
     
  • commit 6ca653e3f73a1af0f30dbf9c2c79d2897074989f upstream.

    The Quanta NL3 laptop has both a headphone output jack and a headset
    jack, on the right edge of the chassis.

    The pin information suggests that both of these are at the Front.
    The PulseAudio is confused to differentiate them so one of the jack
    can neither get the jack sense working nor the audio output.

    The ALC269_FIXUP_LIFEBOOK chained with ALC269_FIXUP_QUANTA_MUTE can
    help to differentiate 2 jacks and get the 'Auto-Mute Mode' working
    correctly.

    Signed-off-by: Chris Chiu
    Cc:
    Link: https://lore.kernel.org/r/20201222150459.9545-1-chiu@endlessos.org
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Chris Chiu
     
  • commit 09926202e939fd699650ac0fc0baa5757e069390 upstream.

    MSI-GP73 (with SSID 1462:1229) requires yet again
    ALC1220_FIXUP_CLEVO_P950 quirk like other MSI models.

    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210793
    Cc:
    Link: https://lore.kernel.org/r/20201220080943.24839-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 13be30f156fda725b168ac89fc91f78651575307 upstream.

    This Acer Veriton N4640G/N6640G/N2510G desktops have 2 headphone
    jacks(front and rear), and a separate Mic In jack.

    The rear headphone jack is actually a line out jack but always silent
    while playing audio. The front 'Mic In' also fails the jack sensing.
    Apply the ALC269_FIXUP_LIFEBOOK to have all audio jacks to work as
    expected.

    Signed-off-by: Chris Chiu
    Signed-off-by: Jian-Hong Pan
    Cc:
    Link: https://lore.kernel.org/r/20201222150459.9545-2-chiu@endlessos.org
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Chris Chiu
     
  • commit 11cb881bf075cea41092a20236ba708b18e1dbb2 upstream.

    There are a few places that call round{up|down}_pow_of_two() with the
    value zero, and this causes undefined behavior warnings. Avoid
    calling those macros if such a nonsense value is passed; it's a minor
    optimization as well, as we handle it as either an error or a value to
    be skipped, instead.

    Reported-by: syzbot+33ef0b6639a8d2d42b4c@syzkaller.appspotmail.com
    Cc:
    Link: https://lore.kernel.org/r/20201218161730.26596-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 607184cb1635eaee239fe3fb9648a8b82a5232d7 upstream.

    Add supported for more Lenovo ALC285 Headset Button.

    Signed-off-by: Kailang Yang
    Cc:
    Link: https://lore.kernel.org/r/bb1f1da1526d460885aa4257be81eb94@realtek.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit 7e413528474d5895e3e315c019fb0c43522eb6d9 upstream.

    The ASUS laptop Q524UQK with ALC255 codec can't detect the headset
    microphone until ALC255_FIXUP_ASUS_MIC_NO_PRESENCE quirk applied.

    Signed-off-by: Chris Chiu
    Signed-off-by: Jian-Hong Pan
    Cc:
    Link: https://lore.kernel.org/r/20201209045730.9972-1-chiu@endlessos.org
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Chris Chiu
     
  • commit 5cfca59604e423f720297e30a9dc493eea623493 upstream.

    The ASUS laptop X430UN with ALC256 can't detect the headset microphone
    until ALC256_FIXUP_ASUS_MIC_NO_PRESENCE quirk applied.

    Signed-off-by: Chris Chiu
    Signed-off-by: Jian-Hong Pan
    Cc:
    Link: https://lore.kernel.org/r/20201207072755.16210-1-chiu@endlessos.org
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Chris Chiu
     
  • commit c72b9bfe0f914639cc475585f45722a3eb57a56d upstream.

    This change could fix 2 issues on this machine:
    - the bass speaker's output volume can't be adjusted, that is because
    the bass speaker is routed to the DAC (Nid 0x6) which has no volume
    control.
    - after plugging a headset with vol+, vol- and pause buttons on it,
    press those buttons, nothing happens, this means those buttons
    don't work at all. This machine has alc287 codec, need to add the
    codec id to the disable/enable_headset_jack_key(), then the headset
    button could work.

    The quirk of ALC285_FIXUP_THINKPAD_HEADSET_JACK could fix both of these
    2 issues.

    Cc:
    Signed-off-by: Hui Wang
    Link: https://lore.kernel.org/r/20201205051130.8122-1-hui.wang@canonical.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang
     
  • commit c697ba85a94b8f65bf90dec5ef9af5c39c3e73b2 upstream.

    The Windows driver sets the pincfg for the AE-5's rear-headphone to
    report as a microphone. This causes issues with Pulseaudio mistakenly
    believing there is no headphone plugged in. In Linux, we should instead
    set it to be a headphone.

    Fixes: a6b0961b39896 ("ALSA: hda/ca0132 - fix AE-5 pincfg")
    Cc:
    Signed-off-by: Connor McAdams
    Link: https://lore.kernel.org/r/20201208195223.424753-1-conmanx360@gmail.com
    Link: https://lore.kernel.org/r/20201210173550.2968-1-conmanx360@gmail.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Connor McAdams
     
  • commit 2506318e382c4c7daa77bdc48f80a0ee82804588 upstream.

    It seems that the HD-audio clear and reconfig sysfs don't work any
    longer after the recent driver core change. There are multiple issues
    around that: the linked list corruption and the dead device handling.
    The former issue is fixed by another patch for the driver core itself,
    while the latter patch needs to be addressed in HD-audio side.

    This patch corresponds to the latter, it recovers those broken
    functions by replacing the device detach and attach actions with the
    standard core API functions, which are almost equivalent with unbind
    and bind actions.

    Fixes: 654888327e9f ("driver core: Avoid binding drivers to dead devices")
    Cc:
    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209207
    Link: https://lore.kernel.org/r/20201209150119.7705-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 7079f785b50055a32b72eddcb7d9ba5688db24d0 upstream.

    Change the Input Source enumerated control's strings to make it play
    nice with pulseaudio.

    Fixes: 7cb9d94c05de9 ("ALSA: hda/ca0132: add alt_select_in/out for R3Di + SBZ")
    Cc:
    Signed-off-by: Connor McAdams
    Link: https://lore.kernel.org/r/20201208195223.424753-2-conmanx360@gmail.com
    Link: https://lore.kernel.org/r/20201210173550.2968-2-conmanx360@gmail.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Connor McAdams
     
  • [ Upstream commit 85a7555575a0e48f9b73db310d0d762a08a46d63 ]

    The error handling frees "ctl" but it's still on the "dsp->ctl_list"
    list so that could result in a use after free. Remove it from the list
    before returning.

    Fixes: 2323736dca72 ("ASoC: wm_adsp: Add basic support for rev 1 firmware file format")
    Signed-off-by: Dan Carpenter
    Acked-by: Charles Keepax
    Link: https://lore.kernel.org/r/X9B0keV/02wrx9Xs@mwanda
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Dan Carpenter
     
  • [ Upstream commit b1a5039759cb7bfcb2157f28604dbda0bca58598 ]

    A problem exists in enabling silent stream when connection type is
    DisplayPort. Silent stream programming is completed when a new DP
    receiver is connected, but infoframe transmission does not actually
    start until PCM is opened for the first time. This can result in audible
    gap of multiple seconds. This only affects the first PCM open.

    Fix the issue by properly assigning a converter to the silent stream,
    and modifying the required stream ID programming sequence.

    This change only affects Intel display audio codecs.

    BugLink: https://github.com/thesofproject/linux/issues/2468
    Fixes: 951894cf30f4 ("ALSA: hda/hdmi: Add Intel silent stream support")
    Signed-off-by: Kai Vehmanen
    Link: https://lore.kernel.org/r/20201210174445.3134104-1-kai.vehmanen@linux.intel.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin

    Kai Vehmanen
     
  • [ Upstream commit 3cea33b6f2d7782d1be17c71509986f33ee93541 ]

    These error paths return success but they should return -EINVAL.

    Fixes: 97ed3e509ee6 ("ASoC: max98390: Fix potential crash during param fw loading")
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/X9B0uz4svyNTqeMb@mwanda
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Dan Carpenter
     
  • [ Upstream commit 95d3befbc5e1ee39fc8a78713924cf7ed2b3cabe ]

    cz_da7219_init() does not check the return values of clk_get(),
    while da7219_clk_enable() calls clk_set_rate() to dereference
    the pointers.
    Add checks to fix the problems.
    Also, change clk_get() to devm_clk_get() to avoid data leak after
    failures.

    Fixes: bb24a31ed584 ("ASoC: AMD: Configure wclk and bclk of master codec")
    Signed-off-by: Chuhong Yuan
    Link: https://lore.kernel.org/r/20201204063610.513556-1-hslester96@gmail.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Chuhong Yuan
     
  • [ Upstream commit b1b8eb1283c90a953089d988930d7b6156418958 ]

    The previous fix left another warning in randconfig builds:

    WARNING: unmet direct dependencies detected for SND_SOC_QDSP6
    Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] && QCOM_APR [=y] && COMMON_CLK [=n]
    Selected by [y]:
    - SND_SOC_MSM8996 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] && QCOM_APR [=y]

    Add one more dependency for this one.

    Fixes: 2bc8831b135c ("ASoC: qcom: fix SDM845 & QDSP6 dependencies more")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Srinivas Kandagatla
    Link: https://lore.kernel.org/r/20201203231443.1483763-1-arnd@kernel.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     
  • [ Upstream commit 29275309b0e32bb838d67158c6b6e687275f43e9 ]

    Compile-testing this driver on an older platform without CONFIG_COMMON_CLK fails with

    ERROR: modpost: "clk_set_min_rate" [sound/soc/atmel/snd-soc-mchp-spdifrx.ko] undefined!

    Make this is a strict dependency.

    Fixes: ef265c55c1ac ("ASoC: mchp-spdifrx: add driver for SPDIF RX")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Codrin Ciubotariu
    Link: https://lore.kernel.org/r/20201203223815.1353451-1-arnd@kernel.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     
  • [ Upstream commit 7061b8a52296e044eed47b605d136a48da1a7761 ]

    gcc points out a memory area that is copied to a device
    but not initialized:

    sound/soc/codecs/cros_ec_codec.c: In function 'i2s_rx_event':
    arch/x86/include/asm/string_32.h:83:20: error: '*((void *)&p+4)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    83 | *((int *)to + 1) = *((int *)from + 1);

    Initialize all the unused fields to zero.

    Fixes: 727f1c71c780 ("ASoC: cros_ec_codec: refactor I2S RX")
    Signed-off-by: Arnd Bergmann
    Acked-by: Tzung-Bi Shih
    Link: https://lore.kernel.org/r/20201203225458.1477830-1-arnd@kernel.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     
  • [ Upstream commit 7e20ae1208daaf6dad85c2dcb968fc590b6f3b99 ]

    setting clock rate on child clocks without a parent clock rate will
    result in zero clk rate for child. This also means that when audio
    is started dsp will attempt to access registers without enabling
    clock resulting in board boot up.

    Fix this by adding the missing parent clock rate.

    Fixes: 520a1c396d196 ("ASoC: q6afe-clocks: add q6afe clock controller")
    Signed-off-by: Srinivas Kandagatla
    Link: https://lore.kernel.org/r/20201204164228.1826-1-srinivas.kandagatla@linaro.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Srinivas Kandagatla
     
  • [ Upstream commit 1c1fb2653a0c2e3f310c07eacd8fc3a10e08c97a ]

    jz4740_i2s_set_sysclk() does not check the return values of clk_get(),
    while the file dereferences the pointers in clk_put().
    Add the missed checks to fix it.

    Fixes: 11bd3dd1b7c2 ("ASoC: Add JZ4740 ASoC support")
    Signed-off-by: Chuhong Yuan
    Link: https://lore.kernel.org/r/20201203144227.418194-1-hslester96@gmail.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Chuhong Yuan
     
  • [ Upstream commit 0d7f2459ae926a964ab211aac413d72074131727 ]

    Speaker amp's SSP bclk configuration was changed in the topology file to be
    based on 12.288MHz and dai_ops->hw_params is based on s32le format.
    But, the TDM slot size remained set to 24 bits.
    This inconsistency created audible noises and needs to be corrected.
    This patch updates TDM slot width to 32.

    Fixes: bc7477fc2ab4 ("ASoC: Intel: Boards: tgl_max98373: Update TDM configuration in hw_params")

    Signed-off-by: Sathyanarayana Nujella
    Reviewed-by: Pierre-Louis Bossart
    Signed-off-by: Ranjani Sridharan
    Link: https://lore.kernel.org/r/20201201211150.433472-1-ranjani.sridharan@linux.intel.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Sathyanarayana Nujella
     
  • [ Upstream commit 9a207228bdf0a4933b794c944d7111564353ea94 ]

    The Intel Keem Bay audio module is only present on Intel Keem Bay SoCs.
    Hence add a dependency on ARCH_KEEMBAY, to prevent asking the user about
    this driver when configuring a kernel without Intel Keem Bay platform
    support.

    Fixes: c544912bcc2dc806 ("ASoC: Intel: Add makefiles and kconfig changes for KeemBay")
    Signed-off-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20201110145001.3280479-1-geert+renesas@glider.be
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     
  • [ 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
     
  • [ Upstream commit 358f0ac1f2791c80c19cc26706cf34664c9fd756 ]

    SND_INTEL_DSP_CONFIG is selected by the HDaudio, Skylake and SOF
    drivers. When the HDaudio link is not selected as a option, this
    Kconfig option is not touched and will default to whatever other
    drivers selected. In the case e.g. where HDaudio is compiled as
    built-in, the linker will complain:

    ld: sound/soc/sof/sof-pci-dev.o: in function `sof_pci_probe':
    sof-pci-dev.c:(.text+0x5c): undefined reference to
    `snd_intel_dsp_driver_probe'

    Adding the select for all HDaudio platforms, regardless of whether
    they rely on the HDaudio link or not, solves the problem.

    Reported-by: Randy Dunlap
    Acked-by: Randy Dunlap
    Fixes: 82d9d54a6c0ee ('ALSA: hda: add Intel DSP configuration / probe code')
    Signed-off-by: Pierre-Louis Bossart
    Reviewed-by: Ranjani Sridharan
    Link: https://lore.kernel.org/r/20201112164425.25603-5-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Pierre-Louis Bossart
     
  • [ Upstream commit 5e7aace13df24ff72511f29c14ebbfe638ef733c ]

    In the normal path, we should not free the arizona,
    we should return immediately. It will be free when
    call remove operation.

    Fixes: 31833ead95c2c ("ASoC: arizona: Move request of speaker IRQs into bus probe")
    Reported-by: Richard Fitzgerald
    Signed-off-by: Zhang Qilong
    Acked-by: Richard Fitzgerald
    Link: https://lore.kernel.org/r/20201111130923.220186-2-zhangqilong3@huawei.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Zhang Qilong
     
  • [ Upstream commit 193aa0a043645220d2a2f783ba06ae13d4601078 ]

    The pm_runtime_enable will increase power disable depth. Thus
    a pairing decrement is needed on the error handling path to
    keep it balanced according to context.

    Fixes: 31833ead95c2c ("ASoC: arizona: Move request of speaker IRQs into bus probe")
    Signed-off-by: Zhang Qilong
    Reviewed-by: Richard Fitzgerald
    Link: https://lore.kernel.org/r/20201111041326.1257558-4-zhangqilong3@huawei.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Zhang Qilong
     
  • [ Upstream commit b8161cbe55a1892a19a318eaebbda92438fa708c ]

    The pm_runtime_enable will increase power disable depth. Thus
    a pairing decrement is needed on the error handling path to
    keep it balanced according to context.

    Fixes: 57e265c8d71fb ("ASoC: wm8994: Move runtime PM init to platform device init")
    Signed-off-by: Zhang Qilong
    Reviewed-by: Richard Fitzgerald
    Link: https://lore.kernel.org/r/20201111041326.1257558-2-zhangqilong3@huawei.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Zhang Qilong
     
  • [ Upstream commit 4e59dd249cd513a211e2ecce2cb31f4e29a5ce5b ]

    There are two issues in this function.

    1) We can't drop the refrences on "cpu", "codec" and "platform" before
    we take the reference. This doesn't cause a problem on the first
    iteration because those pointers start as NULL so the of_node_put()
    is a no-op. But on the subsequent iterations, it will lead to a use
    after free.

    2) If the devm_kzalloc() allocation failed then the code returned
    directly instead of cleaning up.

    Fixes: c1e6414cdc37 ("ASoC: qcom: common: Fix refcount imbalance on error")
    Fixes: 1e36ea360ab9 ("ASoC: qcom: common: use modern dai_link style")
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/20201105125154.GA176426@mwanda
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Dan Carpenter
     
  • [ Upstream commit 4c22b80f61540ea99d9b4af0127315338755f05b ]

    soc-pcm's dpcm_fe_dai_do_trigger() supported DRAIN commnad up to kernel
    v5.4 where explicit switch(cmd) has been introduced which takes into
    account all SNDRV_PCM_TRIGGER_xxx but SNDRV_PCM_TRIGGER_DRAIN. Update
    switch statement to reactive support for it.

    As DRAIN is somewhat unique by lacking negative/stop counterpart, bring
    behaviour of dpcm_fe_dai_do_trigger() for said command back to its
    pre-v5.4 state by adding it to START/RESUME/PAUSE_RELEASE group.

    Fixes: acbf27746ecf ("ASoC: pcm: update FE/BE trigger order based on the command")
    Signed-off-by: Cezary Rojewski
    Reviewed-by: Ranjani Sridharan
    Link: https://lore.kernel.org/r/20201026100129.8216-1-cezary.rojewski@intel.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Cezary Rojewski
     
  • [ Upstream commit 93c0210671d8f3ec2262da703fab93a1497158a8 ]

    Left and Right justified mode are computed using the same formula
    as DSP_A and DSP_B mode.
    Which is wrong and the user manual explicitly says:

    LRCK_PERDIOD:
    PCM Mode: Number of BCLKs within (Left + Right) channel width.
    I2S/Left-Justified/Right-Justified Mode: Number of BCLKs within each
    individual channel width(Left or Right)

    Fix this by using the same formula as the I2S mode.

    Fixes: 7ae7834ec446 ("ASoC: sun4i-i2s: Add support for DSP formats")
    Signed-off-by: Clément Péron
    Acked-by: Maxime Ripard
    Link: https://lore.kernel.org/r/20201030144648.397824-2-peron.clem@gmail.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Clément Péron
     
  • [ Upstream commit bcc96dc3cf8048c80af7c487af17e19be27ac57d ]

    The check for an error return from the call to snd_pcm_format_width
    is never true as the unsigned int bitwidth can never be less than
    zero. Fix this by making bitwidth an int.

    Fixes: 7cb37b7bd0d3 ("ASoC: qcom: Add support for lpass hdmi driver")
    Signed-off-by: Colin Ian King
    Link: https://lore.kernel.org/r/20201028115112.109017-1-colin.king@canonical.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Colin Ian King