summaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-27 16:14:26 +0900
committerChanwoo Choi <cw00.choi@samsung.com>2013-01-15 15:42:17 +0900
commitcd74f7b3b387cbc6153b15c100982bac119af753 (patch)
tree0351bb481c4f7e24d361ccf8eb2f860641eddf4f /drivers/extcon
parentdb72e6a1629ab79f5599f21ab19f8eb31137befa (diff)
downloadop-kernel-dev-cd74f7b3b387cbc6153b15c100982bac119af753.zip
op-kernel-dev-cd74f7b3b387cbc6153b15c100982bac119af753.tar.gz
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')
-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 7dbefe8..9e1d104 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)
{
struct arizona *arizona = info->arizona;
- gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
- info->micd_modes[mode].gpio);
+ if (arizona->pdata.micd_pol_gpio > 0)
+ gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
+ info->micd_modes[mode].gpio);
regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,
ARIZONA_MICD_BIAS_SRC_MASK,
info->micd_modes[mode].bias);
OpenPOWER on IntegriCloud