• Hans de Goede's avatar
    ASoC: Intel: cht_bsw_max98090_ti: Enable codec clock once and keep it enabled · 4bcdec39
    Hans de Goede authored
    Users have been seeing sound stability issues with max98090 codecs since:
    commit 648e9218 ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
    
    At first that commit broke sound for Chromebook Swanky and Clapper models,
    the problem was that the machine-driver has been controlling the wrong
    clock on those models since support for them was added. This was hidden by
    clk-pmc-atom.c keeping the actual clk on unconditionally.
    
    With the machine-driver controlling the proper clock, sound works again
    but we are seeing bug reports describing it as: low volume,
    "sounds like played at 10x speed" and instable.
    
    When these issues are hit the following message is seen in dmesg:
    "max98090 i2c-193C9890:00: PLL unlocked".
    
    Attempts have been made to fix this by inserting a delay between enabling
    the clk and enabling and checking the pll, but this has not helped.
    
    It seems that at least on boards which use pmc_plt_clk_0 as clock,
    if we ever disable the clk, the pll looses its lock and after that we get
    various issues.
    
    This commit fixes this by enabling the clock once at probe time on
    these boards. In essence this restores the old behavior of clk-pmc-atom.c
    always keeping the clk on on these boards.
    
    Fixes: 648e9218 ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
    Reported-by: default avatarMogens Jensen <mogens-jensen@protonmail.com>
    Reported-by: default avatarDean Wallace <duffydack73@gmail.com>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    4bcdec39
cht_bsw_max98090_ti.c 14 KB