aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2018-11-30 14:54:31 -0500
committerOlof Johansson <olof@lixom.net>2018-11-30 14:54:31 -0500
commit89acb56db4979e55380839c815566ddb9a01949b (patch)
tree2af287c629ddb31e409193f41b0e8ab51a0ffa2e
parentadb97bcdbdb2d42c90b5f11e08a9b5fbc017e5d7 (diff)
parent27df7977099c2b8d32399cd1752f527c5a343dfa (diff)
Merge tag 'davinci-fixes-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into fixes
DaVinci: fix GPIO breakage after v4.19 This set of changes is needed to fix the broken GPIO support for DaVinci boards in legacy mode after certain changes made to the GPIO driver in 4.19, namely: commits 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") and eb3744a2dd01 ("gpio: davinci: Do not assume continuous IRQ numbering"). * tag 'davinci-fixes-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: davinci: dm644x: set the GPIO base to 0 ARM: davinci: da830: set the GPIO base to 0 ARM: davinci: dm355: set the GPIO base to 0 ARM: davinci: dm646x: set the GPIO base to 0 ARM: davinci: dm365: set the GPIO base to 0 ARM: davinci: da850: set the GPIO base to 0 gpio: davinci: restore a way to manually specify the GPIO base ARM: davinci: dm644x: define gpio interrupts as separate resources ARM: davinci: dm355: define gpio interrupts as separate resources ARM: davinci: dm646x: define gpio interrupts as separate resources ARM: davinci: dm365: define gpio interrupts as separate resources ARM: davinci: da8xx: define gpio interrupts as separate resources Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-davinci/da830.c4
-rw-r--r--arch/arm/mach-davinci/da850.c4
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c40
-rw-r--r--arch/arm/mach-davinci/dm355.c32
-rw-r--r--arch/arm/mach-davinci/dm365.c37
-rw-r--r--arch/arm/mach-davinci/dm644x.c22
-rw-r--r--arch/arm/mach-davinci/dm646x.c12
-rw-r--r--drivers/gpio/gpio-davinci.c2
-rw-r--r--include/linux/platform_data/gpio-davinci.h2
9 files changed, 152 insertions, 3 deletions
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 0bc5bd2665df..2cc9fe4c3a91 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -759,7 +759,9 @@ static struct davinci_id da830_ids[] = {
759}; 759};
760 760
761static struct davinci_gpio_platform_data da830_gpio_platform_data = { 761static struct davinci_gpio_platform_data da830_gpio_platform_data = {
762 .ngpio = 128, 762 .no_auto_base = true,
763 .base = 0,
764 .ngpio = 128,
763}; 765};
764 766
765int __init da830_register_gpio(void) 767int __init da830_register_gpio(void)
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 4528bbf0c861..e7b78df2bfef 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -719,7 +719,9 @@ int __init da850_register_vpif_capture(struct vpif_capture_config
719} 719}
720 720
721static struct davinci_gpio_platform_data da850_gpio_platform_data = { 721static struct davinci_gpio_platform_data da850_gpio_platform_data = {
722 .ngpio = 144, 722 .no_auto_base = true,
723 .base = 0,
724 .ngpio = 144,
723}; 725};
724 726
725int __init da850_register_gpio(void) 727int __init da850_register_gpio(void)
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 1fd3619f6a09..cf78da5ab054 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -701,6 +701,46 @@ static struct resource da8xx_gpio_resources[] = {
701 }, 701 },
702 { /* interrupt */ 702 { /* interrupt */
703 .start = IRQ_DA8XX_GPIO0, 703 .start = IRQ_DA8XX_GPIO0,
704 .end = IRQ_DA8XX_GPIO0,
705 .flags = IORESOURCE_IRQ,
706 },
707 {
708 .start = IRQ_DA8XX_GPIO1,
709 .end = IRQ_DA8XX_GPIO1,
710 .flags = IORESOURCE_IRQ,
711 },
712 {
713 .start = IRQ_DA8XX_GPIO2,
714 .end = IRQ_DA8XX_GPIO2,
715 .flags = IORESOURCE_IRQ,
716 },
717 {
718 .start = IRQ_DA8XX_GPIO3,
719 .end = IRQ_DA8XX_GPIO3,
720 .flags = IORESOURCE_IRQ,
721 },
722 {
723 .start = IRQ_DA8XX_GPIO4,
724 .end = IRQ_DA8XX_GPIO4,
725 .flags = IORESOURCE_IRQ,
726 },
727 {
728 .start = IRQ_DA8XX_GPIO5,
729 .end = IRQ_DA8XX_GPIO5,
730 .flags = IORESOURCE_IRQ,
731 },
732 {
733 .start = IRQ_DA8XX_GPIO6,
734 .end = IRQ_DA8XX_GPIO6,
735 .flags = IORESOURCE_IRQ,
736 },
737 {
738 .start = IRQ_DA8XX_GPIO7,
739 .end = IRQ_DA8XX_GPIO7,
740 .flags = IORESOURCE_IRQ,
741 },
742 {
743 .start = IRQ_DA8XX_GPIO8,
704 .end = IRQ_DA8XX_GPIO8, 744 .end = IRQ_DA8XX_GPIO8,
705 .flags = IORESOURCE_IRQ, 745 .flags = IORESOURCE_IRQ,
706 }, 746 },
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 9f7d38d12c88..4c6e0bef4509 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -548,12 +548,44 @@ static struct resource dm355_gpio_resources[] = {
548 }, 548 },
549 { /* interrupt */ 549 { /* interrupt */
550 .start = IRQ_DM355_GPIOBNK0, 550 .start = IRQ_DM355_GPIOBNK0,
551 .end = IRQ_DM355_GPIOBNK0,
552 .flags = IORESOURCE_IRQ,
553 },
554 {
555 .start = IRQ_DM355_GPIOBNK1,
556 .end = IRQ_DM355_GPIOBNK1,
557 .flags = IORESOURCE_IRQ,
558 },
559 {
560 .start = IRQ_DM355_GPIOBNK2,
561 .end = IRQ_DM355_GPIOBNK2,
562 .flags = IORESOURCE_IRQ,
563 },
564 {
565 .start = IRQ_DM355_GPIOBNK3,
566 .end = IRQ_DM355_GPIOBNK3,
567 .flags = IORESOURCE_IRQ,
568 },
569 {
570 .start = IRQ_DM355_GPIOBNK4,
571 .end = IRQ_DM355_GPIOBNK4,
572 .flags = IORESOURCE_IRQ,
573 },
574 {
575 .start = IRQ_DM355_GPIOBNK5,
576 .end = IRQ_DM355_GPIOBNK5,
577 .flags = IORESOURCE_IRQ,
578 },
579 {
580 .start = IRQ_DM355_GPIOBNK6,
551 .end = IRQ_DM355_GPIOBNK6, 581 .end = IRQ_DM355_GPIOBNK6,
552 .flags = IORESOURCE_IRQ, 582 .flags = IORESOURCE_IRQ,
553 }, 583 },
554}; 584};
555 585
556static struct davinci_gpio_platform_data dm355_gpio_platform_data = { 586static struct davinci_gpio_platform_data dm355_gpio_platform_data = {
587 .no_auto_base = true,
588 .base = 0,
557 .ngpio = 104, 589 .ngpio = 104,
558}; 590};
559 591
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index abcf2a5ed89b..01fb2b0c82de 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -267,12 +267,49 @@ static struct resource dm365_gpio_resources[] = {
267 }, 267 },
268 { /* interrupt */ 268 { /* interrupt */
269 .start = IRQ_DM365_GPIO0, 269 .start = IRQ_DM365_GPIO0,
270 .end = IRQ_DM365_GPIO0,
271 .flags = IORESOURCE_IRQ,
272 },
273 {
274 .start = IRQ_DM365_GPIO1,
275 .end = IRQ_DM365_GPIO1,
276 .flags = IORESOURCE_IRQ,
277 },
278 {
279 .start = IRQ_DM365_GPIO2,
280 .end = IRQ_DM365_GPIO2,
281 .flags = IORESOURCE_IRQ,
282 },
283 {
284 .start = IRQ_DM365_GPIO3,
285 .end = IRQ_DM365_GPIO3,
286 .flags = IORESOURCE_IRQ,
287 },
288 {
289 .start = IRQ_DM365_GPIO4,
290 .end = IRQ_DM365_GPIO4,
291 .flags = IORESOURCE_IRQ,
292 },
293 {
294 .start = IRQ_DM365_GPIO5,
295 .end = IRQ_DM365_GPIO5,
296 .flags = IORESOURCE_IRQ,
297 },
298 {
299 .start = IRQ_DM365_GPIO6,
300 .end = IRQ_DM365_GPIO6,
301 .flags = IORESOURCE_IRQ,
302 },
303 {
304 .start = IRQ_DM365_GPIO7,
270 .end = IRQ_DM365_GPIO7, 305 .end = IRQ_DM365_GPIO7,
271 .flags = IORESOURCE_IRQ, 306 .flags = IORESOURCE_IRQ,
272 }, 307 },
273}; 308};
274 309
275static struct davinci_gpio_platform_data dm365_gpio_platform_data = { 310static struct davinci_gpio_platform_data dm365_gpio_platform_data = {
311 .no_auto_base = true,
312 .base = 0,
276 .ngpio = 104, 313 .ngpio = 104,
277 .gpio_unbanked = 8, 314 .gpio_unbanked = 8,
278}; 315};
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 0720da7809a6..38f92b7d413e 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -492,12 +492,34 @@ static struct resource dm644_gpio_resources[] = {
492 }, 492 },
493 { /* interrupt */ 493 { /* interrupt */
494 .start = IRQ_GPIOBNK0, 494 .start = IRQ_GPIOBNK0,
495 .end = IRQ_GPIOBNK0,
496 .flags = IORESOURCE_IRQ,
497 },
498 {
499 .start = IRQ_GPIOBNK1,
500 .end = IRQ_GPIOBNK1,
501 .flags = IORESOURCE_IRQ,
502 },
503 {
504 .start = IRQ_GPIOBNK2,
505 .end = IRQ_GPIOBNK2,
506 .flags = IORESOURCE_IRQ,
507 },
508 {
509 .start = IRQ_GPIOBNK3,
510 .end = IRQ_GPIOBNK3,
511 .flags = IORESOURCE_IRQ,
512 },
513 {
514 .start = IRQ_GPIOBNK4,
495 .end = IRQ_GPIOBNK4, 515 .end = IRQ_GPIOBNK4,
496 .flags = IORESOURCE_IRQ, 516 .flags = IORESOURCE_IRQ,
497 }, 517 },
498}; 518};
499 519
500static struct davinci_gpio_platform_data dm644_gpio_platform_data = { 520static struct davinci_gpio_platform_data dm644_gpio_platform_data = {
521 .no_auto_base = true,
522 .base = 0,
501 .ngpio = 71, 523 .ngpio = 71,
502}; 524};
503 525
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 6bd2ed069d0d..7dc54b2a610f 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -442,12 +442,24 @@ static struct resource dm646x_gpio_resources[] = {
442 }, 442 },
443 { /* interrupt */ 443 { /* interrupt */
444 .start = IRQ_DM646X_GPIOBNK0, 444 .start = IRQ_DM646X_GPIOBNK0,
445 .end = IRQ_DM646X_GPIOBNK0,
446 .flags = IORESOURCE_IRQ,
447 },
448 {
449 .start = IRQ_DM646X_GPIOBNK1,
450 .end = IRQ_DM646X_GPIOBNK1,
451 .flags = IORESOURCE_IRQ,
452 },
453 {
454 .start = IRQ_DM646X_GPIOBNK2,
445 .end = IRQ_DM646X_GPIOBNK2, 455 .end = IRQ_DM646X_GPIOBNK2,
446 .flags = IORESOURCE_IRQ, 456 .flags = IORESOURCE_IRQ,
447 }, 457 },
448}; 458};
449 459
450static struct davinci_gpio_platform_data dm646x_gpio_platform_data = { 460static struct davinci_gpio_platform_data dm646x_gpio_platform_data = {
461 .no_auto_base = true,
462 .base = 0,
451 .ngpio = 43, 463 .ngpio = 43,
452}; 464};
453 465
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index 5c1564fcc24e..bdb29e51b417 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -258,7 +258,7 @@ static int davinci_gpio_probe(struct platform_device *pdev)
258 chips->chip.set = davinci_gpio_set; 258 chips->chip.set = davinci_gpio_set;
259 259
260 chips->chip.ngpio = ngpio; 260 chips->chip.ngpio = ngpio;
261 chips->chip.base = -1; 261 chips->chip.base = pdata->no_auto_base ? pdata->base : -1;
262 262
263#ifdef CONFIG_OF_GPIO 263#ifdef CONFIG_OF_GPIO
264 chips->chip.of_gpio_n_cells = 2; 264 chips->chip.of_gpio_n_cells = 2;
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h
index f92a47e18034..a93841bfb9f7 100644
--- a/include/linux/platform_data/gpio-davinci.h
+++ b/include/linux/platform_data/gpio-davinci.h
@@ -17,6 +17,8 @@
17#define __DAVINCI_GPIO_PLATFORM_H 17#define __DAVINCI_GPIO_PLATFORM_H
18 18
19struct davinci_gpio_platform_data { 19struct davinci_gpio_platform_data {
20 bool no_auto_base;
21 u32 base;
20 u32 ngpio; 22 u32 ngpio;
21 u32 gpio_unbanked; 23 u32 gpio_unbanked;
22}; 24};