So far, EINT on each SoC all used exactly identical register map and thus
it's better that we apply generic register map already supported in EINT
library and stop copy-n-pasting the same data block and filling into its
platform data.
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
                .ap_num    = 169,
                .db_cnt    = 16,
        },
-       .eint_regs = {
-               .stat      = 0x000,
-               .ack       = 0x040,
-               .mask      = 0x080,
-               .mask_set  = 0x0c0,
-               .mask_clr  = 0x100,
-               .sens      = 0x140,
-               .sens_set  = 0x180,
-               .sens_clr  = 0x1c0,
-               .soft      = 0x200,
-               .soft_set  = 0x240,
-               .soft_clr  = 0x280,
-               .pol       = 0x300,
-               .pol_set   = 0x340,
-               .pol_clr   = 0x380,
-               .dom_en    = 0x400,
-               .dbnc_ctrl = 0x500,
-               .dbnc_set  = 0x600,
-               .dbnc_clr  = 0x700,
-       },
 };
 
 static int mt2701_pinctrl_probe(struct platform_device *pdev)
 
                .ap_num    = 229,
                .db_cnt    = 40,
        },
-       .eint_regs = {
-               .stat      = 0x000,
-               .ack       = 0x040,
-               .mask      = 0x080,
-               .mask_set  = 0x0c0,
-               .mask_clr  = 0x100,
-               .sens      = 0x140,
-               .sens_set  = 0x180,
-               .sens_clr  = 0x1c0,
-               .soft      = 0x200,
-               .soft_set  = 0x240,
-               .soft_clr  = 0x280,
-               .pol       = 0x300,
-               .pol_set   = 0x340,
-               .pol_clr   = 0x380,
-               .dom_en    = 0x400,
-               .dbnc_ctrl = 0x500,
-               .dbnc_set  = 0x600,
-               .dbnc_clr  = 0x700,
-       },
 };
 
 static int mt2712_pinctrl_probe(struct platform_device *pdev)
 
                .ap_num    = 143,
                .db_cnt    = 16,
        },
-       .eint_regs = {
-               .stat      = 0x000,
-               .ack       = 0x040,
-               .mask      = 0x080,
-               .mask_set  = 0x0c0,
-               .mask_clr  = 0x100,
-               .sens      = 0x140,
-               .sens_set  = 0x180,
-               .sens_clr  = 0x1c0,
-               .soft      = 0x200,
-               .soft_set  = 0x240,
-               .soft_clr  = 0x280,
-               .pol       = 0x300,
-               .pol_set   = 0x340,
-               .pol_clr   = 0x380,
-               .dom_en    = 0x400,
-               .dbnc_ctrl = 0x500,
-               .dbnc_set  = 0x600,
-               .dbnc_clr  = 0x700,
-       },
 };
 
 static int mt8127_pinctrl_probe(struct platform_device *pdev)
 
                .ap_num    = 192,
                .db_cnt    = 16,
        },
-       .eint_regs = {
-               .stat      = 0x000,
-               .ack       = 0x040,
-               .mask      = 0x080,
-               .mask_set  = 0x0c0,
-               .mask_clr  = 0x100,
-               .sens      = 0x140,
-               .sens_set  = 0x180,
-               .sens_clr  = 0x1c0,
-               .soft      = 0x200,
-               .soft_set  = 0x240,
-               .soft_clr  = 0x280,
-               .pol       = 0x300,
-               .pol_set   = 0x340,
-               .pol_clr   = 0x380,
-               .dom_en    = 0x400,
-               .dbnc_ctrl = 0x500,
-               .dbnc_set  = 0x600,
-               .dbnc_clr  = 0x700,
-       },
 };
 
 static int mt8135_pinctrl_probe(struct platform_device *pdev)
 
                .ap_num    = 224,
                .db_cnt    = 16,
        },
-       .eint_regs = {
-               .stat      = 0x000,
-               .ack       = 0x040,
-               .mask      = 0x080,
-               .mask_set  = 0x0c0,
-               .mask_clr  = 0x100,
-               .sens      = 0x140,
-               .sens_set  = 0x180,
-               .sens_clr  = 0x1c0,
-               .soft      = 0x200,
-               .soft_set  = 0x240,
-               .soft_clr  = 0x280,
-               .pol       = 0x300,
-               .pol_set   = 0x340,
-               .pol_clr   = 0x380,
-               .dom_en    = 0x400,
-               .dbnc_ctrl = 0x500,
-               .dbnc_set  = 0x600,
-               .dbnc_clr  = 0x700,
-       },
 };
 
 static int mt8173_pinctrl_probe(struct platform_device *pdev)
 
                return -EINVAL;
 
        pctl->eint->dev = &pdev->dev;
-       pctl->eint->regs = &pctl->devdata->eint_regs;
+       /*
+        * If pctl->eint->regs == NULL, it would fall back into using a generic
+        * register map in mtk_eint_do_init calls.
+        */
+       pctl->eint->regs = pctl->devdata->eint_regs;
        pctl->eint->hw = &pctl->devdata->eint_hw;
        pctl->eint->pctl = pctl;
        pctl->eint->gpio_xlate = &mtk_eint_xt;
 
        unsigned char  port_mask;
        unsigned char  port_align;
        struct mtk_eint_hw eint_hw;
-       struct mtk_eint_regs eint_regs;
+       struct mtk_eint_regs *eint_regs;
 };
 
 struct mtk_pinctrl {