diff options
| author | Mark Brown <broonie@linaro.org> | 2014-03-13 05:40:56 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2014-03-13 05:40:56 -0400 |
| commit | 7a87ac1f66800460e82b7ff3286dfec1c5bb9b84 (patch) | |
| tree | 5907ca9eee5d390d6817b5625780aa1505a6a132 /drivers | |
| parent | a9576cbbbafa2c687121638dadebfb136562a522 (diff) | |
| parent | e95d73c437a09e7febea18f8e998f958ef6d7a72 (diff) | |
Merge branch 'topic/dapm' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-pxa
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/extcon/extcon-arizona.c | 12 | ||||
| -rw-r--r-- | drivers/input/misc/arizona-haptics.c | 19 |
2 files changed, 0 insertions, 31 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) |
