diff options
Diffstat (limited to 'sound/soc/codecs/wm8983.c')
-rw-r--r-- | sound/soc/codecs/wm8983.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c index aa41ba0dfff4..58f0551eed2d 100644 --- a/sound/soc/codecs/wm8983.c +++ b/sound/soc/codecs/wm8983.c | |||
@@ -205,49 +205,44 @@ static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0); | |||
205 | static const DECLARE_TLV_DB_SCALE(pga_boost_tlv, 0, 2000, 0); | 205 | static const DECLARE_TLV_DB_SCALE(pga_boost_tlv, 0, 2000, 0); |
206 | 206 | ||
207 | static const char *alc_sel_text[] = { "Off", "Right", "Left", "Stereo" }; | 207 | static const char *alc_sel_text[] = { "Off", "Right", "Left", "Stereo" }; |
208 | static const SOC_ENUM_SINGLE_DECL(alc_sel, WM8983_ALC_CONTROL_1, 7, | 208 | static SOC_ENUM_SINGLE_DECL(alc_sel, WM8983_ALC_CONTROL_1, 7, alc_sel_text); |
209 | alc_sel_text); | ||
210 | 209 | ||
211 | static const char *alc_mode_text[] = { "ALC", "Limiter" }; | 210 | static const char *alc_mode_text[] = { "ALC", "Limiter" }; |
212 | static const SOC_ENUM_SINGLE_DECL(alc_mode, WM8983_ALC_CONTROL_3, 8, | 211 | static SOC_ENUM_SINGLE_DECL(alc_mode, WM8983_ALC_CONTROL_3, 8, alc_mode_text); |
213 | alc_mode_text); | ||
214 | 212 | ||
215 | static const char *filter_mode_text[] = { "Audio", "Application" }; | 213 | static const char *filter_mode_text[] = { "Audio", "Application" }; |
216 | static const SOC_ENUM_SINGLE_DECL(filter_mode, WM8983_ADC_CONTROL, 7, | 214 | static SOC_ENUM_SINGLE_DECL(filter_mode, WM8983_ADC_CONTROL, 7, |
217 | filter_mode_text); | 215 | filter_mode_text); |
218 | 216 | ||
219 | static const char *eq_bw_text[] = { "Narrow", "Wide" }; | 217 | static const char *eq_bw_text[] = { "Narrow", "Wide" }; |
220 | static const char *eqmode_text[] = { "Capture", "Playback" }; | 218 | static const char *eqmode_text[] = { "Capture", "Playback" }; |
221 | static const SOC_ENUM_SINGLE_EXT_DECL(eqmode, eqmode_text); | 219 | static SOC_ENUM_SINGLE_EXT_DECL(eqmode, eqmode_text); |
222 | 220 | ||
223 | static const char *eq1_cutoff_text[] = { | 221 | static const char *eq1_cutoff_text[] = { |
224 | "80Hz", "105Hz", "135Hz", "175Hz" | 222 | "80Hz", "105Hz", "135Hz", "175Hz" |
225 | }; | 223 | }; |
226 | static const SOC_ENUM_SINGLE_DECL(eq1_cutoff, WM8983_EQ1_LOW_SHELF, 5, | 224 | static SOC_ENUM_SINGLE_DECL(eq1_cutoff, WM8983_EQ1_LOW_SHELF, 5, |
227 | eq1_cutoff_text); | 225 | eq1_cutoff_text); |
228 | static const char *eq2_cutoff_text[] = { | 226 | static const char *eq2_cutoff_text[] = { |
229 | "230Hz", "300Hz", "385Hz", "500Hz" | 227 | "230Hz", "300Hz", "385Hz", "500Hz" |
230 | }; | 228 | }; |
231 | static const SOC_ENUM_SINGLE_DECL(eq2_bw, WM8983_EQ2_PEAK_1, 8, eq_bw_text); | 229 | static SOC_ENUM_SINGLE_DECL(eq2_bw, WM8983_EQ2_PEAK_1, 8, eq_bw_text); |
232 | static const SOC_ENUM_SINGLE_DECL(eq2_cutoff, WM8983_EQ2_PEAK_1, 5, | 230 | static SOC_ENUM_SINGLE_DECL(eq2_cutoff, WM8983_EQ2_PEAK_1, 5, eq2_cutoff_text); |
233 | eq2_cutoff_text); | ||
234 | static const char *eq3_cutoff_text[] = { | 231 | static const char *eq3_cutoff_text[] = { |
235 | "650Hz", "850Hz", "1.1kHz", "1.4kHz" | 232 | "650Hz", "850Hz", "1.1kHz", "1.4kHz" |
236 | }; | 233 | }; |
237 | static const SOC_ENUM_SINGLE_DECL(eq3_bw, WM8983_EQ3_PEAK_2, 8, eq_bw_text); | 234 | static SOC_ENUM_SINGLE_DECL(eq3_bw, WM8983_EQ3_PEAK_2, 8, eq_bw_text); |
238 | static const SOC_ENUM_SINGLE_DECL(eq3_cutoff, WM8983_EQ3_PEAK_2, 5, | 235 | static SOC_ENUM_SINGLE_DECL(eq3_cutoff, WM8983_EQ3_PEAK_2, 5, eq3_cutoff_text); |
239 | eq3_cutoff_text); | ||
240 | static const char *eq4_cutoff_text[] = { | 236 | static const char *eq4_cutoff_text[] = { |
241 | "1.8kHz", "2.4kHz", "3.2kHz", "4.1kHz" | 237 | "1.8kHz", "2.4kHz", "3.2kHz", "4.1kHz" |
242 | }; | 238 | }; |
243 | static const SOC_ENUM_SINGLE_DECL(eq4_bw, WM8983_EQ4_PEAK_3, 8, eq_bw_text); | 239 | static SOC_ENUM_SINGLE_DECL(eq4_bw, WM8983_EQ4_PEAK_3, 8, eq_bw_text); |
244 | static const SOC_ENUM_SINGLE_DECL(eq4_cutoff, WM8983_EQ4_PEAK_3, 5, | 240 | static SOC_ENUM_SINGLE_DECL(eq4_cutoff, WM8983_EQ4_PEAK_3, 5, eq4_cutoff_text); |
245 | eq4_cutoff_text); | ||
246 | static const char *eq5_cutoff_text[] = { | 241 | static const char *eq5_cutoff_text[] = { |
247 | "5.3kHz", "6.9kHz", "9kHz", "11.7kHz" | 242 | "5.3kHz", "6.9kHz", "9kHz", "11.7kHz" |
248 | }; | 243 | }; |
249 | static const SOC_ENUM_SINGLE_DECL(eq5_cutoff, WM8983_EQ5_HIGH_SHELF, 5, | 244 | static SOC_ENUM_SINGLE_DECL(eq5_cutoff, WM8983_EQ5_HIGH_SHELF, 5, |
250 | eq5_cutoff_text); | 245 | eq5_cutoff_text); |
251 | 246 | ||
252 | static const char *depth_3d_text[] = { | 247 | static const char *depth_3d_text[] = { |
253 | "Off", | 248 | "Off", |
@@ -267,8 +262,8 @@ static const char *depth_3d_text[] = { | |||
267 | "93.3%", | 262 | "93.3%", |
268 | "100%" | 263 | "100%" |
269 | }; | 264 | }; |
270 | static const SOC_ENUM_SINGLE_DECL(depth_3d, WM8983_3D_CONTROL, 0, | 265 | static SOC_ENUM_SINGLE_DECL(depth_3d, WM8983_3D_CONTROL, 0, |
271 | depth_3d_text); | 266 | depth_3d_text); |
272 | 267 | ||
273 | static const struct snd_kcontrol_new wm8983_snd_controls[] = { | 268 | static const struct snd_kcontrol_new wm8983_snd_controls[] = { |
274 | SOC_SINGLE("Digital Loopback Switch", WM8983_COMPANDING_CONTROL, | 269 | SOC_SINGLE("Digital Loopback Switch", WM8983_COMPANDING_CONTROL, |
@@ -1129,7 +1124,7 @@ static struct spi_driver wm8983_spi_driver = { | |||
1129 | }; | 1124 | }; |
1130 | #endif | 1125 | #endif |
1131 | 1126 | ||
1132 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 1127 | #if IS_ENABLED(CONFIG_I2C) |
1133 | static int wm8983_i2c_probe(struct i2c_client *i2c, | 1128 | static int wm8983_i2c_probe(struct i2c_client *i2c, |
1134 | const struct i2c_device_id *id) | 1129 | const struct i2c_device_id *id) |
1135 | { | 1130 | { |
@@ -1182,7 +1177,7 @@ static int __init wm8983_modinit(void) | |||
1182 | { | 1177 | { |
1183 | int ret = 0; | 1178 | int ret = 0; |
1184 | 1179 | ||
1185 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 1180 | #if IS_ENABLED(CONFIG_I2C) |
1186 | ret = i2c_add_driver(&wm8983_i2c_driver); | 1181 | ret = i2c_add_driver(&wm8983_i2c_driver); |
1187 | if (ret) { | 1182 | if (ret) { |
1188 | printk(KERN_ERR "Failed to register wm8983 I2C driver: %d\n", | 1183 | printk(KERN_ERR "Failed to register wm8983 I2C driver: %d\n", |
@@ -1202,7 +1197,7 @@ module_init(wm8983_modinit); | |||
1202 | 1197 | ||
1203 | static void __exit wm8983_exit(void) | 1198 | static void __exit wm8983_exit(void) |
1204 | { | 1199 | { |
1205 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 1200 | #if IS_ENABLED(CONFIG_I2C) |
1206 | i2c_del_driver(&wm8983_i2c_driver); | 1201 | i2c_del_driver(&wm8983_i2c_driver); |
1207 | #endif | 1202 | #endif |
1208 | #if defined(CONFIG_SPI_MASTER) | 1203 | #if defined(CONFIG_SPI_MASTER) |