aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>2016-11-29 10:44:41 -0500
committerMark Brown <broonie@kernel.org>2016-12-01 15:18:44 -0500
commitefd95c71f4892ad5d0d33099db25085763f4c6c3 (patch)
tree6b87a932bbcfaa8542dc5dafe6992b0f80f1e63c /drivers/extcon
parent1b4d9c22191583ef1fb7433417b2ceb2a608d887 (diff)
extcon: arizona: Use SoC component pin control functions
The name of a codec pin can have an optional prefix string, which is defined by the SoC machine driver. The snd_soc_dapm_x_pin functions take the fully-specified name including the prefix and so the existing code would fail to find the pin if the audio machine driver had added a prefix. Switch to using the snd_soc_component_x_pin equivalent functions that take a specified SoC component and automatically add the name prefix to the provided pin name. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-arizona.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 56e6c4c7c60d..d836d4ce5ee4 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -274,9 +274,10 @@ static void arizona_extcon_pulse_micbias(struct arizona_extcon_info *info)
274 struct arizona *arizona = info->arizona; 274 struct arizona *arizona = info->arizona;
275 const char *widget = arizona_extcon_get_micbias(info); 275 const char *widget = arizona_extcon_get_micbias(info);
276 struct snd_soc_dapm_context *dapm = arizona->dapm; 276 struct snd_soc_dapm_context *dapm = arizona->dapm;
277 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
277 int ret; 278 int ret;
278 279
279 ret = snd_soc_dapm_force_enable_pin(dapm, widget); 280 ret = snd_soc_component_force_enable_pin(component, widget);
280 if (ret != 0) 281 if (ret != 0)
281 dev_warn(arizona->dev, "Failed to enable %s: %d\n", 282 dev_warn(arizona->dev, "Failed to enable %s: %d\n",
282 widget, ret); 283 widget, ret);
@@ -284,7 +285,7 @@ static void arizona_extcon_pulse_micbias(struct arizona_extcon_info *info)
284 snd_soc_dapm_sync(dapm); 285 snd_soc_dapm_sync(dapm);
285 286
286 if (!arizona->pdata.micd_force_micbias) { 287 if (!arizona->pdata.micd_force_micbias) {
287 ret = snd_soc_dapm_disable_pin(arizona->dapm, widget); 288 ret = snd_soc_component_disable_pin(component, widget);
288 if (ret != 0) 289 if (ret != 0)
289 dev_warn(arizona->dev, "Failed to disable %s: %d\n", 290 dev_warn(arizona->dev, "Failed to disable %s: %d\n",
290 widget, ret); 291 widget, ret);
@@ -349,6 +350,7 @@ static void arizona_stop_mic(struct arizona_extcon_info *info)
349 struct arizona *arizona = info->arizona; 350 struct arizona *arizona = info->arizona;
350 const char *widget = arizona_extcon_get_micbias(info); 351 const char *widget = arizona_extcon_get_micbias(info);
351 struct snd_soc_dapm_context *dapm = arizona->dapm; 352 struct snd_soc_dapm_context *dapm = arizona->dapm;
353 struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
352 bool change; 354 bool change;
353 int ret; 355 int ret;
354 356
@@ -356,7 +358,7 @@ static void arizona_stop_mic(struct arizona_extcon_info *info)
356 ARIZONA_MICD_ENA, 0, 358 ARIZONA_MICD_ENA, 0,
357 &change); 359 &change);
358 360
359 ret = snd_soc_dapm_disable_pin(dapm, widget); 361 ret = snd_soc_component_disable_pin(component, widget);
360 if (ret != 0) 362 if (ret != 0)
361 dev_warn(arizona->dev, 363 dev_warn(arizona->dev,
362 "Failed to disable %s: %d\n", 364 "Failed to disable %s: %d\n",