ASoC: soc-component: move soc_component_field_shift()

soc_component_field_shift() is used from
snd_soc_component_{read/write}_field(). It is better to located around
them.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/87wlumrz83.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto
2026-07-23 06:34:20 +00:00
committed by Mark Brown
parent d58fe9eabc
commit 23b64e9b9b

View File

@@ -29,18 +29,6 @@ static inline int _soc_component_ret_reg_rw(struct snd_soc_component *component,
func, component->name, reg);
}
static inline int soc_component_field_shift(struct snd_soc_component *component,
unsigned int mask)
{
if (!mask) {
dev_err(component->dev, "ASoC: error field mask is zero for %s\n",
component->name);
return 0;
}
return (ffs(mask) - 1);
}
/*
* We might want to check substream by using list.
* In such case, we can update these macros.
@@ -820,6 +808,18 @@ int snd_soc_component_update_bits_async(struct snd_soc_component *component,
}
EXPORT_SYMBOL_GPL(snd_soc_component_update_bits_async);
static inline int soc_component_field_shift(struct snd_soc_component *component,
unsigned int mask)
{
if (!mask) {
dev_err(component->dev, "ASoC: error field mask is zero for %s\n",
component->name);
return 0;
}
return (ffs(mask) - 1);
}
/**
* snd_soc_component_read_field() - Read register field value
* @component: Component to read from