diff options
| -rw-r--r-- | drivers/extcon/extcon-arizona.c | 12 | ||||
| -rw-r--r-- | drivers/input/misc/arizona-haptics.c | 19 | ||||
| -rw-r--r-- | include/sound/soc-dapm.h | 8 | ||||
| -rw-r--r-- | sound/pci/hda/patch_realtek.c | 48 | ||||
| -rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 20 | ||||
| -rw-r--r-- | sound/soc/codecs/ad1980.c | 4 | ||||
| -rw-r--r-- | sound/soc/codecs/da732x.c | 12 | ||||
| -rw-r--r-- | sound/soc/codecs/isabelle.c | 52 | ||||
| -rw-r--r-- | sound/soc/codecs/sta32x.c | 76 | ||||
| -rw-r--r-- | sound/soc/codecs/wm8400.c | 34 | ||||
| -rw-r--r-- | sound/soc/codecs/wm8770.c | 4 | ||||
| -rw-r--r-- | sound/soc/codecs/wm8900.c | 44 | ||||
| -rw-r--r-- | sound/soc/codecs/wm8958-dsp2.c | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/wm8994.c | 135 | ||||
| -rw-r--r-- | sound/soc/soc-dapm.c | 139 |
15 files changed, 399 insertions, 210 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index c20602f601ee..98a14f6143a7 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c | |||
| @@ -222,27 +222,19 @@ static void arizona_extcon_pulse_micbias(struct arizona_extcon_info *info) | |||
| 222 | struct snd_soc_dapm_context *dapm = arizona->dapm; | 222 | struct snd_soc_dapm_context *dapm = arizona->dapm; |
| 223 | int ret; | 223 | int ret; |
| 224 | 224 | ||
| 225 | mutex_lock(&dapm->card->dapm_mutex); | ||
| 226 | |||
| 227 | ret = snd_soc_dapm_force_enable_pin(dapm, widget); | 225 | ret = snd_soc_dapm_force_enable_pin(dapm, widget); |
| 228 | if (ret != 0) | 226 | if (ret != 0) |
| 229 | dev_warn(arizona->dev, "Failed to enable %s: %d\n", | 227 | dev_warn(arizona->dev, "Failed to enable %s: %d\n", |
| 230 | widget, ret); | 228 | widget, ret); |
| 231 | 229 | ||
| 232 | mutex_unlock(&dapm->card->dapm_mutex); | ||
| 233 | |||
| 234 | snd_soc_dapm_sync(dapm); | 230 | snd_soc_dapm_sync(dapm); |
| 235 | 231 | ||
| 236 | if (!arizona->pdata.micd_force_micbias) { | 232 | if (!arizona->pdata.micd_force_micbias) { |
| 237 | mutex_lock(&dapm->card->dapm_mutex); | ||
| 238 | |||
| 239 | ret = snd_soc_dapm_disable_pin(arizona->dapm, widget); | 233 | ret = snd_soc_dapm_disable_pin(arizona->dapm, widget); |
| 240 | if (ret != 0) | 234 | if (ret != 0) |
| 241 | dev_warn(arizona->dev, "Failed to disable %s: %d\n", | 235 | dev_warn(arizona->dev, "Failed to disable %s: %d\n", |
| 242 | widget, ret); | 236 | widget, ret); |
| 243 | 237 | ||
| 244 | mutex_unlock(&dapm->card->dapm_mutex); | ||
| 245 | |||
| 246 | snd_soc_dapm_sync(dapm); | 238 | snd_soc_dapm_sync(dapm); |
| 247 | } | 239 | } |
| 248 | } | 240 | } |
| @@ -304,16 +296,12 @@ static void arizona_stop_mic(struct arizona_extcon_info *info) | |||
| 304 | ARIZONA_MICD_ENA, 0, | 296 | ARIZONA_MICD_ENA, 0, |
| 305 | &change); | 297 | &change); |
| 306 | 298 | ||
| 307 | mutex_lock(&dapm->card->dapm_mutex); | ||
| 308 | |||
| 309 | ret = snd_soc_dapm_disable_pin(dapm, widget); | 299 | ret = snd_soc_dapm_disable_pin(dapm, widget); |
| 310 | if (ret != 0) | 300 | if (ret != 0) |
| 311 | dev_warn(arizona->dev, | 301 | dev_warn(arizona->dev, |
| 312 | "Failed to disable %s: %d\n", | 302 | "Failed to disable %s: %d\n", |
| 313 | widget, ret); | 303 | widget, ret); |
| 314 | 304 | ||
| 315 | mutex_unlock(&dapm->card->dapm_mutex); | ||
| 316 | |||
| 317 | snd_soc_dapm_sync(dapm); | 305 | snd_soc_dapm_sync(dapm); |
| 318 | 306 | ||
| 319 | if (info->micd_reva) { | 307 | if (info->micd_reva) { |
diff --git a/drivers/input/misc/arizona-haptics.c b/drivers/input/misc/arizona-haptics.c index 7a04f54ef961..ef2e281b0a43 100644 --- a/drivers/input/misc/arizona-haptics.c +++ b/drivers/input/misc/arizona-haptics.c | |||
| @@ -37,7 +37,6 @@ static void arizona_haptics_work(struct work_struct *work) | |||
| 37 | struct arizona_haptics, | 37 | struct arizona_haptics, |
| 38 | work); | 38 | work); |
| 39 | struct arizona *arizona = haptics->arizona; | 39 | struct arizona *arizona = haptics->arizona; |
| 40 | struct mutex *dapm_mutex = &arizona->dapm->card->dapm_mutex; | ||
| 41 | int ret; | 40 | int ret; |
| 42 | 41 | ||
| 43 | if (!haptics->arizona->dapm) { | 42 | if (!haptics->arizona->dapm) { |
| @@ -67,13 +66,10 @@ static void arizona_haptics_work(struct work_struct *work) | |||
| 67 | return; | 66 | return; |
| 68 | } | 67 | } |
| 69 | 68 | ||
| 70 | mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | ||
| 71 | |||
| 72 | ret = snd_soc_dapm_enable_pin(arizona->dapm, "HAPTICS"); | 69 | ret = snd_soc_dapm_enable_pin(arizona->dapm, "HAPTICS"); |
| 73 | if (ret != 0) { | 70 | if (ret != 0) { |
| 74 | dev_err(arizona->dev, "Failed to start HAPTICS: %d\n", | 71 | dev_err(arizona->dev, "Failed to start HAPTICS: %d\n", |
| 75 | ret); | 72 | ret); |
| 76 | mutex_unlock(dapm_mutex); | ||
| 77 | return; | 73 | return; |
| 78 | } | 74 | } |
| 79 | 75 | ||
| @@ -81,21 +77,14 @@ static void arizona_haptics_work(struct work_struct *work) | |||
| 81 | if (ret != 0) { | 77 | if (ret != 0) { |
| 82 | dev_err(arizona->dev, "Failed to sync DAPM: %d\n", | 78 | dev_err(arizona->dev, "Failed to sync DAPM: %d\n", |
| 83 | ret); | 79 | ret); |
| 84 | mutex_unlock(dapm_mutex); | ||
| 85 | return; | 80 | return; |
| 86 | } | 81 | } |
| 87 | |||
| 88 | mutex_unlock(dapm_mutex); | ||
| 89 | |||
| 90 | } else { | 82 | } else { |
| 91 | /* This disable sequence will be a noop if already enabled */ | 83 | /* This disable sequence will be a noop if already enabled */ |
| 92 | mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | ||
| 93 | |||
| 94 | ret = snd_soc_dapm_disable_pin(arizona->dapm, "HAPTICS"); | 84 | ret = snd_soc_dapm_disable_pin(arizona->dapm, "HAPTICS"); |
| 95 | if (ret != 0) { | 85 | if (ret != 0) { |
| 96 | dev_err(arizona->dev, "Failed to disable HAPTICS: %d\n", | 86 | dev_err(arizona->dev, "Failed to disable HAPTICS: %d\n", |
| 97 | ret); | 87 | ret); |
| 98 | mutex_unlock(dapm_mutex); | ||
| 99 | return; | 88 | return; |
| 100 | } | 89 | } |
| 101 | 90 | ||
| @@ -103,12 +92,9 @@ static void arizona_haptics_work(struct work_struct *work) | |||
| 103 | if (ret != 0) { | 92 | if (ret != 0) { |
| 104 | dev_err(arizona->dev, "Failed to sync DAPM: %d\n", | 93 | dev_err(arizona->dev, "Failed to sync DAPM: %d\n", |
| 105 | ret); | 94 | ret); |
| 106 | mutex_unlock(dapm_mutex); | ||
| 107 | return; | 95 | return; |
| 108 | } | 96 | } |
| 109 | 97 | ||
| 110 | mutex_unlock(dapm_mutex); | ||
| 111 | |||
| 112 | ret = regmap_update_bits(arizona->regmap, | 98 | ret = regmap_update_bits(arizona->regmap, |
| 113 | ARIZONA_HAPTICS_CONTROL_1, | 99 | ARIZONA_HAPTICS_CONTROL_1, |
| 114 | ARIZONA_HAP_CTRL_MASK, | 100 | ARIZONA_HAP_CTRL_MASK, |
| @@ -155,16 +141,11 @@ static int arizona_haptics_play(struct input_dev *input, void *data, | |||
| 155 | static void arizona_haptics_close(struct input_dev *input) | 141 | static void arizona_haptics_close(struct input_dev *input) |
| 156 | { | 142 | { |
| 157 | struct arizona_haptics *haptics = input_get_drvdata(input); | 143 | struct arizona_haptics *haptics = input_get_drvdata(input); |
| 158 | struct mutex *dapm_mutex = &haptics->arizona->dapm->card->dapm_mutex; | ||
| 159 | 144 | ||
| 160 | cancel_work_sync(&haptics->work); | 145 | cancel_work_sync(&haptics->work); |
| 161 | 146 | ||
| 162 | mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | ||
| 163 | |||
| 164 | if (haptics->arizona->dapm) | 147 | if (haptics->arizona->dapm) |
| 165 | snd_soc_dapm_disable_pin(haptics->arizona->dapm, "HAPTICS"); | 148 | snd_soc_dapm_disable_pin(haptics->arizona->dapm, "HAPTICS"); |
| 166 | |||
| 167 | mutex_unlock(dapm_mutex); | ||
| 168 | } | 149 | } |
| 169 | 150 | ||
| 170 | static int arizona_haptics_probe(struct platform_device *pdev) | 151 | static int arizona_haptics_probe(struct platform_device *pdev) |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 68d92e36facd..6e89ef6c11c1 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -449,14 +449,22 @@ void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, | |||
| 449 | /* dapm audio pin control and status */ | 449 | /* dapm audio pin control and status */ |
| 450 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, | 450 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, |
| 451 | const char *pin); | 451 | const char *pin); |
| 452 | int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, | ||
| 453 | const char *pin); | ||
| 452 | int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, | 454 | int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, |
| 453 | const char *pin); | 455 | const char *pin); |
| 456 | int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, | ||
| 457 | const char *pin); | ||
| 454 | int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); | 458 | int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); |
| 459 | int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, | ||
| 460 | const char *pin); | ||
| 455 | int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, | 461 | int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, |
| 456 | const char *pin); | 462 | const char *pin); |
| 457 | int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); | 463 | int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); |
| 458 | int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | 464 | int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, |
| 459 | const char *pin); | 465 | const char *pin); |
| 466 | int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, | ||
| 467 | const char *pin); | ||
| 460 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, | 468 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
| 461 | const char *pin); | 469 | const char *pin); |
| 462 | void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec); | 470 | void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 6eb903cc6237..ec304f3ae3b4 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -4319,6 +4319,54 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
| 4319 | SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4319 | SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4320 | SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4320 | SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4321 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), | 4321 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
| 4322 | /* ALC282 */ | ||
| 4323 | SND_PCI_QUIRK(0x103c, 0x220f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4324 | SND_PCI_QUIRK(0x103c, 0x2213, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4325 | SND_PCI_QUIRK(0x103c, 0x2266, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4326 | SND_PCI_QUIRK(0x103c, 0x2267, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4327 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4328 | SND_PCI_QUIRK(0x103c, 0x2269, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4329 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4330 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4331 | SND_PCI_QUIRK(0x103c, 0x227a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4332 | SND_PCI_QUIRK(0x103c, 0x227b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4333 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4334 | SND_PCI_QUIRK(0x103c, 0x22a0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4335 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4336 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4337 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4338 | SND_PCI_QUIRK(0x103c, 0x22c0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4339 | SND_PCI_QUIRK(0x103c, 0x22c1, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4340 | SND_PCI_QUIRK(0x103c, 0x22c2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4341 | SND_PCI_QUIRK(0x103c, 0x22cd, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4342 | SND_PCI_QUIRK(0x103c, 0x22ce, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4343 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4344 | SND_PCI_QUIRK(0x103c, 0x22d0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4345 | /* ALC290 */ | ||
| 4346 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4347 | SND_PCI_QUIRK(0x103c, 0x2261, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4348 | SND_PCI_QUIRK(0x103c, 0x2262, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4349 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4350 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4351 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4352 | SND_PCI_QUIRK(0x103c, 0x227d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4353 | SND_PCI_QUIRK(0x103c, 0x227e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4354 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4355 | SND_PCI_QUIRK(0x103c, 0x2280, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4356 | SND_PCI_QUIRK(0x103c, 0x2281, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4357 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4358 | SND_PCI_QUIRK(0x103c, 0x2289, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4359 | SND_PCI_QUIRK(0x103c, 0x228a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4360 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4361 | SND_PCI_QUIRK(0x103c, 0x228c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4362 | SND_PCI_QUIRK(0x103c, 0x228d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4363 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4364 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4365 | SND_PCI_QUIRK(0x103c, 0x22c6, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4366 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4367 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4368 | SND_PCI_QUIRK(0x103c, 0x22c3, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4369 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
| 4322 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), | 4370 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 4323 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), | 4371 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
| 4324 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 4372 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index a2f11bf8155c..3bc29c9b2529 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
| @@ -98,6 +98,7 @@ enum { | |||
| 98 | STAC_92HD83XXX_HP_LED, | 98 | STAC_92HD83XXX_HP_LED, |
| 99 | STAC_92HD83XXX_HP_INV_LED, | 99 | STAC_92HD83XXX_HP_INV_LED, |
| 100 | STAC_92HD83XXX_HP_MIC_LED, | 100 | STAC_92HD83XXX_HP_MIC_LED, |
| 101 | STAC_HP_LED_GPIO10, | ||
| 101 | STAC_92HD83XXX_HEADSET_JACK, | 102 | STAC_92HD83XXX_HEADSET_JACK, |
| 102 | STAC_92HD83XXX_HP, | 103 | STAC_92HD83XXX_HP, |
| 103 | STAC_HP_ENVY_BASS, | 104 | STAC_HP_ENVY_BASS, |
| @@ -2130,6 +2131,17 @@ static void stac92hd83xxx_fixup_hp_mic_led(struct hda_codec *codec, | |||
| 2130 | } | 2131 | } |
| 2131 | } | 2132 | } |
| 2132 | 2133 | ||
| 2134 | static void stac92hd83xxx_fixup_hp_led_gpio10(struct hda_codec *codec, | ||
| 2135 | const struct hda_fixup *fix, int action) | ||
| 2136 | { | ||
| 2137 | struct sigmatel_spec *spec = codec->spec; | ||
| 2138 | |||
| 2139 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | ||
| 2140 | spec->gpio_led = 0x10; /* GPIO4 */ | ||
| 2141 | spec->default_polarity = 0; | ||
| 2142 | } | ||
| 2143 | } | ||
| 2144 | |||
| 2133 | static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec, | 2145 | static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec, |
| 2134 | const struct hda_fixup *fix, int action) | 2146 | const struct hda_fixup *fix, int action) |
| 2135 | { | 2147 | { |
| @@ -2624,6 +2636,12 @@ static const struct hda_fixup stac92hd83xxx_fixups[] = { | |||
| 2624 | .chained = true, | 2636 | .chained = true, |
| 2625 | .chain_id = STAC_92HD83XXX_HP, | 2637 | .chain_id = STAC_92HD83XXX_HP, |
| 2626 | }, | 2638 | }, |
| 2639 | [STAC_HP_LED_GPIO10] = { | ||
| 2640 | .type = HDA_FIXUP_FUNC, | ||
| 2641 | .v.func = stac92hd83xxx_fixup_hp_led_gpio10, | ||
| 2642 | .chained = true, | ||
| 2643 | .chain_id = STAC_92HD83XXX_HP, | ||
| 2644 | }, | ||
| 2627 | [STAC_92HD83XXX_HEADSET_JACK] = { | 2645 | [STAC_92HD83XXX_HEADSET_JACK] = { |
| 2628 | .type = HDA_FIXUP_FUNC, | 2646 | .type = HDA_FIXUP_FUNC, |
| 2629 | .v.func = stac92hd83xxx_fixup_headset_jack, | 2647 | .v.func = stac92hd83xxx_fixup_headset_jack, |
| @@ -2702,6 +2720,8 @@ static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = { | |||
| 2702 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), | 2720 | "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), |
| 2703 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1888, | 2721 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1888, |
| 2704 | "HP Envy Spectre", STAC_HP_ENVY_BASS), | 2722 | "HP Envy Spectre", STAC_HP_ENVY_BASS), |
| 2723 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1899, | ||
| 2724 | "HP Folio 13", STAC_HP_LED_GPIO10), | ||
| 2705 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18df, | 2725 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18df, |
| 2706 | "HP Folio", STAC_HP_BNB13_EQ), | 2726 | "HP Folio", STAC_HP_BNB13_EQ), |
| 2707 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18F8, | 2727 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18F8, |
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c index 7257a8885f42..34d965a4a040 100644 --- a/sound/soc/codecs/ad1980.c +++ b/sound/soc/codecs/ad1980.c | |||
| @@ -57,8 +57,8 @@ static const u16 ad1980_reg[] = { | |||
| 57 | static const char *ad1980_rec_sel[] = {"Mic", "CD", "NC", "AUX", "Line", | 57 | static const char *ad1980_rec_sel[] = {"Mic", "CD", "NC", "AUX", "Line", |
| 58 | "Stereo Mix", "Mono Mix", "Phone"}; | 58 | "Stereo Mix", "Mono Mix", "Phone"}; |
| 59 | 59 | ||
| 60 | static const struct soc_enum ad1980_cap_src = | 60 | static SOC_ENUM_DOUBLE_DECL(ad1980_cap_src, |
| 61 | SOC_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 7, ad1980_rec_sel); | 61 | AC97_REC_SEL, 8, 0, ad1980_rec_sel); |
| 62 | 62 | ||
| 63 | static const struct snd_kcontrol_new ad1980_snd_ac97_controls[] = { | 63 | static const struct snd_kcontrol_new ad1980_snd_ac97_controls[] = { |
| 64 | SOC_DOUBLE("Master Playback Volume", AC97_MASTER, 8, 0, 31, 1), | 64 | SOC_DOUBLE("Master Playback Volume", AC97_MASTER, 8, 0, 31, 1), |
diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c index f295b6569910..f4d965ebc29e 100644 --- a/sound/soc/codecs/da732x.c +++ b/sound/soc/codecs/da732x.c | |||
| @@ -1268,11 +1268,23 @@ static struct snd_soc_dai_driver da732x_dai[] = { | |||
| 1268 | }, | 1268 | }, |
| 1269 | }; | 1269 | }; |
| 1270 | 1270 | ||
| 1271 | static bool da732x_volatile(struct device *dev, unsigned int reg) | ||
| 1272 | { | ||
| 1273 | switch (reg) { | ||
| 1274 | case DA732X_REG_HPL_DAC_OFF_CNTL: | ||
| 1275 | case DA732X_REG_HPR_DAC_OFF_CNTL: | ||
| 1276 | return true; | ||
| 1277 | default: | ||
| 1278 | return false; | ||
| 1279 | } | ||
| 1280 | } | ||
| 1281 | |||
| 1271 | static const struct regmap_config da732x_regmap = { | 1282 | static const struct regmap_config da732x_regmap = { |
| 1272 | .reg_bits = 8, | 1283 | .reg_bits = 8, |
| 1273 | .val_bits = 8, | 1284 | .val_bits = 8, |
| 1274 | 1285 | ||
| 1275 | .max_register = DA732X_MAX_REG, | 1286 | .max_register = DA732X_MAX_REG, |
| 1287 | .volatile_reg = da732x_volatile, | ||
| 1276 | .reg_defaults = da732x_reg_cache, | 1288 | .reg_defaults = da732x_reg_cache, |
| 1277 | .num_reg_defaults = ARRAY_SIZE(da732x_reg_cache), | 1289 | .num_reg_defaults = ARRAY_SIZE(da732x_reg_cache), |
| 1278 | .cache_type = REGCACHE_RBTREE, | 1290 | .cache_type = REGCACHE_RBTREE, |
diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c index 5839048ec467..cb736ddc446d 100644 --- a/sound/soc/codecs/isabelle.c +++ b/sound/soc/codecs/isabelle.c | |||
| @@ -140,13 +140,17 @@ static const char *isabelle_rx1_texts[] = {"VRX1", "ARX1"}; | |||
| 140 | static const char *isabelle_rx2_texts[] = {"VRX2", "ARX2"}; | 140 | static const char *isabelle_rx2_texts[] = {"VRX2", "ARX2"}; |
| 141 | 141 | ||
| 142 | static const struct soc_enum isabelle_rx1_enum[] = { | 142 | static const struct soc_enum isabelle_rx1_enum[] = { |
| 143 | SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3, 1, isabelle_rx1_texts), | 143 | SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3, |
| 144 | SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5, 1, isabelle_rx1_texts), | 144 | ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts), |
| 145 | SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5, | ||
| 146 | ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts), | ||
| 145 | }; | 147 | }; |
| 146 | 148 | ||
| 147 | static const struct soc_enum isabelle_rx2_enum[] = { | 149 | static const struct soc_enum isabelle_rx2_enum[] = { |
| 148 | SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2, 1, isabelle_rx2_texts), | 150 | SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2, |
| 149 | SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4, 1, isabelle_rx2_texts), | 151 | ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts), |
| 152 | SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4, | ||
| 153 | ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts), | ||
| 150 | }; | 154 | }; |
| 151 | 155 | ||
| 152 | /* Headset DAC playback switches */ | 156 | /* Headset DAC playback switches */ |
| @@ -161,13 +165,17 @@ static const char *isabelle_atx_texts[] = {"AMIC1", "DMIC"}; | |||
| 161 | static const char *isabelle_vtx_texts[] = {"AMIC2", "DMIC"}; | 165 | static const char *isabelle_vtx_texts[] = {"AMIC2", "DMIC"}; |
| 162 | 166 | ||
| 163 | static const struct soc_enum isabelle_atx_enum[] = { | 167 | static const struct soc_enum isabelle_atx_enum[] = { |
| 164 | SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7, 1, isabelle_atx_texts), | 168 | SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7, |
| 165 | SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1, isabelle_atx_texts), | 169 | ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts), |
| 170 | SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, | ||
| 171 | ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts), | ||
| 166 | }; | 172 | }; |
| 167 | 173 | ||
| 168 | static const struct soc_enum isabelle_vtx_enum[] = { | 174 | static const struct soc_enum isabelle_vtx_enum[] = { |
| 169 | SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6, 1, isabelle_vtx_texts), | 175 | SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6, |
| 170 | SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1, isabelle_vtx_texts), | 176 | ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts), |
| 177 | SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, | ||
| 178 | ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts), | ||
| 171 | }; | 179 | }; |
| 172 | 180 | ||
| 173 | static const struct snd_kcontrol_new atx_mux_controls = | 181 | static const struct snd_kcontrol_new atx_mux_controls = |
| @@ -183,17 +191,13 @@ static const char *isabelle_amic1_texts[] = { | |||
| 183 | /* Left analog microphone selection */ | 191 | /* Left analog microphone selection */ |
| 184 | static const char *isabelle_amic2_texts[] = {"Sub Mic", "Aux/FM Right"}; | 192 | static const char *isabelle_amic2_texts[] = {"Sub Mic", "Aux/FM Right"}; |
| 185 | 193 | ||
| 186 | static const struct soc_enum isabelle_amic1_enum[] = { | 194 | static SOC_ENUM_SINGLE_DECL(isabelle_amic1_enum, |
| 187 | SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 5, | 195 | ISABELLE_AMIC_CFG_REG, 5, |
| 188 | ARRAY_SIZE(isabelle_amic1_texts), | 196 | isabelle_amic1_texts); |
| 189 | isabelle_amic1_texts), | ||
| 190 | }; | ||
| 191 | 197 | ||
| 192 | static const struct soc_enum isabelle_amic2_enum[] = { | 198 | static SOC_ENUM_SINGLE_DECL(isabelle_amic2_enum, |
| 193 | SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 4, | 199 | ISABELLE_AMIC_CFG_REG, 4, |
| 194 | ARRAY_SIZE(isabelle_amic2_texts), | 200 | isabelle_amic2_texts); |
| 195 | isabelle_amic2_texts), | ||
| 196 | }; | ||
| 197 | 201 | ||
| 198 | static const struct snd_kcontrol_new amic1_control = | 202 | static const struct snd_kcontrol_new amic1_control = |
| 199 | SOC_DAPM_ENUM("Route", isabelle_amic1_enum); | 203 | SOC_DAPM_ENUM("Route", isabelle_amic1_enum); |
| @@ -206,16 +210,20 @@ static const char *isabelle_st_audio_texts[] = {"ATX1", "ATX2"}; | |||
| 206 | static const char *isabelle_st_voice_texts[] = {"VTX1", "VTX2"}; | 210 | static const char *isabelle_st_voice_texts[] = {"VTX1", "VTX2"}; |
| 207 | 211 | ||
| 208 | static const struct soc_enum isabelle_st_audio_enum[] = { | 212 | static const struct soc_enum isabelle_st_audio_enum[] = { |
| 209 | SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7, 1, | 213 | SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7, |
| 214 | ARRAY_SIZE(isabelle_st_audio_texts), | ||
| 210 | isabelle_st_audio_texts), | 215 | isabelle_st_audio_texts), |
| 211 | SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7, 1, | 216 | SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7, |
| 217 | ARRAY_SIZE(isabelle_st_audio_texts), | ||
| 212 | isabelle_st_audio_texts), | 218 | isabelle_st_audio_texts), |
| 213 | }; | 219 | }; |
| 214 | 220 | ||
| 215 | static const struct soc_enum isabelle_st_voice_enum[] = { | 221 | static const struct soc_enum isabelle_st_voice_enum[] = { |
| 216 | SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7, 1, | 222 | SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7, |
| 223 | ARRAY_SIZE(isabelle_st_voice_texts), | ||
| 217 | isabelle_st_voice_texts), | 224 | isabelle_st_voice_texts), |
| 218 | SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7, 1, | 225 | SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7, |
| 226 | ARRAY_SIZE(isabelle_st_voice_texts), | ||
| 219 | isabelle_st_voice_texts), | 227 | isabelle_st_voice_texts), |
| 220 | }; | 228 | }; |
| 221 | 229 | ||
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index 06edb396e733..2735361a4c3c 100644 --- a/sound/soc/codecs/sta32x.c +++ b/sound/soc/codecs/sta32x.c | |||
| @@ -187,42 +187,42 @@ static const unsigned int sta32x_limiter_drc_release_tlv[] = { | |||
| 187 | 13, 16, TLV_DB_SCALE_ITEM(-1500, 300, 0), | 187 | 13, 16, TLV_DB_SCALE_ITEM(-1500, 300, 0), |
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | static const struct soc_enum sta32x_drc_ac_enum = | 190 | static SOC_ENUM_SINGLE_DECL(sta32x_drc_ac_enum, |
| 191 | SOC_ENUM_SINGLE(STA32X_CONFD, STA32X_CONFD_DRC_SHIFT, | 191 | STA32X_CONFD, STA32X_CONFD_DRC_SHIFT, |
| 192 | 2, sta32x_drc_ac); | 192 | sta32x_drc_ac); |
| 193 | static const struct soc_enum sta32x_auto_eq_enum = | 193 | static SOC_ENUM_SINGLE_DECL(sta32x_auto_eq_enum, |
| 194 | SOC_ENUM_SINGLE(STA32X_AUTO1, STA32X_AUTO1_AMEQ_SHIFT, | 194 | STA32X_AUTO1, STA32X_AUTO1_AMEQ_SHIFT, |
| 195 | 3, sta32x_auto_eq_mode); | 195 | sta32x_auto_eq_mode); |
| 196 | static const struct soc_enum sta32x_auto_gc_enum = | 196 | static SOC_ENUM_SINGLE_DECL(sta32x_auto_gc_enum, |
| 197 | SOC_ENUM_SINGLE(STA32X_AUTO1, STA32X_AUTO1_AMGC_SHIFT, | 197 | STA32X_AUTO1, STA32X_AUTO1_AMGC_SHIFT, |
| 198 | 4, sta32x_auto_gc_mode); | 198 | sta32x_auto_gc_mode); |
| 199 | static const struct soc_enum sta32x_auto_xo_enum = | 199 | static SOC_ENUM_SINGLE_DECL(sta32x_auto_xo_enum, |
| 200 | SOC_ENUM_SINGLE(STA32X_AUTO2, STA32X_AUTO2_XO_SHIFT, | 200 | STA32X_AUTO2, STA32X_AUTO2_XO_SHIFT, |
| 201 | 16, sta32x_auto_xo_mode); | 201 | sta32x_auto_xo_mode); |
| 202 | static const struct soc_enum sta32x_preset_eq_enum = | 202 | static SOC_ENUM_SINGLE_DECL(sta32x_preset_eq_enum, |
| 203 | SOC_ENUM_SINGLE(STA32X_AUTO3, STA32X_AUTO3_PEQ_SHIFT, | 203 | STA32X_AUTO3, STA32X_AUTO3_PEQ_SHIFT, |
| 204 | 32, sta32x_preset_eq_mode); | 204 | sta32x_preset_eq_mode); |
| 205 | static const struct soc_enum sta32x_limiter_ch1_enum = | 205 | static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch1_enum, |
| 206 | SOC_ENUM_SINGLE(STA32X_C1CFG, STA32X_CxCFG_LS_SHIFT, | 206 | STA32X_C1CFG, STA32X_CxCFG_LS_SHIFT, |
| 207 | 3, sta32x_limiter_select); | 207 | sta32x_limiter_select); |
| 208 | static const struct soc_enum sta32x_limiter_ch2_enum = | 208 | static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch2_enum, |
| 209 | SOC_ENUM_SINGLE(STA32X_C2CFG, STA32X_CxCFG_LS_SHIFT, | 209 | STA32X_C2CFG, STA32X_CxCFG_LS_SHIFT, |
| 210 | 3, sta32x_limiter_select); | 210 | sta32x_limiter_select); |
| 211 | static const struct soc_enum sta32x_limiter_ch3_enum = | 211 | static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch3_enum, |
| 212 | SOC_ENUM_SINGLE(STA32X_C3CFG, STA32X_CxCFG_LS_SHIFT, | 212 | STA32X_C3CFG, STA32X_CxCFG_LS_SHIFT, |
| 213 | 3, sta32x_limiter_select); | 213 | sta32x_limiter_select); |
| 214 | static const struct soc_enum sta32x_limiter1_attack_rate_enum = | 214 | static SOC_ENUM_SINGLE_DECL(sta32x_limiter1_attack_rate_enum, |
| 215 | SOC_ENUM_SINGLE(STA32X_L1AR, STA32X_LxA_SHIFT, | 215 | STA32X_L1AR, STA32X_LxA_SHIFT, |
| 216 | 16, sta32x_limiter_attack_rate); | 216 | sta32x_limiter_attack_rate); |
| 217 | static const struct soc_enum sta32x_limiter2_attack_rate_enum = | 217 | static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_attack_rate_enum, |
| 218 | SOC_ENUM_SINGLE(STA32X_L2AR, STA32X_LxA_SHIFT, | 218 | STA32X_L2AR, STA32X_LxA_SHIFT, |
| 219 | 16, sta32x_limiter_attack_rate); | 219 | sta32x_limiter_attack_rate); |
| 220 | static const struct soc_enum sta32x_limiter1_release_rate_enum = | 220 | static SOC_ENUM_SINGLE_DECL(sta32x_limiter1_release_rate_enum, |
| 221 | SOC_ENUM_SINGLE(STA32X_L1AR, STA32X_LxR_SHIFT, | 221 | STA32X_L1AR, STA32X_LxR_SHIFT, |
| 222 | 16, sta32x_limiter_release_rate); | 222 | sta32x_limiter_release_rate); |
| 223 | static const struct soc_enum sta32x_limiter2_release_rate_enum = | 223 | static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_release_rate_enum, |
| 224 | SOC_ENUM_SINGLE(STA32X_L2AR, STA32X_LxR_SHIFT, | 224 | STA32X_L2AR, STA32X_LxR_SHIFT, |
| 225 | 16, sta32x_limiter_release_rate); | 225 | sta32x_limiter_release_rate); |
| 226 | 226 | ||
| 227 | /* byte array controls for setting biquad, mixer, scaling coefficients; | 227 | /* byte array controls for setting biquad, mixer, scaling coefficients; |
| 228 | * for biquads all five coefficients need to be set in one go, | 228 | * for biquads all five coefficients need to be set in one go, |
| @@ -331,7 +331,7 @@ static int sta32x_sync_coef_shadow(struct snd_soc_codec *codec) | |||
| 331 | 331 | ||
| 332 | static int sta32x_cache_sync(struct snd_soc_codec *codec) | 332 | static int sta32x_cache_sync(struct snd_soc_codec *codec) |
| 333 | { | 333 | { |
| 334 | struct sta32x_priv *sta32x = codec->control_data; | 334 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); |
| 335 | unsigned int mute; | 335 | unsigned int mute; |
| 336 | int rc; | 336 | int rc; |
| 337 | 337 | ||
| @@ -434,7 +434,7 @@ SOC_SINGLE_TLV("Treble Tone Control", STA32X_TONE, STA32X_TONE_TTC_SHIFT, 15, 0, | |||
| 434 | SOC_ENUM("Limiter1 Attack Rate (dB/ms)", sta32x_limiter1_attack_rate_enum), | 434 | SOC_ENUM("Limiter1 Attack Rate (dB/ms)", sta32x_limiter1_attack_rate_enum), |
| 435 | SOC_ENUM("Limiter2 Attack Rate (dB/ms)", sta32x_limiter2_attack_rate_enum), | 435 | SOC_ENUM("Limiter2 Attack Rate (dB/ms)", sta32x_limiter2_attack_rate_enum), |
| 436 | SOC_ENUM("Limiter1 Release Rate (dB/ms)", sta32x_limiter1_release_rate_enum), | 436 | SOC_ENUM("Limiter1 Release Rate (dB/ms)", sta32x_limiter1_release_rate_enum), |
| 437 | SOC_ENUM("Limiter2 Release Rate (dB/ms)", sta32x_limiter1_release_rate_enum), | 437 | SOC_ENUM("Limiter2 Release Rate (dB/ms)", sta32x_limiter2_release_rate_enum), |
| 438 | 438 | ||
| 439 | /* depending on mode, the attack/release thresholds have | 439 | /* depending on mode, the attack/release thresholds have |
| 440 | * two different enum definitions; provide both | 440 | * two different enum definitions; provide both |
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c index 48dc7d2fee36..6d684d934f4d 100644 --- a/sound/soc/codecs/wm8400.c +++ b/sound/soc/codecs/wm8400.c | |||
| @@ -117,19 +117,23 @@ static int wm8400_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol, | |||
| 117 | static const char *wm8400_digital_sidetone[] = | 117 | static const char *wm8400_digital_sidetone[] = |
| 118 | {"None", "Left ADC", "Right ADC", "Reserved"}; | 118 | {"None", "Left ADC", "Right ADC", "Reserved"}; |
| 119 | 119 | ||
| 120 | static const struct soc_enum wm8400_left_digital_sidetone_enum = | 120 | static SOC_ENUM_SINGLE_DECL(wm8400_left_digital_sidetone_enum, |
| 121 | SOC_ENUM_SINGLE(WM8400_DIGITAL_SIDE_TONE, | 121 | WM8400_DIGITAL_SIDE_TONE, |
| 122 | WM8400_ADC_TO_DACL_SHIFT, 2, wm8400_digital_sidetone); | 122 | WM8400_ADC_TO_DACL_SHIFT, |
| 123 | wm8400_digital_sidetone); | ||
| 123 | 124 | ||
| 124 | static const struct soc_enum wm8400_right_digital_sidetone_enum = | 125 | static SOC_ENUM_SINGLE_DECL(wm8400_right_digital_sidetone_enum, |
| 125 | SOC_ENUM_SINGLE(WM8400_DIGITAL_SIDE_TONE, | 126 | WM8400_DIGITAL_SIDE_TONE, |
| 126 | WM8400_ADC_TO_DACR_SHIFT, 2, wm8400_digital_sidetone); | 127 | WM8400_ADC_TO_DACR_SHIFT, |
| 128 | wm8400_digital_sidetone); | ||
| 127 | 129 | ||
| 128 | static const char *wm8400_adcmode[] = | 130 | static const char *wm8400_adcmode[] = |
| 129 | {"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"}; | 131 | {"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"}; |
| 130 | 132 | ||
| 131 | static const struct soc_enum wm8400_right_adcmode_enum = | 133 | static SOC_ENUM_SINGLE_DECL(wm8400_right_adcmode_enum, |
| 132 | SOC_ENUM_SINGLE(WM8400_ADC_CTRL, WM8400_ADC_HPF_CUT_SHIFT, 3, wm8400_adcmode); | 134 | WM8400_ADC_CTRL, |
| 135 | WM8400_ADC_HPF_CUT_SHIFT, | ||
| 136 | wm8400_adcmode); | ||
| 133 | 137 | ||
| 134 | static const struct snd_kcontrol_new wm8400_snd_controls[] = { | 138 | static const struct snd_kcontrol_new wm8400_snd_controls[] = { |
| 135 | /* INMIXL */ | 139 | /* INMIXL */ |
| @@ -422,9 +426,10 @@ SOC_DAPM_SINGLE("RINPGA34 Switch", WM8400_INPUT_MIXER3, WM8400_L34MNB_SHIFT, | |||
| 422 | static const char *wm8400_ainlmux[] = | 426 | static const char *wm8400_ainlmux[] = |
| 423 | {"INMIXL Mix", "RXVOICE Mix", "DIFFINL Mix"}; | 427 | {"INMIXL Mix", "RXVOICE Mix", "DIFFINL Mix"}; |
| 424 | 428 | ||
| 425 | static const struct soc_enum wm8400_ainlmux_enum = | 429 | static SOC_ENUM_SINGLE_DECL(wm8400_ainlmux_enum, |
| 426 | SOC_ENUM_SINGLE( WM8400_INPUT_MIXER1, WM8400_AINLMODE_SHIFT, | 430 | WM8400_INPUT_MIXER1, |
| 427 | ARRAY_SIZE(wm8400_ainlmux), wm8400_ainlmux); | 431 | WM8400_AINLMODE_SHIFT, |
| 432 | wm8400_ainlmux); | ||
| 428 | 433 | ||
| 429 | static const struct snd_kcontrol_new wm8400_dapm_ainlmux_controls = | 434 | static const struct snd_kcontrol_new wm8400_dapm_ainlmux_controls = |
| 430 | SOC_DAPM_ENUM("Route", wm8400_ainlmux_enum); | 435 | SOC_DAPM_ENUM("Route", wm8400_ainlmux_enum); |
| @@ -435,9 +440,10 @@ SOC_DAPM_ENUM("Route", wm8400_ainlmux_enum); | |||
| 435 | static const char *wm8400_ainrmux[] = | 440 | static const char *wm8400_ainrmux[] = |
| 436 | {"INMIXR Mix", "RXVOICE Mix", "DIFFINR Mix"}; | 441 | {"INMIXR Mix", "RXVOICE Mix", "DIFFINR Mix"}; |
| 437 | 442 | ||
| 438 | static const struct soc_enum wm8400_ainrmux_enum = | 443 | static SOC_ENUM_SINGLE_DECL(wm8400_ainrmux_enum, |
| 439 | SOC_ENUM_SINGLE( WM8400_INPUT_MIXER1, WM8400_AINRMODE_SHIFT, | 444 | WM8400_INPUT_MIXER1, |
| 440 | ARRAY_SIZE(wm8400_ainrmux), wm8400_ainrmux); | 445 | WM8400_AINRMODE_SHIFT, |
| 446 | wm8400_ainrmux); | ||
| 441 | 447 | ||
| 442 | static const struct snd_kcontrol_new wm8400_dapm_ainrmux_controls = | 448 | static const struct snd_kcontrol_new wm8400_dapm_ainrmux_controls = |
| 443 | SOC_DAPM_ENUM("Route", wm8400_ainrmux_enum); | 449 | SOC_DAPM_ENUM("Route", wm8400_ainrmux_enum); |
diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c index 89a18d82f303..5bce21013485 100644 --- a/sound/soc/codecs/wm8770.c +++ b/sound/soc/codecs/wm8770.c | |||
| @@ -196,8 +196,8 @@ static const char *ain_text[] = { | |||
| 196 | "AIN5", "AIN6", "AIN7", "AIN8" | 196 | "AIN5", "AIN6", "AIN7", "AIN8" |
| 197 | }; | 197 | }; |
| 198 | 198 | ||
| 199 | static const struct soc_enum ain_enum = | 199 | static SOC_ENUM_DOUBLE_DECL(ain_enum, |
| 200 | SOC_ENUM_DOUBLE(WM8770_ADCMUX, 0, 4, 8, ain_text); | 200 | WM8770_ADCMUX, 0, 4, ain_text); |
| 201 | 201 | ||
| 202 | static const struct snd_kcontrol_new ain_mux = | 202 | static const struct snd_kcontrol_new ain_mux = |
| 203 | SOC_DAPM_ENUM("Capture Mux", ain_enum); | 203 | SOC_DAPM_ENUM("Capture Mux", ain_enum); |
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index e98bc7038a08..43c2201cb901 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c | |||
| @@ -304,53 +304,53 @@ static const DECLARE_TLV_DB_SCALE(adc_tlv, -7200, 75, 1); | |||
| 304 | 304 | ||
| 305 | static const char *mic_bias_level_txt[] = { "0.9*AVDD", "0.65*AVDD" }; | 305 | static const char *mic_bias_level_txt[] = { "0.9*AVDD", "0.65*AVDD" }; |
| 306 | 306 | ||
| 307 | static const struct soc_enum mic_bias_level = | 307 | static SOC_ENUM_SINGLE_DECL(mic_bias_level, |
| 308 | SOC_ENUM_SINGLE(WM8900_REG_INCTL, 8, 2, mic_bias_level_txt); | 308 | WM8900_REG_INCTL, 8, mic_bias_level_txt); |
| 309 | 309 | ||
| 310 | static const char *dac_mute_rate_txt[] = { "Fast", "Slow" }; | 310 | static const char *dac_mute_rate_txt[] = { "Fast", "Slow" }; |
| 311 | 311 | ||
| 312 | static const struct soc_enum dac_mute_rate = | 312 | static SOC_ENUM_SINGLE_DECL(dac_mute_rate, |
| 313 | SOC_ENUM_SINGLE(WM8900_REG_DACCTRL, 7, 2, dac_mute_rate_txt); | 313 | WM8900_REG_DACCTRL, 7, dac_mute_rate_txt); |
| 314 | 314 | ||
| 315 | static const char *dac_deemphasis_txt[] = { | 315 | static const char *dac_deemphasis_txt[] = { |
| 316 | "Disabled", "32kHz", "44.1kHz", "48kHz" | 316 | "Disabled", "32kHz", "44.1kHz", "48kHz" |
| 317 | }; | 317 | }; |
| 318 | 318 | ||
| 319 | static const struct soc_enum dac_deemphasis = | 319 | static SOC_ENUM_SINGLE_DECL(dac_deemphasis, |
| 320 | SOC_ENUM_SINGLE(WM8900_REG_DACCTRL, 4, 4, dac_deemphasis_txt); | 320 | WM8900_REG_DACCTRL, 4, dac_deemphasis_txt); |
| 321 | 321 | ||
| 322 | static const char *adc_hpf_cut_txt[] = { | 322 | static const char *adc_hpf_cut_txt[] = { |
| 323 | "Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3" | 323 | "Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3" |
| 324 | }; | 324 | }; |
| 325 | 325 | ||
| 326 | static const struct soc_enum adc_hpf_cut = | 326 | static SOC_ENUM_SINGLE_DECL(adc_hpf_cut, |
| 327 | SOC_ENUM_SINGLE(WM8900_REG_ADCCTRL, 5, 4, adc_hpf_cut_txt); | 327 | WM8900_REG_ADCCTRL, 5, adc_hpf_cut_txt); |
| 328 | 328 | ||
| 329 | static const char *lr_txt[] = { | 329 | static const char *lr_txt[] = { |
| 330 | "Left", "Right" | 330 | "Left", "Right" |
| 331 | }; | 331 | }; |
| 332 | 332 | ||
| 333 | static const struct soc_enum aifl_src = | 333 | static SOC_ENUM_SINGLE_DECL(aifl_src, |
| 334 | SOC_ENUM_SINGLE(WM8900_REG_AUDIO1, 15, 2, lr_txt); | 334 | WM8900_REG_AUDIO1, 15, lr_txt); |
| 335 | 335 | ||
| 336 | static const struct soc_enum aifr_src = | 336 | static SOC_ENUM_SINGLE_DECL(aifr_src, |
| 337 | SOC_ENUM_SINGLE(WM8900_REG_AUDIO1, 14, 2, lr_txt); | 337 | WM8900_REG_AUDIO1, 14, lr_txt); |
| 338 | 338 | ||
| 339 | static const struct soc_enum dacl_src = | 339 | static SOC_ENUM_SINGLE_DECL(dacl_src, |
| 340 | SOC_ENUM_SINGLE(WM8900_REG_AUDIO2, 15, 2, lr_txt); | 340 | WM8900_REG_AUDIO2, 15, lr_txt); |
| 341 | 341 | ||
| 342 | static const struct soc_enum dacr_src = | 342 | static SOC_ENUM_SINGLE_DECL(dacr_src, |
| 343 | SOC_ENUM_SINGLE(WM8900_REG_AUDIO2, 14, 2, lr_txt); | 343 | WM8900_REG_AUDIO2, 14, lr_txt); |
| 344 | 344 | ||
| 345 | static const char *sidetone_txt[] = { | 345 | static const char *sidetone_txt[] = { |
| 346 | "Disabled", "Left ADC", "Right ADC" | 346 | "Disabled", "Left ADC", "Right ADC" |
| 347 | }; | 347 | }; |
| 348 | 348 | ||
| 349 | static const struct soc_enum dacl_sidetone = | 349 | static SOC_ENUM_SINGLE_DECL(dacl_sidetone, |
| 350 | SOC_ENUM_SINGLE(WM8900_REG_SIDETONE, 2, 3, sidetone_txt); | 350 | WM8900_REG_SIDETONE, 2, sidetone_txt); |
| 351 | 351 | ||
| 352 | static const struct soc_enum dacr_sidetone = | 352 | static SOC_ENUM_SINGLE_DECL(dacr_sidetone, |
| 353 | SOC_ENUM_SINGLE(WM8900_REG_SIDETONE, 0, 3, sidetone_txt); | 353 | WM8900_REG_SIDETONE, 0, sidetone_txt); |
| 354 | 354 | ||
| 355 | static const struct snd_kcontrol_new wm8900_snd_controls[] = { | 355 | static const struct snd_kcontrol_new wm8900_snd_controls[] = { |
| 356 | SOC_ENUM("Mic Bias Level", mic_bias_level), | 356 | SOC_ENUM("Mic Bias Level", mic_bias_level), |
| @@ -496,8 +496,8 @@ SOC_DAPM_SINGLE("RINPUT3 Switch", WM8900_REG_INCTL, 0, 1, 0), | |||
| 496 | 496 | ||
| 497 | static const char *wm8900_lp_mux[] = { "Disabled", "Enabled" }; | 497 | static const char *wm8900_lp_mux[] = { "Disabled", "Enabled" }; |
| 498 | 498 | ||
| 499 | static const struct soc_enum wm8900_lineout2_lp_mux = | 499 | static SOC_ENUM_SINGLE_DECL(wm8900_lineout2_lp_mux, |
| 500 | SOC_ENUM_SINGLE(WM8900_REG_LOUTMIXCTL1, 1, 2, wm8900_lp_mux); | 500 | WM8900_REG_LOUTMIXCTL1, 1, wm8900_lp_mux); |
| 501 | 501 | ||
| 502 | static const struct snd_kcontrol_new wm8900_lineout2_lp = | 502 | static const struct snd_kcontrol_new wm8900_lineout2_lp = |
| 503 | SOC_DAPM_ENUM("Route", wm8900_lineout2_lp_mux); | 503 | SOC_DAPM_ENUM("Route", wm8900_lineout2_lp_mux); |
diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c index b7488f190d2b..d4248e00160e 100644 --- a/sound/soc/codecs/wm8958-dsp2.c +++ b/sound/soc/codecs/wm8958-dsp2.c | |||
| @@ -153,7 +153,7 @@ static int wm8958_dsp2_fw(struct snd_soc_codec *codec, const char *name, | |||
| 153 | 153 | ||
| 154 | data32 &= 0xffffff; | 154 | data32 &= 0xffffff; |
| 155 | 155 | ||
| 156 | wm8994_bulk_write(codec->control_data, | 156 | wm8994_bulk_write(wm8994->wm8994, |
| 157 | data32 & 0xffffff, | 157 | data32 & 0xffffff, |
| 158 | block_len / 2, | 158 | block_len / 2, |
| 159 | (void *)(data + 8)); | 159 | (void *)(data + 8)); |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index b9be9cbc4603..adb72063d44e 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
| @@ -265,21 +265,21 @@ static const char *sidetone_hpf_text[] = { | |||
| 265 | "2.7kHz", "1.35kHz", "675Hz", "370Hz", "180Hz", "90Hz", "45Hz" | 265 | "2.7kHz", "1.35kHz", "675Hz", "370Hz", "180Hz", "90Hz", "45Hz" |
| 266 | }; | 266 | }; |
| 267 | 267 | ||
| 268 | static const struct soc_enum sidetone_hpf = | 268 | static SOC_ENUM_SINGLE_DECL(sidetone_hpf, |
| 269 | SOC_ENUM_SINGLE(WM8994_SIDETONE, 7, 7, sidetone_hpf_text); | 269 | WM8994_SIDETONE, 7, sidetone_hpf_text); |
| 270 | 270 | ||
| 271 | static const char *adc_hpf_text[] = { | 271 | static const char *adc_hpf_text[] = { |
| 272 | "HiFi", "Voice 1", "Voice 2", "Voice 3" | 272 | "HiFi", "Voice 1", "Voice 2", "Voice 3" |
| 273 | }; | 273 | }; |
| 274 | 274 | ||
| 275 | static const struct soc_enum aif1adc1_hpf = | 275 | static SOC_ENUM_SINGLE_DECL(aif1adc1_hpf, |
| 276 | SOC_ENUM_SINGLE(WM8994_AIF1_ADC1_FILTERS, 13, 4, adc_hpf_text); | 276 | WM8994_AIF1_ADC1_FILTERS, 13, adc_hpf_text); |
| 277 | 277 | ||
| 278 | static const struct soc_enum aif1adc2_hpf = | 278 | static SOC_ENUM_SINGLE_DECL(aif1adc2_hpf, |
| 279 | SOC_ENUM_SINGLE(WM8994_AIF1_ADC2_FILTERS, 13, 4, adc_hpf_text); | 279 | WM8994_AIF1_ADC2_FILTERS, 13, adc_hpf_text); |
| 280 | 280 | ||
| 281 | static const struct soc_enum aif2adc_hpf = | 281 | static SOC_ENUM_SINGLE_DECL(aif2adc_hpf, |
| 282 | SOC_ENUM_SINGLE(WM8994_AIF2_ADC_FILTERS, 13, 4, adc_hpf_text); | 282 | WM8994_AIF2_ADC_FILTERS, 13, adc_hpf_text); |
| 283 | 283 | ||
| 284 | static const DECLARE_TLV_DB_SCALE(aif_tlv, 0, 600, 0); | 284 | static const DECLARE_TLV_DB_SCALE(aif_tlv, 0, 600, 0); |
| 285 | static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1); | 285 | static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1); |
| @@ -501,39 +501,39 @@ static const char *aif_chan_src_text[] = { | |||
| 501 | "Left", "Right" | 501 | "Left", "Right" |
| 502 | }; | 502 | }; |
| 503 | 503 | ||
| 504 | static const struct soc_enum aif1adcl_src = | 504 | static SOC_ENUM_SINGLE_DECL(aif1adcl_src, |
| 505 | SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 15, 2, aif_chan_src_text); | 505 | WM8994_AIF1_CONTROL_1, 15, aif_chan_src_text); |
| 506 | 506 | ||
| 507 | static const struct soc_enum aif1adcr_src = | 507 | static SOC_ENUM_SINGLE_DECL(aif1adcr_src, |
| 508 | SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 14, 2, aif_chan_src_text); | 508 | WM8994_AIF1_CONTROL_1, 14, aif_chan_src_text); |
| 509 | 509 | ||
| 510 | static const struct soc_enum aif2adcl_src = | 510 | static SOC_ENUM_SINGLE_DECL(aif2adcl_src, |
| 511 | SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 15, 2, aif_chan_src_text); | 511 | WM8994_AIF2_CONTROL_1, 15, aif_chan_src_text); |
| 512 | 512 | ||
| 513 | static const struct soc_enum aif2adcr_src = | 513 | static SOC_ENUM_SINGLE_DECL(aif2adcr_src, |
| 514 | SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 14, 2, aif_chan_src_text); | 514 | WM8994_AIF2_CONTROL_1, 14, aif_chan_src_text); |
| 515 | 515 | ||
| 516 | static const struct soc_enum aif1dacl_src = | 516 | static SOC_ENUM_SINGLE_DECL(aif1dacl_src, |
| 517 | SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 15, 2, aif_chan_src_text); | 517 | WM8994_AIF1_CONTROL_2, 15, aif_chan_src_text); |
| 518 | 518 | ||
| 519 | static const struct soc_enum aif1dacr_src = | 519 | static SOC_ENUM_SINGLE_DECL(aif1dacr_src, |
| 520 | SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 14, 2, aif_chan_src_text); | 520 | WM8994_AIF1_CONTROL_2, 14, aif_chan_src_text); |
| 521 | 521 | ||
| 522 | static const struct soc_enum aif2dacl_src = | 522 | static SOC_ENUM_SINGLE_DECL(aif2dacl_src, |
| 523 | SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 15, 2, aif_chan_src_text); | 523 | WM8994_AIF2_CONTROL_2, 15, aif_chan_src_text); |
| 524 | 524 | ||
| 525 | static const struct soc_enum aif2dacr_src = | 525 | static SOC_ENUM_SINGLE_DECL(aif2dacr_src, |
| 526 | SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 14, 2, aif_chan_src_text); | 526 | WM8994_AIF2_CONTROL_2, 14, aif_chan_src_text); |
| 527 | 527 | ||
| 528 | static const char *osr_text[] = { | 528 | static const char *osr_text[] = { |
| 529 | "Low Power", "High Performance", | 529 | "Low Power", "High Performance", |
| 530 | }; | 530 | }; |
| 531 | 531 | ||
| 532 | static const struct soc_enum dac_osr = | 532 | static SOC_ENUM_SINGLE_DECL(dac_osr, |
| 533 | SOC_ENUM_SINGLE(WM8994_OVERSAMPLING, 0, 2, osr_text); | 533 | WM8994_OVERSAMPLING, 0, osr_text); |
| 534 | 534 | ||
| 535 | static const struct soc_enum adc_osr = | 535 | static SOC_ENUM_SINGLE_DECL(adc_osr, |
| 536 | SOC_ENUM_SINGLE(WM8994_OVERSAMPLING, 1, 2, osr_text); | 536 | WM8994_OVERSAMPLING, 1, osr_text); |
| 537 | 537 | ||
| 538 | static const struct snd_kcontrol_new wm8994_snd_controls[] = { | 538 | static const struct snd_kcontrol_new wm8994_snd_controls[] = { |
| 539 | SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME, | 539 | SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME, |
| @@ -690,17 +690,20 @@ static const char *wm8958_ng_text[] = { | |||
| 690 | "30ms", "125ms", "250ms", "500ms", | 690 | "30ms", "125ms", "250ms", "500ms", |
| 691 | }; | 691 | }; |
| 692 | 692 | ||
| 693 | static const struct soc_enum wm8958_aif1dac1_ng_hold = | 693 | static SOC_ENUM_SINGLE_DECL(wm8958_aif1dac1_ng_hold, |
| 694 | SOC_ENUM_SINGLE(WM8958_AIF1_DAC1_NOISE_GATE, | 694 | WM8958_AIF1_DAC1_NOISE_GATE, |
| 695 | WM8958_AIF1DAC1_NG_THR_SHIFT, 4, wm8958_ng_text); | 695 | WM8958_AIF1DAC1_NG_THR_SHIFT, |
| 696 | wm8958_ng_text); | ||
| 696 | 697 | ||
| 697 | static const struct soc_enum wm8958_aif1dac2_ng_hold = | 698 | static SOC_ENUM_SINGLE_DECL(wm8958_aif1dac2_ng_hold, |
| 698 | SOC_ENUM_SINGLE(WM8958_AIF1_DAC2_NOISE_GATE, | 699 | WM8958_AIF1_DAC2_NOISE_GATE, |
| 699 | WM8958_AIF1DAC2_NG_THR_SHIFT, 4, wm8958_ng_text); | 700 | WM8958_AIF1DAC2_NG_THR_SHIFT, |
| 701 | wm8958_ng_text); | ||
| 700 | 702 | ||
| 701 | static const struct soc_enum wm8958_aif2dac_ng_hold = | 703 | static SOC_ENUM_SINGLE_DECL(wm8958_aif2dac_ng_hold, |
| 702 | SOC_ENUM_SINGLE(WM8958_AIF2_DAC_NOISE_GATE, | 704 | WM8958_AIF2_DAC_NOISE_GATE, |
| 703 | WM8958_AIF2DAC_NG_THR_SHIFT, 4, wm8958_ng_text); | 705 | WM8958_AIF2DAC_NG_THR_SHIFT, |
| 706 | wm8958_ng_text); | ||
| 704 | 707 | ||
| 705 | static const struct snd_kcontrol_new wm8958_snd_controls[] = { | 708 | static const struct snd_kcontrol_new wm8958_snd_controls[] = { |
| 706 | SOC_SINGLE_TLV("AIF3 Boost Volume", WM8958_AIF3_CONTROL_2, 10, 3, 0, aif_tlv), | 709 | SOC_SINGLE_TLV("AIF3 Boost Volume", WM8958_AIF3_CONTROL_2, 10, 3, 0, aif_tlv), |
| @@ -1341,8 +1344,8 @@ static const char *adc_mux_text[] = { | |||
| 1341 | "DMIC", | 1344 | "DMIC", |
| 1342 | }; | 1345 | }; |
| 1343 | 1346 | ||
| 1344 | static const struct soc_enum adc_enum = | 1347 | static SOC_ENUM_SINGLE_DECL(adc_enum, |
| 1345 | SOC_ENUM_SINGLE(0, 0, 2, adc_mux_text); | 1348 | 0, 0, adc_mux_text); |
| 1346 | 1349 | ||
| 1347 | static const struct snd_kcontrol_new adcl_mux = | 1350 | static const struct snd_kcontrol_new adcl_mux = |
| 1348 | SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum); | 1351 | SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum); |
| @@ -1478,14 +1481,14 @@ static const char *sidetone_text[] = { | |||
| 1478 | "ADC/DMIC1", "DMIC2", | 1481 | "ADC/DMIC1", "DMIC2", |
| 1479 | }; | 1482 | }; |
| 1480 | 1483 | ||
| 1481 | static const struct soc_enum sidetone1_enum = | 1484 | static SOC_ENUM_SINGLE_DECL(sidetone1_enum, |
| 1482 | SOC_ENUM_SINGLE(WM8994_SIDETONE, 0, 2, sidetone_text); | 1485 | WM8994_SIDETONE, 0, sidetone_text); |
| 1483 | 1486 | ||
| 1484 | static const struct snd_kcontrol_new sidetone1_mux = | 1487 | static const struct snd_kcontrol_new sidetone1_mux = |
| 1485 | SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum); | 1488 | SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum); |
| 1486 | 1489 | ||
| 1487 | static const struct soc_enum sidetone2_enum = | 1490 | static SOC_ENUM_SINGLE_DECL(sidetone2_enum, |
| 1488 | SOC_ENUM_SINGLE(WM8994_SIDETONE, 1, 2, sidetone_text); | 1491 | WM8994_SIDETONE, 1, sidetone_text); |
| 1489 | 1492 | ||
| 1490 | static const struct snd_kcontrol_new sidetone2_mux = | 1493 | static const struct snd_kcontrol_new sidetone2_mux = |
| 1491 | SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum); | 1494 | SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum); |
| @@ -1498,22 +1501,24 @@ static const char *loopback_text[] = { | |||
| 1498 | "None", "ADCDAT", | 1501 | "None", "ADCDAT", |
| 1499 | }; | 1502 | }; |
| 1500 | 1503 | ||
| 1501 | static const struct soc_enum aif1_loopback_enum = | 1504 | static SOC_ENUM_SINGLE_DECL(aif1_loopback_enum, |
| 1502 | SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, WM8994_AIF1_LOOPBACK_SHIFT, 2, | 1505 | WM8994_AIF1_CONTROL_2, |
| 1503 | loopback_text); | 1506 | WM8994_AIF1_LOOPBACK_SHIFT, |
| 1507 | loopback_text); | ||
| 1504 | 1508 | ||
| 1505 | static const struct snd_kcontrol_new aif1_loopback = | 1509 | static const struct snd_kcontrol_new aif1_loopback = |
| 1506 | SOC_DAPM_ENUM("AIF1 Loopback", aif1_loopback_enum); | 1510 | SOC_DAPM_ENUM("AIF1 Loopback", aif1_loopback_enum); |
| 1507 | 1511 | ||
| 1508 | static const struct soc_enum aif2_loopback_enum = | 1512 | static SOC_ENUM_SINGLE_DECL(aif2_loopback_enum, |
| 1509 | SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, WM8994_AIF2_LOOPBACK_SHIFT, 2, | 1513 | WM8994_AIF2_CONTROL_2, |
| 1510 | loopback_text); | 1514 | WM8994_AIF2_LOOPBACK_SHIFT, |
| 1515 | loopback_text); | ||
| 1511 | 1516 | ||
| 1512 | static const struct snd_kcontrol_new aif2_loopback = | 1517 | static const struct snd_kcontrol_new aif2_loopback = |
| 1513 | SOC_DAPM_ENUM("AIF2 Loopback", aif2_loopback_enum); | 1518 | SOC_DAPM_ENUM("AIF2 Loopback", aif2_loopback_enum); |
| 1514 | 1519 | ||
| 1515 | static const struct soc_enum aif1dac_enum = | 1520 | static SOC_ENUM_SINGLE_DECL(aif1dac_enum, |
| 1516 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 0, 2, aif1dac_text); | 1521 | WM8994_POWER_MANAGEMENT_6, 0, aif1dac_text); |
| 1517 | 1522 | ||
| 1518 | static const struct snd_kcontrol_new aif1dac_mux = | 1523 | static const struct snd_kcontrol_new aif1dac_mux = |
| 1519 | SOC_DAPM_ENUM("AIF1DAC Mux", aif1dac_enum); | 1524 | SOC_DAPM_ENUM("AIF1DAC Mux", aif1dac_enum); |
| @@ -1522,8 +1527,8 @@ static const char *aif2dac_text[] = { | |||
| 1522 | "AIF2DACDAT", "AIF3DACDAT", | 1527 | "AIF2DACDAT", "AIF3DACDAT", |
| 1523 | }; | 1528 | }; |
| 1524 | 1529 | ||
| 1525 | static const struct soc_enum aif2dac_enum = | 1530 | static SOC_ENUM_SINGLE_DECL(aif2dac_enum, |
| 1526 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 1, 2, aif2dac_text); | 1531 | WM8994_POWER_MANAGEMENT_6, 1, aif2dac_text); |
| 1527 | 1532 | ||
| 1528 | static const struct snd_kcontrol_new aif2dac_mux = | 1533 | static const struct snd_kcontrol_new aif2dac_mux = |
| 1529 | SOC_DAPM_ENUM("AIF2DAC Mux", aif2dac_enum); | 1534 | SOC_DAPM_ENUM("AIF2DAC Mux", aif2dac_enum); |
| @@ -1532,8 +1537,8 @@ static const char *aif2adc_text[] = { | |||
| 1532 | "AIF2ADCDAT", "AIF3DACDAT", | 1537 | "AIF2ADCDAT", "AIF3DACDAT", |
| 1533 | }; | 1538 | }; |
| 1534 | 1539 | ||
| 1535 | static const struct soc_enum aif2adc_enum = | 1540 | static SOC_ENUM_SINGLE_DECL(aif2adc_enum, |
| 1536 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 2, 2, aif2adc_text); | 1541 | WM8994_POWER_MANAGEMENT_6, 2, aif2adc_text); |
| 1537 | 1542 | ||
| 1538 | static const struct snd_kcontrol_new aif2adc_mux = | 1543 | static const struct snd_kcontrol_new aif2adc_mux = |
| 1539 | SOC_DAPM_ENUM("AIF2ADC Mux", aif2adc_enum); | 1544 | SOC_DAPM_ENUM("AIF2ADC Mux", aif2adc_enum); |
| @@ -1542,14 +1547,14 @@ static const char *aif3adc_text[] = { | |||
| 1542 | "AIF1ADCDAT", "AIF2ADCDAT", "AIF2DACDAT", "Mono PCM", | 1547 | "AIF1ADCDAT", "AIF2ADCDAT", "AIF2DACDAT", "Mono PCM", |
| 1543 | }; | 1548 | }; |
| 1544 | 1549 | ||
| 1545 | static const struct soc_enum wm8994_aif3adc_enum = | 1550 | static SOC_ENUM_SINGLE_DECL(wm8994_aif3adc_enum, |
| 1546 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 3, aif3adc_text); | 1551 | WM8994_POWER_MANAGEMENT_6, 3, aif3adc_text); |
| 1547 | 1552 | ||
| 1548 | static const struct snd_kcontrol_new wm8994_aif3adc_mux = | 1553 | static const struct snd_kcontrol_new wm8994_aif3adc_mux = |
| 1549 | SOC_DAPM_ENUM("AIF3ADC Mux", wm8994_aif3adc_enum); | 1554 | SOC_DAPM_ENUM("AIF3ADC Mux", wm8994_aif3adc_enum); |
| 1550 | 1555 | ||
| 1551 | static const struct soc_enum wm8958_aif3adc_enum = | 1556 | static SOC_ENUM_SINGLE_DECL(wm8958_aif3adc_enum, |
| 1552 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 4, aif3adc_text); | 1557 | WM8994_POWER_MANAGEMENT_6, 3, aif3adc_text); |
| 1553 | 1558 | ||
| 1554 | static const struct snd_kcontrol_new wm8958_aif3adc_mux = | 1559 | static const struct snd_kcontrol_new wm8958_aif3adc_mux = |
| 1555 | SOC_DAPM_ENUM("AIF3ADC Mux", wm8958_aif3adc_enum); | 1560 | SOC_DAPM_ENUM("AIF3ADC Mux", wm8958_aif3adc_enum); |
| @@ -1558,8 +1563,8 @@ static const char *mono_pcm_out_text[] = { | |||
| 1558 | "None", "AIF2ADCL", "AIF2ADCR", | 1563 | "None", "AIF2ADCL", "AIF2ADCR", |
| 1559 | }; | 1564 | }; |
| 1560 | 1565 | ||
| 1561 | static const struct soc_enum mono_pcm_out_enum = | 1566 | static SOC_ENUM_SINGLE_DECL(mono_pcm_out_enum, |
| 1562 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 9, 3, mono_pcm_out_text); | 1567 | WM8994_POWER_MANAGEMENT_6, 9, mono_pcm_out_text); |
| 1563 | 1568 | ||
| 1564 | static const struct snd_kcontrol_new mono_pcm_out_mux = | 1569 | static const struct snd_kcontrol_new mono_pcm_out_mux = |
| 1565 | SOC_DAPM_ENUM("Mono PCM Out Mux", mono_pcm_out_enum); | 1570 | SOC_DAPM_ENUM("Mono PCM Out Mux", mono_pcm_out_enum); |
| @@ -1569,14 +1574,14 @@ static const char *aif2dac_src_text[] = { | |||
| 1569 | }; | 1574 | }; |
| 1570 | 1575 | ||
| 1571 | /* Note that these two control shouldn't be simultaneously switched to AIF3 */ | 1576 | /* Note that these two control shouldn't be simultaneously switched to AIF3 */ |
| 1572 | static const struct soc_enum aif2dacl_src_enum = | 1577 | static SOC_ENUM_SINGLE_DECL(aif2dacl_src_enum, |
| 1573 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 7, 2, aif2dac_src_text); | 1578 | WM8994_POWER_MANAGEMENT_6, 7, aif2dac_src_text); |
| 1574 | 1579 | ||
| 1575 | static const struct snd_kcontrol_new aif2dacl_src_mux = | 1580 | static const struct snd_kcontrol_new aif2dacl_src_mux = |
| 1576 | SOC_DAPM_ENUM("AIF2DACL Mux", aif2dacl_src_enum); | 1581 | SOC_DAPM_ENUM("AIF2DACL Mux", aif2dacl_src_enum); |
| 1577 | 1582 | ||
| 1578 | static const struct soc_enum aif2dacr_src_enum = | 1583 | static SOC_ENUM_SINGLE_DECL(aif2dacr_src_enum, |
| 1579 | SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 8, 2, aif2dac_src_text); | 1584 | WM8994_POWER_MANAGEMENT_6, 8, aif2dac_src_text); |
| 1580 | 1585 | ||
| 1581 | static const struct snd_kcontrol_new aif2dacr_src_mux = | 1586 | static const struct snd_kcontrol_new aif2dacr_src_mux = |
| 1582 | SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); | 1587 | SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index dc8ff13187f7..b9dc6acbba8c 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
| @@ -1218,7 +1218,7 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w, | |||
| 1218 | ret = regulator_allow_bypass(w->regulator, false); | 1218 | ret = regulator_allow_bypass(w->regulator, false); |
| 1219 | if (ret != 0) | 1219 | if (ret != 0) |
| 1220 | dev_warn(w->dapm->dev, | 1220 | dev_warn(w->dapm->dev, |
| 1221 | "ASoC: Failed to bypass %s: %d\n", | 1221 | "ASoC: Failed to unbypass %s: %d\n", |
| 1222 | w->name, ret); | 1222 | w->name, ret); |
| 1223 | } | 1223 | } |
| 1224 | 1224 | ||
| @@ -1228,7 +1228,7 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w, | |||
| 1228 | ret = regulator_allow_bypass(w->regulator, true); | 1228 | ret = regulator_allow_bypass(w->regulator, true); |
| 1229 | if (ret != 0) | 1229 | if (ret != 0) |
| 1230 | dev_warn(w->dapm->dev, | 1230 | dev_warn(w->dapm->dev, |
| 1231 | "ASoC: Failed to unbypass %s: %d\n", | 1231 | "ASoC: Failed to bypass %s: %d\n", |
| 1232 | w->name, ret); | 1232 | w->name, ret); |
| 1233 | } | 1233 | } |
| 1234 | 1234 | ||
| @@ -3210,15 +3210,11 @@ int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, | |||
| 3210 | struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); | 3210 | struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); |
| 3211 | const char *pin = (const char *)kcontrol->private_value; | 3211 | const char *pin = (const char *)kcontrol->private_value; |
| 3212 | 3212 | ||
| 3213 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | ||
| 3214 | |||
| 3215 | if (ucontrol->value.integer.value[0]) | 3213 | if (ucontrol->value.integer.value[0]) |
| 3216 | snd_soc_dapm_enable_pin(&card->dapm, pin); | 3214 | snd_soc_dapm_enable_pin(&card->dapm, pin); |
| 3217 | else | 3215 | else |
| 3218 | snd_soc_dapm_disable_pin(&card->dapm, pin); | 3216 | snd_soc_dapm_disable_pin(&card->dapm, pin); |
| 3219 | 3217 | ||
| 3220 | mutex_unlock(&card->dapm_mutex); | ||
| 3221 | |||
| 3222 | snd_soc_dapm_sync(&card->dapm); | 3218 | snd_soc_dapm_sync(&card->dapm); |
| 3223 | return 0; | 3219 | return 0; |
| 3224 | } | 3220 | } |
| @@ -3248,7 +3244,7 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, | |||
| 3248 | ret = regulator_allow_bypass(w->regulator, true); | 3244 | ret = regulator_allow_bypass(w->regulator, true); |
| 3249 | if (ret != 0) | 3245 | if (ret != 0) |
| 3250 | dev_warn(w->dapm->dev, | 3246 | dev_warn(w->dapm->dev, |
| 3251 | "ASoC: Failed to unbypass %s: %d\n", | 3247 | "ASoC: Failed to bypass %s: %d\n", |
| 3252 | w->name, ret); | 3248 | w->name, ret); |
| 3253 | } | 3249 | } |
| 3254 | break; | 3250 | break; |
| @@ -3767,23 +3763,52 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, | |||
| 3767 | } | 3763 | } |
| 3768 | 3764 | ||
| 3769 | /** | 3765 | /** |
| 3766 | * snd_soc_dapm_enable_pin_unlocked - enable pin. | ||
| 3767 | * @dapm: DAPM context | ||
| 3768 | * @pin: pin name | ||
| 3769 | * | ||
| 3770 | * Enables input/output pin and its parents or children widgets iff there is | ||
| 3771 | * a valid audio route and active audio stream. | ||
| 3772 | * | ||
| 3773 | * Requires external locking. | ||
| 3774 | * | ||
| 3775 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to | ||
| 3776 | * do any widget power switching. | ||
| 3777 | */ | ||
| 3778 | int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, | ||
| 3779 | const char *pin) | ||
| 3780 | { | ||
| 3781 | return snd_soc_dapm_set_pin(dapm, pin, 1); | ||
| 3782 | } | ||
| 3783 | EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin_unlocked); | ||
| 3784 | |||
| 3785 | /** | ||
| 3770 | * snd_soc_dapm_enable_pin - enable pin. | 3786 | * snd_soc_dapm_enable_pin - enable pin. |
| 3771 | * @dapm: DAPM context | 3787 | * @dapm: DAPM context |
| 3772 | * @pin: pin name | 3788 | * @pin: pin name |
| 3773 | * | 3789 | * |
| 3774 | * Enables input/output pin and its parents or children widgets iff there is | 3790 | * Enables input/output pin and its parents or children widgets iff there is |
| 3775 | * a valid audio route and active audio stream. | 3791 | * a valid audio route and active audio stream. |
| 3792 | * | ||
| 3776 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to | 3793 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to |
| 3777 | * do any widget power switching. | 3794 | * do any widget power switching. |
| 3778 | */ | 3795 | */ |
| 3779 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin) | 3796 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin) |
| 3780 | { | 3797 | { |
| 3781 | return snd_soc_dapm_set_pin(dapm, pin, 1); | 3798 | int ret; |
| 3799 | |||
| 3800 | mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | ||
| 3801 | |||
| 3802 | ret = snd_soc_dapm_set_pin(dapm, pin, 1); | ||
| 3803 | |||
| 3804 | mutex_unlock(&dapm->card->dapm_mutex); | ||
| 3805 | |||
| 3806 | return ret; | ||
| 3782 | } | 3807 | } |
| 3783 | EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin); | 3808 | EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin); |
| 3784 | 3809 | ||
| 3785 | /** | 3810 | /** |
| 3786 | * snd_soc_dapm_force_enable_pin - force a pin to be enabled | 3811 | * snd_soc_dapm_force_enable_pin_unlocked - force a pin to be enabled |
| 3787 | * @dapm: DAPM context | 3812 | * @dapm: DAPM context |
| 3788 | * @pin: pin name | 3813 | * @pin: pin name |
| 3789 | * | 3814 | * |
| @@ -3791,11 +3816,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin); | |||
| 3791 | * intended for use with microphone bias supplies used in microphone | 3816 | * intended for use with microphone bias supplies used in microphone |
| 3792 | * jack detection. | 3817 | * jack detection. |
| 3793 | * | 3818 | * |
| 3819 | * Requires external locking. | ||
| 3820 | * | ||
| 3794 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to | 3821 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to |
| 3795 | * do any widget power switching. | 3822 | * do any widget power switching. |
| 3796 | */ | 3823 | */ |
| 3797 | int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | 3824 | int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, |
| 3798 | const char *pin) | 3825 | const char *pin) |
| 3799 | { | 3826 | { |
| 3800 | struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); | 3827 | struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); |
| 3801 | 3828 | ||
| @@ -3811,25 +3838,103 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | |||
| 3811 | 3838 | ||
| 3812 | return 0; | 3839 | return 0; |
| 3813 | } | 3840 | } |
| 3841 | EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin_unlocked); | ||
| 3842 | |||
| 3843 | /** | ||
| 3844 | * snd_soc_dapm_force_enable_pin - force a pin to be enabled | ||
| 3845 | * @dapm: DAPM context | ||
| 3846 | * @pin: pin name | ||
| 3847 | * | ||
| 3848 | * Enables input/output pin regardless of any other state. This is | ||
| 3849 | * intended for use with microphone bias supplies used in microphone | ||
| 3850 | * jack detection. | ||
| 3851 | * | ||
| 3852 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to | ||
| 3853 | * do any widget power switching. | ||
| 3854 | */ | ||
| 3855 | int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | ||
| 3856 | const char *pin) | ||
| 3857 | { | ||
| 3858 | int ret; | ||
| 3859 | |||
| 3860 | mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | ||
| 3861 | |||
| 3862 | ret = snd_soc_dapm_force_enable_pin_unlocked(dapm, pin); | ||
| 3863 | |||
| 3864 | mutex_unlock(&dapm->card->dapm_mutex); | ||
| 3865 | |||
| 3866 | return ret; | ||
| 3867 | } | ||
| 3814 | EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin); | 3868 | EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin); |
| 3815 | 3869 | ||
| 3816 | /** | 3870 | /** |
| 3871 | * snd_soc_dapm_disable_pin_unlocked - disable pin. | ||
| 3872 | * @dapm: DAPM context | ||
| 3873 | * @pin: pin name | ||
| 3874 | * | ||
| 3875 | * Disables input/output pin and its parents or children widgets. | ||
| 3876 | * | ||
| 3877 | * Requires external locking. | ||
| 3878 | * | ||
| 3879 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to | ||
| 3880 | * do any widget power switching. | ||
| 3881 | */ | ||
| 3882 | int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, | ||
| 3883 | const char *pin) | ||
| 3884 | { | ||
| 3885 | return snd_soc_dapm_set_pin(dapm, pin, 0); | ||
| 3886 | } | ||
| 3887 | EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin_unlocked); | ||
| 3888 | |||
| 3889 | /** | ||
| 3817 | * snd_soc_dapm_disable_pin - disable pin. | 3890 | * snd_soc_dapm_disable_pin - disable pin. |
| 3818 | * @dapm: DAPM context | 3891 | * @dapm: DAPM context |
| 3819 | * @pin: pin name | 3892 | * @pin: pin name |
| 3820 | * | 3893 | * |
| 3821 | * Disables input/output pin and its parents or children widgets. | 3894 | * Disables input/output pin and its parents or children widgets. |
| 3895 | * | ||
| 3822 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to | 3896 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to |
| 3823 | * do any widget power switching. | 3897 | * do any widget power switching. |
| 3824 | */ | 3898 | */ |
| 3825 | int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, | 3899 | int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, |
| 3826 | const char *pin) | 3900 | const char *pin) |
| 3827 | { | 3901 | { |
| 3828 | return snd_soc_dapm_set_pin(dapm, pin, 0); | 3902 | int ret; |
| 3903 | |||
| 3904 | mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | ||
| 3905 | |||
| 3906 | ret = snd_soc_dapm_set_pin(dapm, pin, 0); | ||
| 3907 | |||
| 3908 | mutex_unlock(&dapm->card->dapm_mutex); | ||
| 3909 | |||
| 3910 | return ret; | ||
| 3829 | } | 3911 | } |
| 3830 | EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin); | 3912 | EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin); |
| 3831 | 3913 | ||
| 3832 | /** | 3914 | /** |
| 3915 | * snd_soc_dapm_nc_pin_unlocked - permanently disable pin. | ||
| 3916 | * @dapm: DAPM context | ||
| 3917 | * @pin: pin name | ||
| 3918 | * | ||
| 3919 | * Marks the specified pin as being not connected, disabling it along | ||
| 3920 | * any parent or child widgets. At present this is identical to | ||
| 3921 | * snd_soc_dapm_disable_pin() but in future it will be extended to do | ||
| 3922 | * additional things such as disabling controls which only affect | ||
| 3923 | * paths through the pin. | ||
| 3924 | * | ||
| 3925 | * Requires external locking. | ||
| 3926 | * | ||
| 3927 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to | ||
| 3928 | * do any widget power switching. | ||
| 3929 | */ | ||
| 3930 | int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, | ||
| 3931 | const char *pin) | ||
| 3932 | { | ||
| 3933 | return snd_soc_dapm_set_pin(dapm, pin, 0); | ||
| 3934 | } | ||
| 3935 | EXPORT_SYMBOL_GPL(snd_soc_dapm_nc_pin_unlocked); | ||
| 3936 | |||
| 3937 | /** | ||
| 3833 | * snd_soc_dapm_nc_pin - permanently disable pin. | 3938 | * snd_soc_dapm_nc_pin - permanently disable pin. |
| 3834 | * @dapm: DAPM context | 3939 | * @dapm: DAPM context |
| 3835 | * @pin: pin name | 3940 | * @pin: pin name |
| @@ -3845,7 +3950,15 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin); | |||
| 3845 | */ | 3950 | */ |
| 3846 | int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin) | 3951 | int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin) |
| 3847 | { | 3952 | { |
| 3848 | return snd_soc_dapm_set_pin(dapm, pin, 0); | 3953 | int ret; |
| 3954 | |||
| 3955 | mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | ||
| 3956 | |||
| 3957 | ret = snd_soc_dapm_set_pin(dapm, pin, 0); | ||
| 3958 | |||
| 3959 | mutex_unlock(&dapm->card->dapm_mutex); | ||
| 3960 | |||
| 3961 | return ret; | ||
| 3849 | } | 3962 | } |
| 3850 | EXPORT_SYMBOL_GPL(snd_soc_dapm_nc_pin); | 3963 | EXPORT_SYMBOL_GPL(snd_soc_dapm_nc_pin); |
| 3851 | 3964 | ||
