aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-arizona.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-27 02:14:26 -0500
committerChanwoo Choi <cw00.choi@samsung.com>2013-01-15 01:42:17 -0500
commitcd74f7b3b387cbc6153b15c100982bac119af753 (patch)
tree0351bb481c4f7e24d361ccf8eb2f860641eddf4f /drivers/extcon/extcon-arizona.c
parentdb72e6a1629ab79f5599f21ab19f8eb31137befa (diff)
extcon: arizona: Only set GPIO if it has been requested
The micd_pol GPIO is only requested if we've specified one greater than 0 so apply the same test before we set it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-arizona.c')
-rw-r--r--drivers/extcon/extcon-arizona.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 7dbefe8fe5c2..9e1d104803e7 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -85,8 +85,9 @@ static void arizona_extcon_set_mode(struct arizona_extcon_info *info, int mode)
85{ 85{
86 struct arizona *arizona = info->arizona; 86 struct arizona *arizona = info->arizona;
87 87
88 gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio, 88 if (arizona->pdata.micd_pol_gpio > 0)
89 info->micd_modes[mode].gpio); 89 gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
90 info->micd_modes[mode].gpio);
90 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, 91 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,
91 ARIZONA_MICD_BIAS_SRC_MASK, 92 ARIZONA_MICD_BIAS_SRC_MASK,
92 info->micd_modes[mode].bias); 93 info->micd_modes[mode].bias);