Skip to content

Commit e6612a6

Browse files
moore-broslinusw
authored andcommitted
pinctrl: mediatek: use generic EINT register maps for each SoC
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent e6dabd3 commit e6612a6

File tree

7 files changed

+6
-102
lines changed

7 files changed

+6
-102
lines changed

drivers/pinctrl/mediatek/pinctrl-mt2701.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -538,26 +538,6 @@ static const struct mtk_pinctrl_devdata mt2701_pinctrl_data = {
538538
.ap_num = 169,
539539
.db_cnt = 16,
540540
},
541-
.eint_regs = {
542-
.stat = 0x000,
543-
.ack = 0x040,
544-
.mask = 0x080,
545-
.mask_set = 0x0c0,
546-
.mask_clr = 0x100,
547-
.sens = 0x140,
548-
.sens_set = 0x180,
549-
.sens_clr = 0x1c0,
550-
.soft = 0x200,
551-
.soft_set = 0x240,
552-
.soft_clr = 0x280,
553-
.pol = 0x300,
554-
.pol_set = 0x340,
555-
.pol_clr = 0x380,
556-
.dom_en = 0x400,
557-
.dbnc_ctrl = 0x500,
558-
.dbnc_set = 0x600,
559-
.dbnc_clr = 0x700,
560-
},
561541
};
562542

563543
static int mt2701_pinctrl_probe(struct platform_device *pdev)

drivers/pinctrl/mediatek/pinctrl-mt2712.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -583,26 +583,6 @@ static const struct mtk_pinctrl_devdata mt2712_pinctrl_data = {
583583
.ap_num = 229,
584584
.db_cnt = 40,
585585
},
586-
.eint_regs = {
587-
.stat = 0x000,
588-
.ack = 0x040,
589-
.mask = 0x080,
590-
.mask_set = 0x0c0,
591-
.mask_clr = 0x100,
592-
.sens = 0x140,
593-
.sens_set = 0x180,
594-
.sens_clr = 0x1c0,
595-
.soft = 0x200,
596-
.soft_set = 0x240,
597-
.soft_clr = 0x280,
598-
.pol = 0x300,
599-
.pol_set = 0x340,
600-
.pol_clr = 0x380,
601-
.dom_en = 0x400,
602-
.dbnc_ctrl = 0x500,
603-
.dbnc_set = 0x600,
604-
.dbnc_clr = 0x700,
605-
},
606586
};
607587

608588
static int mt2712_pinctrl_probe(struct platform_device *pdev)

drivers/pinctrl/mediatek/pinctrl-mt8127.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -307,26 +307,6 @@ static const struct mtk_pinctrl_devdata mt8127_pinctrl_data = {
307307
.ap_num = 143,
308308
.db_cnt = 16,
309309
},
310-
.eint_regs = {
311-
.stat = 0x000,
312-
.ack = 0x040,
313-
.mask = 0x080,
314-
.mask_set = 0x0c0,
315-
.mask_clr = 0x100,
316-
.sens = 0x140,
317-
.sens_set = 0x180,
318-
.sens_clr = 0x1c0,
319-
.soft = 0x200,
320-
.soft_set = 0x240,
321-
.soft_clr = 0x280,
322-
.pol = 0x300,
323-
.pol_set = 0x340,
324-
.pol_clr = 0x380,
325-
.dom_en = 0x400,
326-
.dbnc_ctrl = 0x500,
327-
.dbnc_set = 0x600,
328-
.dbnc_clr = 0x700,
329-
},
330310
};
331311

332312
static int mt8127_pinctrl_probe(struct platform_device *pdev)

drivers/pinctrl/mediatek/pinctrl-mt8135.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -320,26 +320,6 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = {
320320
.ap_num = 192,
321321
.db_cnt = 16,
322322
},
323-
.eint_regs = {
324-
.stat = 0x000,
325-
.ack = 0x040,
326-
.mask = 0x080,
327-
.mask_set = 0x0c0,
328-
.mask_clr = 0x100,
329-
.sens = 0x140,
330-
.sens_set = 0x180,
331-
.sens_clr = 0x1c0,
332-
.soft = 0x200,
333-
.soft_set = 0x240,
334-
.soft_clr = 0x280,
335-
.pol = 0x300,
336-
.pol_set = 0x340,
337-
.pol_clr = 0x380,
338-
.dom_en = 0x400,
339-
.dbnc_ctrl = 0x500,
340-
.dbnc_set = 0x600,
341-
.dbnc_clr = 0x700,
342-
},
343323
};
344324

345325
static int mt8135_pinctrl_probe(struct platform_device *pdev)

drivers/pinctrl/mediatek/pinctrl-mt8173.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -347,26 +347,6 @@ static const struct mtk_pinctrl_devdata mt8173_pinctrl_data = {
347347
.ap_num = 224,
348348
.db_cnt = 16,
349349
},
350-
.eint_regs = {
351-
.stat = 0x000,
352-
.ack = 0x040,
353-
.mask = 0x080,
354-
.mask_set = 0x0c0,
355-
.mask_clr = 0x100,
356-
.sens = 0x140,
357-
.sens_set = 0x180,
358-
.sens_clr = 0x1c0,
359-
.soft = 0x200,
360-
.soft_set = 0x240,
361-
.soft_clr = 0x280,
362-
.pol = 0x300,
363-
.pol_set = 0x340,
364-
.pol_clr = 0x380,
365-
.dom_en = 0x400,
366-
.dbnc_ctrl = 0x500,
367-
.dbnc_set = 0x600,
368-
.dbnc_clr = 0x700,
369-
},
370350
};
371351

372352
static int mt8173_pinctrl_probe(struct platform_device *pdev)

drivers/pinctrl/mediatek/pinctrl-mtk-common.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,11 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)
10141014
return -EINVAL;
10151015

10161016
pctl->eint->dev = &pdev->dev;
1017-
pctl->eint->regs = &pctl->devdata->eint_regs;
1017+
/*
1018+
* If pctl->eint->regs == NULL, it would fall back into using a generic
1019+
* register map in mtk_eint_do_init calls.
1020+
*/
1021+
pctl->eint->regs = pctl->devdata->eint_regs;
10181022
pctl->eint->hw = &pctl->devdata->eint_hw;
10191023
pctl->eint->pctl = pctl;
10201024
pctl->eint->gpio_xlate = &mtk_eint_xt;

drivers/pinctrl/mediatek/pinctrl-mtk-common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ struct mtk_pinctrl_devdata {
261261
unsigned char port_mask;
262262
unsigned char port_align;
263263
struct mtk_eint_hw eint_hw;
264-
struct mtk_eint_regs eint_regs;
264+
struct mtk_eint_regs *eint_regs;
265265
};
266266

267267
struct mtk_pinctrl {

0 commit comments

Comments
 (0)