• Richard Fitzgerald's avatar
    ASoC: cs35l56: Revert support for dual-ownership of ASP registers · 5d7e328e
    Richard Fitzgerald authored
    This patch reverts a series of commits that allowed for the ASP
    registers to be owned by either the driver or the firmware. Nothing
    currently depends on the functionality that is being reverted, so
    it is safe to remove.
    
    The commits being reverted are (last 3 are bugfixes to the first 2):
    commit 72a77d76
    ("ASoC: cs35l56: Fix to ensure ASP1 registers match cache")
    commit 07f7d6e7
    ("ASoC: cs35l56: Fix for initializing ASP1 mixer registers")
    commit 4703b014
    ("ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put()")
    commit c14f09f0
    ("ASoC: cs35l56: Fix deadlock in ASP1 mixer register initialization")
    commit dfd2ffb3
    ("ASoC: cs35l56: Prevent overwriting firmware ASP config")
    
    These reverts have been squashed into a single commit because there
    would be no reason to revert only some of them (which would just
    reintroduce bugs).
    
    The changes introduced by the commits were well-intentioned but
    somewhat misguided. ACPI does not provide any information about how
    audio hardware is linked together, so that information has to be
    hardcoded into drivers. On Windows the firmware is customized to
    statically setup appropriate configuration of the audio links,
    and the intent of the commits was to re-use this information if the
    Linux host drivers aren't taking control of the ASP. This would
    avoid having to hardcode the ASP config into the machine driver on
    some systems.
    
    However, this added complexity and race conditions into the driver.
    It also complicates implementation of new code.
    
    The only case where the ASP is used but the host is not taking
    ownership is when CS35L56 is used in SoundWire mode with the ASP
    as a reference audio interconnect. But even in that case it's not
    necessarily required even if the firmware initialized it. Typically
    it is used to avoid the host SDCA drivers having to be capable of
    aggregating capture paths from multiple SoundWire peripherals. But
    the SOF SoundWire support is capable of doing that aggregation.
    
    Reverting all these commits significantly simplifies the driver.
    Let's just use the normal Linux mechanisms of the machine driver and
    ALSA controls to set things up instead of trying to use the firmware
    to do use-case setup.
    Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
    Link: https://patch.msgid.link/20240701104444.172556-2-rf@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    5d7e328e
cs35l56-shared.c 29 KB