mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 17:41:22 +00:00
ASoC: cs42l43: Minor code tidy ups
Add some missing commas, refactor a couple small bits of code. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://msgid.link/r/20240125103117.2622095-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
fb430b0639
commit
40f6281c1e
@ -29,11 +29,11 @@
|
||||
#include "cs42l43.h"
|
||||
|
||||
static const unsigned int cs42l43_accdet_us[] = {
|
||||
20, 100, 1000, 10000, 50000, 75000, 100000, 200000
|
||||
20, 100, 1000, 10000, 50000, 75000, 100000, 200000,
|
||||
};
|
||||
|
||||
static const unsigned int cs42l43_accdet_db_ms[] = {
|
||||
0, 125, 250, 500, 750, 1000, 1250, 1500
|
||||
0, 125, 250, 500, 750, 1000, 1250, 1500,
|
||||
};
|
||||
|
||||
static const unsigned int cs42l43_accdet_ramp_ms[] = { 10, 40, 90, 170 };
|
||||
@ -851,6 +851,9 @@ static const char * const cs42l43_jack_text[] = {
|
||||
"Line-In", "Microphone", "Optical",
|
||||
};
|
||||
|
||||
static_assert(ARRAY_SIZE(cs42l43_jack_override_modes) ==
|
||||
ARRAY_SIZE(cs42l43_jack_text) - 1);
|
||||
|
||||
SOC_ENUM_SINGLE_VIRT_DECL(cs42l43_jack_enum, cs42l43_jack_text);
|
||||
|
||||
int cs42l43_jack_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
||||
@ -873,9 +876,6 @@ int cs42l43_jack_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *u
|
||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||
unsigned int override = ucontrol->value.integer.value[0];
|
||||
|
||||
BUILD_BUG_ON(ARRAY_SIZE(cs42l43_jack_override_modes) !=
|
||||
ARRAY_SIZE(cs42l43_jack_text) - 1);
|
||||
|
||||
if (override >= e->items)
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -1059,12 +1059,10 @@ static int cs42l43_decim_get(struct snd_kcontrol *kcontrol,
|
||||
int ret;
|
||||
|
||||
ret = cs42l43_shutter_get(priv, CS42L43_STATUS_MIC_SHUTTER_MUTE_SHIFT);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
ret = cs42l43_dapm_get_volsw(kcontrol, ucontrol);
|
||||
else if (!ret)
|
||||
ucontrol->value.integer.value[0] = ret;
|
||||
else
|
||||
ret = cs42l43_dapm_get_volsw(kcontrol, ucontrol);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -1077,12 +1075,10 @@ static int cs42l43_spk_get(struct snd_kcontrol *kcontrol,
|
||||
int ret;
|
||||
|
||||
ret = cs42l43_shutter_get(priv, CS42L43_STATUS_SPK_SHUTTER_MUTE_SHIFT);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
ret = snd_soc_get_volsw(kcontrol, ucontrol);
|
||||
else if (!ret)
|
||||
ucontrol->value.integer.value[0] = ret;
|
||||
else
|
||||
ret = snd_soc_get_volsw(kcontrol, ucontrol);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user