pinctrl: qcom-spmi: Fix pin direction configuration
authorIvan T. Ivanov <ivan.ivanov@linaro.org>
Fri, 17 Apr 2015 14:50:49 +0000 (17:50 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 27 Apr 2015 13:33:42 +0000 (15:33 +0200)
Pin direction configuration was incorrectly overwritten
by output and function values in set_mux(). Fix this.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c

index b2d22218a2582f94b2c5d0274843fa0c2d3d7162..de684ca93b5af59910077a27fb1d13e3b6d06224 100644 (file)
@@ -260,6 +260,7 @@ static int pmic_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned function,
                        val = 1;
        }
 
+       val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT;
        val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT;
        val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT;
 
index 8f36c5f9194903fd8433736499a03a61afbfb2ac..890df16353b301b0d95244804c269a683c1165fc 100644 (file)
@@ -370,6 +370,7 @@ static int pmic_mpp_set_mux(struct pinctrl_dev *pctldev, unsigned function,
                }
        }
 
+       val = val << PMIC_MPP_REG_MODE_DIR_SHIFT;
        val |= pad->function << PMIC_MPP_REG_MODE_FUNCTION_SHIFT;
        val |= pad->out_value & PMIC_MPP_REG_MODE_VALUE_MASK;