Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codecs: tas5720: split a tas5720_mute_soc_component() function

This is to be re-used in tas5720_mute() (which is part of the dai_ops) and
also in the tas5720_fault_check_work() hook.

The benefit here isn't too great (now).
It's only when we add support for a new device with a slightly different
regmap that this becomes more useful.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230128082744.41849-1-alex@shruggie.ro
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Alexandru Ardelean and committed by
Mark Brown
879142be 21d64f6f

+7 -4
+7 -4
sound/soc/codecs/tas5720.c
··· 199 199 return ret; 200 200 } 201 201 202 - static int tas5720_mute(struct snd_soc_dai *dai, int mute, int direction) 202 + static int tas5720_mute_soc_component(struct snd_soc_component *component, int mute) 203 203 { 204 - struct snd_soc_component *component = dai->component; 205 204 int ret; 206 205 207 206 ret = snd_soc_component_update_bits(component, TAS5720_DIGITAL_CTRL2_REG, ··· 211 212 } 212 213 213 214 return 0; 215 + } 216 + 217 + static int tas5720_mute(struct snd_soc_dai *dai, int mute, int direction) 218 + { 219 + return tas5720_mute_soc_component(dai->component, mute); 214 220 } 215 221 216 222 static void tas5720_fault_check_work(struct work_struct *work) ··· 322 318 expected_device_id, device_id); 323 319 324 320 /* Set device to mute */ 325 - ret = snd_soc_component_update_bits(component, TAS5720_DIGITAL_CTRL2_REG, 326 - TAS5720_MUTE, TAS5720_MUTE); 321 + ret = tas5720_mute_soc_component(component, 1); 327 322 if (ret < 0) 328 323 goto error_snd_soc_component_update_bits; 329 324