diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-30 16:03:44 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-12-02 07:00:12 -0500 |
commit | 59f7297014b7e96779493f132eed04a3d44565df (patch) | |
tree | d7ccdf36f4a8175f9ba630b81577720677e5ebc7 /sound/soc/codecs/wm8731.c | |
parent | d921184e82e828e9c0bc3958f838decaaa9191a8 (diff) |
ASoC: Split WM8731 enumeration array into individual enums
This is much more maintainable than the array.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/wm8731.c')
-rw-r--r-- | sound/soc/codecs/wm8731.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index c90e0252972f..8003761a8e02 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -64,12 +64,15 @@ static const u16 wm8731_reg[WM8731_CACHEREGNUM] = { | |||
64 | #define wm8731_reset(c) snd_soc_write(c, WM8731_RESET, 0) | 64 | #define wm8731_reset(c) snd_soc_write(c, WM8731_RESET, 0) |
65 | 65 | ||
66 | static const char *wm8731_input_select[] = {"Line In", "Mic"}; | 66 | static const char *wm8731_input_select[] = {"Line In", "Mic"}; |
67 | |||
67 | static const char *wm8731_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"}; | 68 | static const char *wm8731_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"}; |
68 | 69 | ||
69 | static const struct soc_enum wm8731_enum[] = { | 70 | static const struct soc_enum wm8731_insel_enum = |
70 | SOC_ENUM_SINGLE(WM8731_APANA, 2, 2, wm8731_input_select), | 71 | SOC_ENUM_SINGLE(WM8731_APANA, 2, 2, wm8731_input_select); |
71 | SOC_ENUM_SINGLE(WM8731_APDIGI, 1, 4, wm8731_deemph), | 72 | |
72 | }; | 73 | static const struct soc_enum wm8731_deemph_enum = |
74 | SOC_ENUM_SINGLE(WM8731_APDIGI, 1, 4, wm8731_deemph); | ||
75 | |||
73 | 76 | ||
74 | static const DECLARE_TLV_DB_SCALE(in_tlv, -3450, 150, 0); | 77 | static const DECLARE_TLV_DB_SCALE(in_tlv, -3450, 150, 0); |
75 | static const DECLARE_TLV_DB_SCALE(sidetone_tlv, -1500, 300, 0); | 78 | static const DECLARE_TLV_DB_SCALE(sidetone_tlv, -1500, 300, 0); |
@@ -96,7 +99,7 @@ SOC_SINGLE_TLV("Sidetone Playback Volume", WM8731_APANA, 6, 3, 1, | |||
96 | SOC_SINGLE("ADC High Pass Filter Switch", WM8731_APDIGI, 0, 1, 1), | 99 | SOC_SINGLE("ADC High Pass Filter Switch", WM8731_APDIGI, 0, 1, 1), |
97 | SOC_SINGLE("Store DC Offset Switch", WM8731_APDIGI, 4, 1, 0), | 100 | SOC_SINGLE("Store DC Offset Switch", WM8731_APDIGI, 4, 1, 0), |
98 | 101 | ||
99 | SOC_ENUM("Playback De-emphasis", wm8731_enum[1]), | 102 | SOC_ENUM("Playback De-emphasis", wm8731_deemph_enum), |
100 | }; | 103 | }; |
101 | 104 | ||
102 | /* Output Mixer */ | 105 | /* Output Mixer */ |
@@ -108,7 +111,7 @@ SOC_DAPM_SINGLE("HiFi Playback Switch", WM8731_APANA, 4, 1, 0), | |||
108 | 111 | ||
109 | /* Input mux */ | 112 | /* Input mux */ |
110 | static const struct snd_kcontrol_new wm8731_input_mux_controls = | 113 | static const struct snd_kcontrol_new wm8731_input_mux_controls = |
111 | SOC_DAPM_ENUM("Input Select", wm8731_enum[0]); | 114 | SOC_DAPM_ENUM("Input Select", wm8731_insel_enum); |
112 | 115 | ||
113 | static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { | 116 | static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { |
114 | SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), | 117 | SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), |