lkml.org 
[lkml]   [2022]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 091/112] ASoC: wm5110: Fix DRE control
    Date
    From: Charles Keepax <ckeepax@opensource.cirrus.com>

    [ Upstream commit 0bc0ae9a5938d512fd5d44f11c9c04892dcf4961 ]

    The DRE controls on wm5110 should return a value of 1 if the DRE state
    is actually changed, update to fix this.

    Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
    Link: https://lore.kernel.org/r/20220621102041.1713504-2-ckeepax@opensource.cirrus.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    sound/soc/codecs/wm5110.c | 8 ++++++--
    1 file changed, 6 insertions(+), 2 deletions(-)

    diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
    index 4238929b2375..d0cef982215d 100644
    --- a/sound/soc/codecs/wm5110.c
    +++ b/sound/soc/codecs/wm5110.c
    @@ -413,6 +413,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
    unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift;
    unsigned int lold, rold;
    unsigned int lena, rena;
    + bool change = false;
    int ret;

    snd_soc_dapm_mutex_lock(dapm);
    @@ -440,8 +441,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
    goto err;
    }

    - ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE,
    - mask, lnew | rnew);
    + ret = regmap_update_bits_check(arizona->regmap, ARIZONA_DRE_ENABLE,
    + mask, lnew | rnew, &change);
    if (ret) {
    dev_err(arizona->dev, "Failed to set DRE: %d\n", ret);
    goto err;
    @@ -454,6 +455,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
    if (!rnew && rold)
    wm5110_clear_pga_volume(arizona, mc->rshift);

    + if (change)
    + ret = 1;
    +
    err:
    snd_soc_dapm_mutex_unlock(dapm);

    --
    2.35.1


    \
     
     \ /
      Last update: 2022-07-19 14:27    [W:4.564 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site