diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-12-17 14:57:46 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-12-17 14:57:46 +0100 |
commit | 4dccc93f1e7f4e2fd92a48c40a7ac9211a029352 (patch) | |
tree | 717a183f0dba200a882126cf095f38e319302c51 /drivers/pinctrl/mediatek | |
parent | pinctrl: fixup problematic flag (diff) | |
parent | Linux 4.4-rc5 (diff) | |
download | linux-4dccc93f1e7f4e2fd92a48c40a7ac9211a029352.tar.xz linux-4dccc93f1e7f4e2fd92a48c40a7ac9211a029352.zip |
Merge tag 'v4.4-rc5' into devel
Linux 4.4-rc5
Diffstat (limited to 'drivers/pinctrl/mediatek')
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 3bb4a2ae8ee4..8db7cdfbfbc6 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -754,7 +754,7 @@ static int mtk_gpio_get_direction(struct gpio_chip *chip, unsigned offset) reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; bit = BIT(offset & 0xf); regmap_read(pctl->regmap1, reg_addr, &read_val); - return !!(read_val & bit); + return !(read_val & bit); } static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset) @@ -764,12 +764,8 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset) unsigned int read_val = 0; struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); - if (mtk_gpio_get_direction(chip, offset)) - reg_addr = mtk_get_port(pctl, offset) + - pctl->devdata->dout_offset; - else - reg_addr = mtk_get_port(pctl, offset) + - pctl->devdata->din_offset; + reg_addr = mtk_get_port(pctl, offset) + + pctl->devdata->din_offset; bit = BIT(offset & 0xf); regmap_read(pctl->regmap1, reg_addr, &read_val); @@ -1004,6 +1000,7 @@ static struct gpio_chip mtk_gpio_chip = { .owner = THIS_MODULE, .request = gpiochip_generic_request, .free = gpiochip_generic_free, + .get_direction = mtk_gpio_get_direction, .direction_input = mtk_gpio_direction_input, .direction_output = mtk_gpio_direction_output, .get = mtk_gpio_get, |