ASoC: cs42l52: Use case range at appropriate place
The readable registers are in continuous range: 0x01 ~ 0x34. Use case range syntax makes the code shorter with better readability when we have a large number of continuous switch cases. No functional change with this patch. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
bc0195aad0
commit
4caae9546d
|
@ -110,58 +110,7 @@ static const struct reg_default cs42l52_reg_defaults[] = {
|
|||
static bool cs42l52_readable_register(struct device *dev, unsigned int reg)
|
||||
{
|
||||
switch (reg) {
|
||||
case CS42L52_CHIP:
|
||||
case CS42L52_PWRCTL1:
|
||||
case CS42L52_PWRCTL2:
|
||||
case CS42L52_PWRCTL3:
|
||||
case CS42L52_CLK_CTL:
|
||||
case CS42L52_IFACE_CTL1:
|
||||
case CS42L52_IFACE_CTL2:
|
||||
case CS42L52_ADC_PGA_A:
|
||||
case CS42L52_ADC_PGA_B:
|
||||
case CS42L52_ANALOG_HPF_CTL:
|
||||
case CS42L52_ADC_HPF_FREQ:
|
||||
case CS42L52_ADC_MISC_CTL:
|
||||
case CS42L52_PB_CTL1:
|
||||
case CS42L52_MISC_CTL:
|
||||
case CS42L52_PB_CTL2:
|
||||
case CS42L52_MICA_CTL:
|
||||
case CS42L52_MICB_CTL:
|
||||
case CS42L52_PGAA_CTL:
|
||||
case CS42L52_PGAB_CTL:
|
||||
case CS42L52_PASSTHRUA_VOL:
|
||||
case CS42L52_PASSTHRUB_VOL:
|
||||
case CS42L52_ADCA_VOL:
|
||||
case CS42L52_ADCB_VOL:
|
||||
case CS42L52_ADCA_MIXER_VOL:
|
||||
case CS42L52_ADCB_MIXER_VOL:
|
||||
case CS42L52_PCMA_MIXER_VOL:
|
||||
case CS42L52_PCMB_MIXER_VOL:
|
||||
case CS42L52_BEEP_FREQ:
|
||||
case CS42L52_BEEP_VOL:
|
||||
case CS42L52_BEEP_TONE_CTL:
|
||||
case CS42L52_TONE_CTL:
|
||||
case CS42L52_MASTERA_VOL:
|
||||
case CS42L52_MASTERB_VOL:
|
||||
case CS42L52_HPA_VOL:
|
||||
case CS42L52_HPB_VOL:
|
||||
case CS42L52_SPKA_VOL:
|
||||
case CS42L52_SPKB_VOL:
|
||||
case CS42L52_ADC_PCM_MIXER:
|
||||
case CS42L52_LIMITER_CTL1:
|
||||
case CS42L52_LIMITER_CTL2:
|
||||
case CS42L52_LIMITER_AT_RATE:
|
||||
case CS42L52_ALC_CTL:
|
||||
case CS42L52_ALC_RATE:
|
||||
case CS42L52_ALC_THRESHOLD:
|
||||
case CS42L52_NOISE_GATE_CTL:
|
||||
case CS42L52_CLK_STATUS:
|
||||
case CS42L52_BATT_COMPEN:
|
||||
case CS42L52_BATT_LEVEL:
|
||||
case CS42L52_SPK_STATUS:
|
||||
case CS42L52_TEM_CTL:
|
||||
case CS42L52_THE_FOLDBACK:
|
||||
case CS42L52_CHARGE_PUMP:
|
||||
case CS42L52_CHIP ... CS42L52_CHARGE_PUMP:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue