diff options
author | Rob Herring <robh@kernel.org> | 2015-01-26 23:46:06 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-02-03 07:40:29 -0500 |
commit | 684bba2ff854c4a25727ee64f99b5bddcfa69777 (patch) | |
tree | 96393049396713ed3f7f9e9e41e70b8c6d147a97 /drivers/gpio | |
parent | 99480049867a8bf86b1730697e554eb662fbc28e (diff) |
gpio: pxa: add PXA1928 gpio type support
Add support for PXA1928 GPIOs. The PXA1928 adds a 6th bank from previous
generations.
Signed-off-by: Jing Xiang <jxiang@marvell.com>
Signed-off-by: Xiangzhan Meng <mengxzh@marvell.com>
[robh: ported to 3.19 from vendor kernel]
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-pxa.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index b4fb8de374c8..2fdb04b6f101 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c | |||
@@ -41,9 +41,12 @@ | |||
41 | * BANK 4 - 0x0104 0x0110 0x011C 0x0128 0x0134 0x0140 0x014C | 41 | * BANK 4 - 0x0104 0x0110 0x011C 0x0128 0x0134 0x0140 0x014C |
42 | * BANK 5 - 0x0108 0x0114 0x0120 0x012C 0x0138 0x0144 0x0150 | 42 | * BANK 5 - 0x0108 0x0114 0x0120 0x012C 0x0138 0x0144 0x0150 |
43 | * | 43 | * |
44 | * BANK 6 - 0x0200 0x020C 0x0218 0x0224 0x0230 0x023C 0x0248 | ||
45 | * | ||
44 | * NOTE: | 46 | * NOTE: |
45 | * BANK 3 is only available on PXA27x and later processors. | 47 | * BANK 3 is only available on PXA27x and later processors. |
46 | * BANK 4 and 5 are only available on PXA935 | 48 | * BANK 4 and 5 are only available on PXA935, PXA1928 |
49 | * BANK 6 is only available on PXA1928 | ||
47 | */ | 50 | */ |
48 | 51 | ||
49 | #define GPLR_OFFSET 0x00 | 52 | #define GPLR_OFFSET 0x00 |
@@ -56,7 +59,8 @@ | |||
56 | #define GAFR_OFFSET 0x54 | 59 | #define GAFR_OFFSET 0x54 |
57 | #define ED_MASK_OFFSET 0x9C /* GPIO edge detection for AP side */ | 60 | #define ED_MASK_OFFSET 0x9C /* GPIO edge detection for AP side */ |
58 | 61 | ||
59 | #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) | 62 | #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : ((n) > 5 ? 0x200 : 0x100) \ |
63 | + (((n) % 3) << 2)) | ||
60 | 64 | ||
61 | int pxa_last_gpio; | 65 | int pxa_last_gpio; |
62 | static int irq_base; | 66 | static int irq_base; |
@@ -92,6 +96,7 @@ enum pxa_gpio_type { | |||
92 | PXA93X_GPIO, | 96 | PXA93X_GPIO, |
93 | MMP_GPIO = 0x10, | 97 | MMP_GPIO = 0x10, |
94 | MMP2_GPIO, | 98 | MMP2_GPIO, |
99 | PXA1928_GPIO, | ||
95 | }; | 100 | }; |
96 | 101 | ||
97 | struct pxa_gpio_id { | 102 | struct pxa_gpio_id { |
@@ -139,6 +144,11 @@ static struct pxa_gpio_id mmp2_id = { | |||
139 | .gpio_nums = 192, | 144 | .gpio_nums = 192, |
140 | }; | 145 | }; |
141 | 146 | ||
147 | static struct pxa_gpio_id pxa1928_id = { | ||
148 | .type = PXA1928_GPIO, | ||
149 | .gpio_nums = 224, | ||
150 | }; | ||
151 | |||
142 | #define for_each_gpio_chip(i, c) \ | 152 | #define for_each_gpio_chip(i, c) \ |
143 | for (i = 0, c = &pxa_gpio_chips[0]; i <= pxa_last_gpio; i += 32, c++) | 153 | for (i = 0, c = &pxa_gpio_chips[0]; i <= pxa_last_gpio; i += 32, c++) |
144 | 154 | ||
@@ -486,6 +496,7 @@ static int pxa_gpio_nums(struct platform_device *pdev) | |||
486 | case PXA93X_GPIO: | 496 | case PXA93X_GPIO: |
487 | case MMP_GPIO: | 497 | case MMP_GPIO: |
488 | case MMP2_GPIO: | 498 | case MMP2_GPIO: |
499 | case PXA1928_GPIO: | ||
489 | gpio_type = pxa_id->type; | 500 | gpio_type = pxa_id->type; |
490 | count = pxa_id->gpio_nums - 1; | 501 | count = pxa_id->gpio_nums - 1; |
491 | break; | 502 | break; |
@@ -505,6 +516,7 @@ static const struct of_device_id pxa_gpio_dt_ids[] = { | |||
505 | { .compatible = "marvell,pxa93x-gpio", .data = &pxa93x_id, }, | 516 | { .compatible = "marvell,pxa93x-gpio", .data = &pxa93x_id, }, |
506 | { .compatible = "marvell,mmp-gpio", .data = &mmp_id, }, | 517 | { .compatible = "marvell,mmp-gpio", .data = &mmp_id, }, |
507 | { .compatible = "marvell,mmp2-gpio", .data = &mmp2_id, }, | 518 | { .compatible = "marvell,mmp2-gpio", .data = &mmp2_id, }, |
519 | { .compatible = "marvell,pxa1928-gpio", .data = &pxa1928_id, }, | ||
508 | {} | 520 | {} |
509 | }; | 521 | }; |
510 | 522 | ||
@@ -666,6 +678,7 @@ static const struct platform_device_id gpio_id_table[] = { | |||
666 | { "pxa93x-gpio", (unsigned long)&pxa93x_id }, | 678 | { "pxa93x-gpio", (unsigned long)&pxa93x_id }, |
667 | { "mmp-gpio", (unsigned long)&mmp_id }, | 679 | { "mmp-gpio", (unsigned long)&mmp_id }, |
668 | { "mmp2-gpio", (unsigned long)&mmp2_id }, | 680 | { "mmp2-gpio", (unsigned long)&mmp2_id }, |
681 | { "pxa1928-gpio", (unsigned long)&pxa1928_id }, | ||
669 | { }, | 682 | { }, |
670 | }; | 683 | }; |
671 | 684 | ||