Skip to content

Commit

Permalink
pinctrl: mediatek: check mtk_is_virt_gpio input parameter
Browse files Browse the repository at this point in the history
[ Upstream commit 39c4dbe ]

check mtk_is_virt_gpio input parameter,
virtual gpio need to support eint mode.

add error handler for the ko case
to fix this boot fail:
pc : mtk_is_virt_gpio+0x20/0x38 [pinctrl_mtk_common_v2]
lr : mtk_gpio_get_direction+0x44/0xb0 [pinctrl_paris]

Fixes: edd5464 ("pinctrl: mediatek: avoid virtual gpio trying to set reg")
Signed-off-by: Hanks Chen <hanks.chen@mediatek.com>
Acked-by: Sean Wang <sean.wang@kernel.org>
Singed-off-by: Jie Yang <sin_jieyang@mediatek.com>
Link: https://lore.kernel.org/r/1597922546-29633-1-git-send-email-hanks.chen@mediatek.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Hanks Chen authored and gregkh committed Oct 7, 2020
1 parent 1b62e49 commit b7d4230
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ bool mtk_is_virt_gpio(struct mtk_pinctrl *hw, unsigned int gpio_n)

desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n];

/* if the GPIO is not supported for eint mode */
if (desc->eint.eint_m == NO_EINT_SUPPORT)
return virt_gpio;

if (desc->funcs && !desc->funcs[desc->eint.eint_m].name)
virt_gpio = true;

Expand Down

0 comments on commit b7d4230

Please sign in to comment.