mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
ASoC: soc-component: add snd_soc_component_regmap_val_bytes()
component has component->val_bytes which is set via snd_soc_component_setup_regmap(). But it can be calculated via component->regmap. No need to keep it as component->val_bytes. Add snd_soc_component_regmap_val_bytes() for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/878qbxzywo.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f338e77383
commit
c2da481388
|
|
@ -327,6 +327,7 @@ int snd_soc_component_stream_event(struct snd_soc_component *component,
|
|||
int snd_soc_component_set_bias_level(struct snd_soc_component *component,
|
||||
enum snd_soc_bias_level level);
|
||||
|
||||
int snd_soc_component_regmap_val_bytes(struct snd_soc_component *component);
|
||||
void snd_soc_component_setup_regmap(struct snd_soc_component *component);
|
||||
#ifdef CONFIG_REGMAP
|
||||
void snd_soc_component_init_regmap(struct snd_soc_component *component,
|
||||
|
|
|
|||
|
|
@ -351,6 +351,23 @@ void snd_soc_component_setup_regmap(struct snd_soc_component *component)
|
|||
component->val_bytes = val_bytes;
|
||||
}
|
||||
|
||||
int snd_soc_component_regmap_val_bytes(struct snd_soc_component *component)
|
||||
{
|
||||
int val_bytes;
|
||||
|
||||
/* Errors are legitimate for non-integer byte multiples */
|
||||
|
||||
if (!component->regmap)
|
||||
return 0;
|
||||
|
||||
val_bytes = regmap_get_val_bytes(component->regmap);
|
||||
if (val_bytes < 0)
|
||||
return 0;
|
||||
|
||||
return val_bytes;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_regmap_val_bytes);
|
||||
|
||||
#ifdef CONFIG_REGMAP
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user