summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/mediatek/pinctrl-mt8135.c
diff options
context:
space:
mode:
authorSean Wang2018-05-20 19:01:48 +0200
committerLinus Walleij2018-05-24 09:37:21 +0200
commite46df235b4e605aa4e7609a27c118a1cccd4ff9a (patch)
tree9af4bf24920c267f5ff6bd0e99aa2a8272bfcd45 /drivers/pinctrl/mediatek/pinctrl-mt8135.c
parentdt-bindings: pinctrl: add external interrupt support to MT7622 pinctrl (diff)
downloadkernel-qcow2-linux-e46df235b4e605aa4e7609a27c118a1cccd4ff9a.tar.gz
kernel-qcow2-linux-e46df235b4e605aa4e7609a27c118a1cccd4ff9a.tar.xz
kernel-qcow2-linux-e46df235b4e605aa4e7609a27c118a1cccd4ff9a.zip
pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit
This patch is in preparation for adding EINT support to MT7622 pinctrl, and the refactoring doesn't alter any existent logic. A reason we have to refactor EINT code pieces into a generic way is that currently, they're tightly coupled with a certain type of MediaTek pinctrl would cause a grown in a very bad way as there is different types of pinctrl devices getting to join. Therefore, it is an essential or urgent thing that EINT code pieces are refactored to eliminate any dependencies across GPIO and EINT as possible. Additional structure mtk_eint_[xt, hw, regs] are being introduced for indicating how maps being designed between GPIO and EINT hw number, how to set and get GPIO state for a certain EINT pin, what characteristic on a EINT device is present on various SoCs. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mediatek/pinctrl-mt8135.c')
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt8135.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8135.c b/drivers/pinctrl/mediatek/pinctrl-mt8135.c
index d8c645f16f21..fdfa357d681f 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt8135.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt8135.c
@@ -313,8 +313,14 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = {
.port_shf = 4,
.port_mask = 0xf,
.port_align = 4,
- .eint_offsets = {
+ .eint_hw = {
.name = "mt8135_eint",
+ .port_mask = 7,
+ .ports = 6,
+ .ap_num = 192,
+ .db_cnt = 16,
+ },
+ .eint_regs = {
.stat = 0x000,
.ack = 0x040,
.mask = 0x080,
@@ -333,11 +339,7 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = {
.dbnc_ctrl = 0x500,
.dbnc_set = 0x600,
.dbnc_clr = 0x700,
- .port_mask = 7,
- .ports = 6,
},
- .ap_num = 192,
- .db_cnt = 16,
};
static int mt8135_pinctrl_probe(struct platform_device *pdev)