2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 20:23:57 +08:00

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>
This commit is contained in:
Mark Brown 2012-11-27 16:14:26 +09:00 committed by Chanwoo Choi
parent db72e6a162
commit cd74f7b3b3

View File

@ -85,6 +85,7 @@ static void arizona_extcon_set_mode(struct arizona_extcon_info *info, int mode)
{ {
struct arizona *arizona = info->arizona; struct arizona *arizona = info->arizona;
if (arizona->pdata.micd_pol_gpio > 0)
gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio, gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
info->micd_modes[mode].gpio); info->micd_modes[mode].gpio);
regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,