Skip to content

Commit 992fda1

Browse files
committed
Merge pull request #748 from notro/pinctrl
BCM2708: use pinctrl-bcm2835
2 parents 5fdce56 + 4532c63 commit 992fda1

File tree

9 files changed

+19
-781
lines changed

9 files changed

+19
-781
lines changed

arch/arm/boot/dts/bcm2708.dtsi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@
2525
};
2626

2727
gpio: gpio {
28-
compatible = "brcm,bcm2708-pinctrl";
28+
compatible = "brcm,bcm2835-gpio";
2929
reg = <0x7e200000 0xb4>;
30+
interrupts = <2 17>, <2 18>;
31+
3032
gpio-controller;
3133
#gpio-cells = <2>;
34+
35+
interrupt-controller;
36+
#interrupt-cells = <2>;
3237
};
3338

3439
i2s: i2s@7e203000 {

arch/arm/mach-bcm2708/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ config BCM2708_DT
1414
depends on MACH_BCM2708
1515
default n
1616
select USE_OF
17+
select ARCH_REQUIRE_GPIOLIB
1718
select PINCTRL
18-
select PINCTRL_BCM2708
19-
select BCM2708_GPIO
19+
select PINCTRL_BCM2835
2020
help
2121
Enable Device Tree support for BCM2708
2222

arch/arm/mach-bcm2708/armctrl.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void armctrl_unmask_irq(struct irq_data *d)
8484
#ifdef CONFIG_OF
8585

8686
#define NR_IRQS_BANK0 21
87-
#define NR_BANKS 3 + 1 /* bank 3 is used for GPIO interrupts */
87+
#define NR_BANKS 3
8888
#define IRQS_PER_BANK 32
8989

9090
/* from drivers/irqchip/irq-bcm2835.c */
@@ -108,10 +108,8 @@ static int armctrl_xlate(struct irq_domain *d, struct device_node *ctrlr,
108108
*out_hwirq = ARM_IRQ0_BASE + intspec[1];
109109
else if (intspec[0] == 1)
110110
*out_hwirq = ARM_IRQ1_BASE + intspec[1];
111-
else if (intspec[0] == 2)
112-
*out_hwirq = ARM_IRQ2_BASE + intspec[1];
113111
else
114-
*out_hwirq = GPIO_IRQ_START + intspec[1];
112+
*out_hwirq = ARM_IRQ2_BASE + intspec[1];
115113

116114
/* reverse remap_irqs[] */
117115
switch (*out_hwirq) {
@@ -167,7 +165,8 @@ void __init armctrl_dt_init(void)
167165
if (!np)
168166
return;
169167

170-
domain = irq_domain_add_legacy(np, NR_IRQS, IRQ_ARMCTRL_START, 0,
168+
domain = irq_domain_add_legacy(np, BCM2708_ALLOC_IRQS,
169+
IRQ_ARMCTRL_START, 0,
171170
&armctrl_ops, NULL);
172171
WARN_ON(!domain);
173172
}
@@ -298,7 +297,7 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start,
298297
{
299298
unsigned int irq;
300299

301-
for (irq = 0; irq < NR_IRQS; irq++) {
300+
for (irq = 0; irq < BCM2708_ALLOC_IRQS; irq++) {
302301
unsigned int data = irq;
303302
if (irq >= INTERRUPT_JPEG && irq <= INTERRUPT_ARASANSDIO)
304303
data = remap_irqs[irq - INTERRUPT_JPEG];

arch/arm/mach-bcm2708/bcm2708.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ void __init bcm2708_init(void)
838838
bcm_register_device(&bcm2708_dmaman_device);
839839
bcm_register_device(&bcm2708_vcio_device);
840840
#ifdef CONFIG_BCM2708_GPIO
841-
bcm_register_device(&bcm2708_gpio_device);
841+
bcm_register_device_dt(&bcm2708_gpio_device);
842842
#endif
843843
#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE)
844844
w1_gpio_pdata.pin = w1_gpio_pin;

arch/arm/mach-bcm2708/include/mach/irqs.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@
191191
#define FIQ_IRQS (64 + 21)
192192
#define GPIO_IRQ_START (HARD_IRQS + FIQ_IRQS)
193193
#define GPIO_IRQS (32*5)
194-
#define SPARE_IRQS (64)
195-
#define NR_IRQS (HARD_IRQS+FIQ_IRQS+GPIO_IRQS+SPARE_IRQS)
194+
#define SPARE_ALLOC_IRQS 64
195+
#define BCM2708_ALLOC_IRQS (HARD_IRQS+FIQ_IRQS+GPIO_IRQS+SPARE_ALLOC_IRQS)
196+
#define FREE_IRQS 128
197+
#define NR_IRQS (BCM2708_ALLOC_IRQS+FREE_IRQS)
196198

197199
#endif /* _BCM2708_IRQS_H_ */

drivers/pinctrl/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ config PINCTRL_BAYTRAIL
7979

8080
Requires ACPI device enumeration code to set up a platform device.
8181

82-
config PINCTRL_BCM2708
83-
bool
84-
select PINMUX
85-
select PINCONF
86-
8782
config PINCTRL_BCM2835
8883
bool
8984
select PINMUX

drivers/pinctrl/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ obj-$(CONFIG_PINCTRL_AS3722) += pinctrl-as3722.o
1414
obj-$(CONFIG_PINCTRL_BF54x) += pinctrl-adi2-bf54x.o
1515
obj-$(CONFIG_PINCTRL_BF60x) += pinctrl-adi2-bf60x.o
1616
obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o
17-
obj-$(CONFIG_PINCTRL_BCM2708) += pinctrl-bcm2708.o
1817
obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o
1918
obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o
2019
obj-$(CONFIG_PINCTRL_BCM281XX) += pinctrl-bcm281xx.o

0 commit comments

Comments
 (0)