]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: fsl_utils: Add snd_kcontrol functions for specific cases
authorShengjiu Wang <shengjiu.wang@nxp.com>
Tue, 10 Mar 2026 10:42:33 +0000 (18:42 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 10 Mar 2026 13:55:57 +0000 (13:55 +0000)
commit819cf1dc01ce66b6906d403a6925c4bd754a7a1d
tree008bec4872638bc77356f915b2067963c5129d1a
parent1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
ASoC: fsl_utils: Add snd_kcontrol functions for specific cases

There are some registers which are volatile, at pm runtime suspend state,
the regmap cache only is enabled, regmap will return -EBUSY when trying to
access these registers.

static int _regmap_read(struct regmap *map, unsigned int reg,
                        unsigned int *val)
{
        int ret;
        void *context = _regmap_map_get_context(map);

        if (!map->cache_bypass) {
                ret = regcache_read(map, reg, val);
                if (ret == 0)
                        return 0;
        }

        if (map->cache_only)
                return -EBUSY;

        if (!regmap_readable(map, reg))
                return -EIO;

When exporting these registers by amixer interface to user space, there
will be -EBUSY errors in mixer-test when the cpu dai is in idle. In order
to avoid such error, needs to define FSL own functions to take a pm
runtime reference before calling snd_soc_get_xr_sx(),
snd_soc_get_enum_double(), snd_soc_get_volsw(), and so on.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20260310104235.1234569-2-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_utils.c
sound/soc/fsl/fsl_utils.h