diff options
author | Olof Johansson <olof@lixom.net> | 2013-11-15 18:17:59 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-11-15 18:17:59 -0500 |
commit | 6886059f2ef5d62c73e87a905e84fa4f87d56074 (patch) | |
tree | dfe6e1611d7c50057df52db7b55eafbfb8e33a93 /arch/arm | |
parent | ca439c9b983ffa14e9eae6030e3ee80ad039388f (diff) | |
parent | 26273e02a0cf18eb72416559310d3294390a9024 (diff) |
Merge tag 'omap-for-v3.13/fixes-for-merge-window-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
Few clock fixes, a runtime PM fix, and pinctrl-single fix along
with few other fixes that popped up during the merge window.
* tag 'omap-for-v3.13/fixes-for-merge-window-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP2+: Fix build for dra7xx without omap4 and 5
ARM: OMAP2+: omap_device: maintain sane runtime pm status around suspend/resume
doc: devicetree: Add bindings documentation for omap-des driver
ARM: dts: doc: Document missing compatible property for omap-sham driver
ARM: OMAP3: Beagle: fix return value check in beagle_opp_init()
ARM: OMAP: devicetree: fix SPI node compatible property syntax items
pinctrl: single: call pcs_soc->rearm() whenever IRQ mask is changed
ARM: OMAP2+: smsc911x: fix return value check in gpmc_smsc911x_init()
+ sync with newer trunk
Diffstat (limited to 'arch/arm')
58 files changed, 456 insertions, 546 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 04163fece49f..acb80708accd 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -54,6 +54,7 @@ config ARM | |||
54 | select HAVE_REGS_AND_STACK_ACCESS_API | 54 | select HAVE_REGS_AND_STACK_ACCESS_API |
55 | select HAVE_SYSCALL_TRACEPOINTS | 55 | select HAVE_SYSCALL_TRACEPOINTS |
56 | select HAVE_UID16 | 56 | select HAVE_UID16 |
57 | select HAVE_VIRT_CPU_ACCOUNTING_GEN | ||
57 | select IRQ_FORCED_THREADING | 58 | select IRQ_FORCED_THREADING |
58 | select KTIME_SCALAR | 59 | select KTIME_SCALAR |
59 | select MODULES_USE_ELF_REL | 60 | select MODULES_USE_ELF_REL |
@@ -388,7 +389,6 @@ config ARCH_GEMINI | |||
388 | select CLKSRC_MMIO | 389 | select CLKSRC_MMIO |
389 | select CPU_FA526 | 390 | select CPU_FA526 |
390 | select GENERIC_CLOCKEVENTS | 391 | select GENERIC_CLOCKEVENTS |
391 | select NEED_MACH_GPIO_H | ||
392 | help | 392 | help |
393 | Support for the Cortina Systems Gemini family SoCs | 393 | Support for the Cortina Systems Gemini family SoCs |
394 | 394 | ||
@@ -457,7 +457,7 @@ config ARCH_IOP32X | |||
457 | depends on MMU | 457 | depends on MMU |
458 | select ARCH_REQUIRE_GPIOLIB | 458 | select ARCH_REQUIRE_GPIOLIB |
459 | select CPU_XSCALE | 459 | select CPU_XSCALE |
460 | select NEED_MACH_GPIO_H | 460 | select GPIO_IOP |
461 | select NEED_RET_TO_USER | 461 | select NEED_RET_TO_USER |
462 | select PCI | 462 | select PCI |
463 | select PLAT_IOP | 463 | select PLAT_IOP |
@@ -470,7 +470,7 @@ config ARCH_IOP33X | |||
470 | depends on MMU | 470 | depends on MMU |
471 | select ARCH_REQUIRE_GPIOLIB | 471 | select ARCH_REQUIRE_GPIOLIB |
472 | select CPU_XSCALE | 472 | select CPU_XSCALE |
473 | select NEED_MACH_GPIO_H | 473 | select GPIO_IOP |
474 | select NEED_RET_TO_USER | 474 | select NEED_RET_TO_USER |
475 | select PCI | 475 | select PCI |
476 | select PLAT_IOP | 476 | select PLAT_IOP |
@@ -559,7 +559,6 @@ config ARCH_MMP | |||
559 | select GPIO_PXA | 559 | select GPIO_PXA |
560 | select IRQ_DOMAIN | 560 | select IRQ_DOMAIN |
561 | select MULTI_IRQ_HANDLER | 561 | select MULTI_IRQ_HANDLER |
562 | select NEED_MACH_GPIO_H | ||
563 | select PINCTRL | 562 | select PINCTRL |
564 | select PLAT_PXA | 563 | select PLAT_PXA |
565 | select SPARSE_IRQ | 564 | select SPARSE_IRQ |
@@ -622,7 +621,6 @@ config ARCH_PXA | |||
622 | select GPIO_PXA | 621 | select GPIO_PXA |
623 | select HAVE_IDE | 622 | select HAVE_IDE |
624 | select MULTI_IRQ_HANDLER | 623 | select MULTI_IRQ_HANDLER |
625 | select NEED_MACH_GPIO_H | ||
626 | select PLAT_PXA | 624 | select PLAT_PXA |
627 | select SPARSE_IRQ | 625 | select SPARSE_IRQ |
628 | help | 626 | help |
diff --git a/arch/arm/boot/dts/atlas6.dtsi b/arch/arm/boot/dts/atlas6.dtsi index a49032c6e199..978bab4991df 100644 --- a/arch/arm/boot/dts/atlas6.dtsi +++ b/arch/arm/boot/dts/atlas6.dtsi | |||
@@ -558,6 +558,18 @@ | |||
558 | sirf,function = "usb1_utmi_drvbus"; | 558 | sirf,function = "usb1_utmi_drvbus"; |
559 | }; | 559 | }; |
560 | }; | 560 | }; |
561 | usb1_dp_dn_pins_a: usb1_dp_dn@0 { | ||
562 | usb1_dp_dn { | ||
563 | sirf,pins = "usb1_dp_dngrp"; | ||
564 | sirf,function = "usb1_dp_dn"; | ||
565 | }; | ||
566 | }; | ||
567 | uart1_route_io_usb1_pins_a: uart1_route_io_usb1@0 { | ||
568 | uart1_route_io_usb1 { | ||
569 | sirf,pins = "uart1_route_io_usb1grp"; | ||
570 | sirf,function = "uart1_route_io_usb1"; | ||
571 | }; | ||
572 | }; | ||
561 | warm_rst_pins_a: warm_rst@0 { | 573 | warm_rst_pins_a: warm_rst@0 { |
562 | warm_rst { | 574 | warm_rst { |
563 | sirf,pins = "warm_rstgrp"; | 575 | sirf,pins = "warm_rstgrp"; |
diff --git a/arch/arm/boot/dts/prima2.dtsi b/arch/arm/boot/dts/prima2.dtsi index 7cf78afee7b1..daee58944e15 100644 --- a/arch/arm/boot/dts/prima2.dtsi +++ b/arch/arm/boot/dts/prima2.dtsi | |||
@@ -388,6 +388,12 @@ | |||
388 | sirf,function = "uart0"; | 388 | sirf,function = "uart0"; |
389 | }; | 389 | }; |
390 | }; | 390 | }; |
391 | uart0_noflow_pins_a: uart0@1 { | ||
392 | uart { | ||
393 | sirf,pins = "uart0_nostreamctrlgrp"; | ||
394 | sirf,function = "uart0_nostreamctrl"; | ||
395 | }; | ||
396 | }; | ||
391 | uart1_pins_a: uart1@0 { | 397 | uart1_pins_a: uart1@0 { |
392 | uart { | 398 | uart { |
393 | sirf,pins = "uart1grp"; | 399 | sirf,pins = "uart1grp"; |
@@ -526,18 +532,42 @@ | |||
526 | sirf,function = "usp0"; | 532 | sirf,function = "usp0"; |
527 | }; | 533 | }; |
528 | }; | 534 | }; |
535 | usp0_uart_nostreamctrl_pins_a: usp0@1 { | ||
536 | usp0 { | ||
537 | sirf,pins = | ||
538 | "usp0_uart_nostreamctrl_grp"; | ||
539 | sirf,function = | ||
540 | "usp0_uart_nostreamctrl"; | ||
541 | }; | ||
542 | }; | ||
529 | usp1_pins_a: usp1@0 { | 543 | usp1_pins_a: usp1@0 { |
530 | usp1 { | 544 | usp1 { |
531 | sirf,pins = "usp1grp"; | 545 | sirf,pins = "usp1grp"; |
532 | sirf,function = "usp1"; | 546 | sirf,function = "usp1"; |
533 | }; | 547 | }; |
534 | }; | 548 | }; |
549 | usp1_uart_nostreamctrl_pins_a: usp1@1 { | ||
550 | usp1 { | ||
551 | sirf,pins = | ||
552 | "usp1_uart_nostreamctrl_grp"; | ||
553 | sirf,function = | ||
554 | "usp1_uart_nostreamctrl"; | ||
555 | }; | ||
556 | }; | ||
535 | usp2_pins_a: usp2@0 { | 557 | usp2_pins_a: usp2@0 { |
536 | usp2 { | 558 | usp2 { |
537 | sirf,pins = "usp2grp"; | 559 | sirf,pins = "usp2grp"; |
538 | sirf,function = "usp2"; | 560 | sirf,function = "usp2"; |
539 | }; | 561 | }; |
540 | }; | 562 | }; |
563 | usp2_uart_nostreamctrl_pins_a: usp2@1 { | ||
564 | usp2 { | ||
565 | sirf,pins = | ||
566 | "usp2_uart_nostreamctrl_grp"; | ||
567 | sirf,function = | ||
568 | "usp2_uart_nostreamctrl"; | ||
569 | }; | ||
570 | }; | ||
541 | usb0_utmi_drvbus_pins_a: usb0_utmi_drvbus@0 { | 571 | usb0_utmi_drvbus_pins_a: usb0_utmi_drvbus@0 { |
542 | usb0_utmi_drvbus { | 572 | usb0_utmi_drvbus { |
543 | sirf,pins = "usb0_utmi_drvbusgrp"; | 573 | sirf,pins = "usb0_utmi_drvbusgrp"; |
@@ -550,6 +580,18 @@ | |||
550 | sirf,function = "usb1_utmi_drvbus"; | 580 | sirf,function = "usb1_utmi_drvbus"; |
551 | }; | 581 | }; |
552 | }; | 582 | }; |
583 | usb1_dp_dn_pins_a: usb1_dp_dn@0 { | ||
584 | usb1_dp_dn { | ||
585 | sirf,pins = "usb1_dp_dngrp"; | ||
586 | sirf,function = "usb1_dp_dn"; | ||
587 | }; | ||
588 | }; | ||
589 | uart1_route_io_usb1_pins_a: uart1_route_io_usb1@0 { | ||
590 | uart1_route_io_usb1 { | ||
591 | sirf,pins = "uart1_route_io_usb1grp"; | ||
592 | sirf,function = "uart1_route_io_usb1"; | ||
593 | }; | ||
594 | }; | ||
553 | warm_rst_pins_a: warm_rst@0 { | 595 | warm_rst_pins_a: warm_rst@0 { |
554 | warm_rst { | 596 | warm_rst { |
555 | sirf,pins = "warm_rstgrp"; | 597 | sirf,pins = "warm_rstgrp"; |
diff --git a/arch/arm/boot/dts/testcases/tests-interrupts.dtsi b/arch/arm/boot/dts/testcases/tests-interrupts.dtsi new file mode 100644 index 000000000000..c843720bd3e5 --- /dev/null +++ b/arch/arm/boot/dts/testcases/tests-interrupts.dtsi | |||
@@ -0,0 +1,58 @@ | |||
1 | |||
2 | / { | ||
3 | testcase-data { | ||
4 | interrupts { | ||
5 | #address-cells = <1>; | ||
6 | #size-cells = <1>; | ||
7 | test_intc0: intc0 { | ||
8 | interrupt-controller; | ||
9 | #interrupt-cells = <1>; | ||
10 | }; | ||
11 | |||
12 | test_intc1: intc1 { | ||
13 | interrupt-controller; | ||
14 | #interrupt-cells = <3>; | ||
15 | }; | ||
16 | |||
17 | test_intc2: intc2 { | ||
18 | interrupt-controller; | ||
19 | #interrupt-cells = <2>; | ||
20 | }; | ||
21 | |||
22 | test_intmap0: intmap0 { | ||
23 | #interrupt-cells = <1>; | ||
24 | #address-cells = <0>; | ||
25 | interrupt-map = <1 &test_intc0 9>, | ||
26 | <2 &test_intc1 10 11 12>, | ||
27 | <3 &test_intc2 13 14>, | ||
28 | <4 &test_intc2 15 16>; | ||
29 | }; | ||
30 | |||
31 | test_intmap1: intmap1 { | ||
32 | #interrupt-cells = <2>; | ||
33 | interrupt-map = <0x5000 1 2 &test_intc0 15>; | ||
34 | }; | ||
35 | |||
36 | interrupts0 { | ||
37 | interrupt-parent = <&test_intc0>; | ||
38 | interrupts = <1>, <2>, <3>, <4>; | ||
39 | }; | ||
40 | |||
41 | interrupts1 { | ||
42 | interrupt-parent = <&test_intmap0>; | ||
43 | interrupts = <1>, <2>, <3>, <4>; | ||
44 | }; | ||
45 | |||
46 | interrupts-extended0 { | ||
47 | reg = <0x5000 0x100>; | ||
48 | interrupts-extended = <&test_intc0 1>, | ||
49 | <&test_intc1 2 3 4>, | ||
50 | <&test_intc2 5 6>, | ||
51 | <&test_intmap0 1>, | ||
52 | <&test_intmap0 2>, | ||
53 | <&test_intmap0 3>, | ||
54 | <&test_intmap1 1 2>; | ||
55 | }; | ||
56 | }; | ||
57 | }; | ||
58 | }; | ||
diff --git a/arch/arm/boot/dts/testcases/tests.dtsi b/arch/arm/boot/dts/testcases/tests.dtsi index a7c5067622e8..3f123ecc9dd7 100644 --- a/arch/arm/boot/dts/testcases/tests.dtsi +++ b/arch/arm/boot/dts/testcases/tests.dtsi | |||
@@ -1 +1,2 @@ | |||
1 | /include/ "tests-phandle.dtsi" | 1 | /include/ "tests-phandle.dtsi" |
2 | /include/ "tests-interrupts.dtsi" | ||
diff --git a/arch/arm/boot/dts/versatile-ab.dts b/arch/arm/boot/dts/versatile-ab.dts index dde75ae8b4b1..e01e5a081def 100644 --- a/arch/arm/boot/dts/versatile-ab.dts +++ b/arch/arm/boot/dts/versatile-ab.dts | |||
@@ -185,7 +185,7 @@ | |||
185 | mmc@5000 { | 185 | mmc@5000 { |
186 | compatible = "arm,primecell"; | 186 | compatible = "arm,primecell"; |
187 | reg = < 0x5000 0x1000>; | 187 | reg = < 0x5000 0x1000>; |
188 | interrupts = <22 34>; | 188 | interrupts-extended = <&vic 22 &sic 2>; |
189 | }; | 189 | }; |
190 | kmi@6000 { | 190 | kmi@6000 { |
191 | compatible = "arm,pl050", "arm,primecell"; | 191 | compatible = "arm,pl050", "arm,primecell"; |
diff --git a/arch/arm/boot/dts/versatile-pb.dts b/arch/arm/boot/dts/versatile-pb.dts index 7e8175269064..f43907c40c93 100644 --- a/arch/arm/boot/dts/versatile-pb.dts +++ b/arch/arm/boot/dts/versatile-pb.dts | |||
@@ -41,7 +41,7 @@ | |||
41 | mmc@b000 { | 41 | mmc@b000 { |
42 | compatible = "arm,primecell"; | 42 | compatible = "arm,primecell"; |
43 | reg = <0xb000 0x1000>; | 43 | reg = <0xb000 0x1000>; |
44 | interrupts = <23 34>; | 44 | interrupts-extended = <&vic 23 &sic 2>; |
45 | }; | 45 | }; |
46 | }; | 46 | }; |
47 | }; | 47 | }; |
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi index e32b92b949d2..e7f73b2e4550 100644 --- a/arch/arm/boot/dts/zynq-7000.dtsi +++ b/arch/arm/boot/dts/zynq-7000.dtsi | |||
@@ -92,6 +92,14 @@ | |||
92 | }; | 92 | }; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | global_timer: timer@f8f00200 { | ||
96 | compatible = "arm,cortex-a9-global-timer"; | ||
97 | reg = <0xf8f00200 0x20>; | ||
98 | interrupts = <1 11 0x301>; | ||
99 | interrupt-parent = <&intc>; | ||
100 | clocks = <&clkc 4>; | ||
101 | }; | ||
102 | |||
95 | ttc0: ttc0@f8001000 { | 103 | ttc0: ttc0@f8001000 { |
96 | interrupt-parent = <&intc>; | 104 | interrupt-parent = <&intc>; |
97 | interrupts = < 0 10 4 0 11 4 0 12 4 >; | 105 | interrupts = < 0 10 4 0 11 4 0 12 4 >; |
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 59ceae8f3c95..1a7024b41351 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild | |||
@@ -32,3 +32,4 @@ generic-y += termios.h | |||
32 | generic-y += timex.h | 32 | generic-y += timex.h |
33 | generic-y += trace_clock.h | 33 | generic-y += trace_clock.h |
34 | generic-y += unaligned.h | 34 | generic-y += unaligned.h |
35 | generic-y += preempt.h | ||
diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h index 5665134bfa3e..0704e0cf5571 100644 --- a/arch/arm/include/asm/arch_timer.h +++ b/arch/arm/include/asm/arch_timer.h | |||
@@ -87,17 +87,43 @@ static inline u64 arch_counter_get_cntvct(void) | |||
87 | return cval; | 87 | return cval; |
88 | } | 88 | } |
89 | 89 | ||
90 | static inline void arch_counter_set_user_access(void) | 90 | static inline u32 arch_timer_get_cntkctl(void) |
91 | { | 91 | { |
92 | u32 cntkctl; | 92 | u32 cntkctl; |
93 | |||
94 | asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl)); | 93 | asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl)); |
94 | return cntkctl; | ||
95 | } | ||
95 | 96 | ||
96 | /* disable user access to everything */ | 97 | static inline void arch_timer_set_cntkctl(u32 cntkctl) |
97 | cntkctl &= ~((3 << 8) | (7 << 0)); | 98 | { |
98 | |||
99 | asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); | 99 | asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); |
100 | } | 100 | } |
101 | |||
102 | static inline void arch_counter_set_user_access(void) | ||
103 | { | ||
104 | u32 cntkctl = arch_timer_get_cntkctl(); | ||
105 | |||
106 | /* Disable user access to both physical/virtual counters/timers */ | ||
107 | /* Also disable virtual event stream */ | ||
108 | cntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN | ||
109 | | ARCH_TIMER_USR_VT_ACCESS_EN | ||
110 | | ARCH_TIMER_VIRT_EVT_EN | ||
111 | | ARCH_TIMER_USR_VCT_ACCESS_EN | ||
112 | | ARCH_TIMER_USR_PCT_ACCESS_EN); | ||
113 | arch_timer_set_cntkctl(cntkctl); | ||
114 | } | ||
115 | |||
116 | static inline void arch_timer_evtstrm_enable(int divider) | ||
117 | { | ||
118 | u32 cntkctl = arch_timer_get_cntkctl(); | ||
119 | cntkctl &= ~ARCH_TIMER_EVT_TRIGGER_MASK; | ||
120 | /* Set the divider and enable virtual event stream */ | ||
121 | cntkctl |= (divider << ARCH_TIMER_EVT_TRIGGER_SHIFT) | ||
122 | | ARCH_TIMER_VIRT_EVT_EN; | ||
123 | arch_timer_set_cntkctl(cntkctl); | ||
124 | elf_hwcap |= HWCAP_EVTSTRM; | ||
125 | } | ||
126 | |||
101 | #endif | 127 | #endif |
102 | 128 | ||
103 | #endif | 129 | #endif |
diff --git a/arch/arm/include/asm/hardware/iop3xx-gpio.h b/arch/arm/include/asm/hardware/iop3xx-gpio.h deleted file mode 100644 index 9eda7dc92ad8..000000000000 --- a/arch/arm/include/asm/hardware/iop3xx-gpio.h +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/hardware/iop3xx-gpio.h | ||
3 | * | ||
4 | * IOP3xx GPIO wrappers | ||
5 | * | ||
6 | * Copyright (c) 2008 Arnaud Patard <arnaud.patard@rtp-net.org> | ||
7 | * Based on IXP4XX gpio.h file | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef __ASM_ARM_HARDWARE_IOP3XX_GPIO_H | ||
26 | #define __ASM_ARM_HARDWARE_IOP3XX_GPIO_H | ||
27 | |||
28 | #include <mach/hardware.h> | ||
29 | #include <asm-generic/gpio.h> | ||
30 | |||
31 | #define __ARM_GPIOLIB_COMPLEX | ||
32 | |||
33 | #define IOP3XX_N_GPIOS 8 | ||
34 | |||
35 | static inline int gpio_get_value(unsigned gpio) | ||
36 | { | ||
37 | if (gpio > IOP3XX_N_GPIOS) | ||
38 | return __gpio_get_value(gpio); | ||
39 | |||
40 | return gpio_line_get(gpio); | ||
41 | } | ||
42 | |||
43 | static inline void gpio_set_value(unsigned gpio, int value) | ||
44 | { | ||
45 | if (gpio > IOP3XX_N_GPIOS) { | ||
46 | __gpio_set_value(gpio, value); | ||
47 | return; | ||
48 | } | ||
49 | gpio_line_set(gpio, value); | ||
50 | } | ||
51 | |||
52 | static inline int gpio_cansleep(unsigned gpio) | ||
53 | { | ||
54 | if (gpio < IOP3XX_N_GPIOS) | ||
55 | return 0; | ||
56 | else | ||
57 | return __gpio_cansleep(gpio); | ||
58 | } | ||
59 | |||
60 | /* | ||
61 | * The GPIOs are not generating any interrupt | ||
62 | * Note : manuals are not clear about this | ||
63 | */ | ||
64 | static inline int gpio_to_irq(int gpio) | ||
65 | { | ||
66 | return -EINVAL; | ||
67 | } | ||
68 | |||
69 | static inline int irq_to_gpio(int gpio) | ||
70 | { | ||
71 | return -EINVAL; | ||
72 | } | ||
73 | |||
74 | #endif | ||
75 | |||
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h index 423744bf18eb..2594a95ff19a 100644 --- a/arch/arm/include/asm/hardware/iop3xx.h +++ b/arch/arm/include/asm/hardware/iop3xx.h | |||
@@ -18,16 +18,9 @@ | |||
18 | /* | 18 | /* |
19 | * IOP3XX GPIO handling | 19 | * IOP3XX GPIO handling |
20 | */ | 20 | */ |
21 | #define GPIO_IN 0 | ||
22 | #define GPIO_OUT 1 | ||
23 | #define GPIO_LOW 0 | ||
24 | #define GPIO_HIGH 1 | ||
25 | #define IOP3XX_GPIO_LINE(x) (x) | 21 | #define IOP3XX_GPIO_LINE(x) (x) |
26 | 22 | ||
27 | #ifndef __ASSEMBLY__ | 23 | #ifndef __ASSEMBLY__ |
28 | extern void gpio_line_config(int line, int direction); | ||
29 | extern int gpio_line_get(int line); | ||
30 | extern void gpio_line_set(int line, int value); | ||
31 | extern int init_atu; | 24 | extern int init_atu; |
32 | extern int iop3xx_get_init_atu(void); | 25 | extern int iop3xx_get_init_atu(void); |
33 | #endif | 26 | #endif |
@@ -168,11 +161,6 @@ extern int iop3xx_get_init_atu(void); | |||
168 | /* PERCR0 DOESN'T EXIST - index from 1! */ | 161 | /* PERCR0 DOESN'T EXIST - index from 1! */ |
169 | #define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710) | 162 | #define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710) |
170 | 163 | ||
171 | /* General Purpose I/O */ | ||
172 | #define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0000) | ||
173 | #define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0004) | ||
174 | #define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x0008) | ||
175 | |||
176 | /* Timers */ | 164 | /* Timers */ |
177 | #define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000) | 165 | #define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000) |
178 | #define IOP3XX_TU_TMR1 (volatile u32 *)IOP3XX_TIMER_REG(0x0004) | 166 | #define IOP3XX_TU_TMR1 (volatile u32 *)IOP3XX_TIMER_REG(0x0004) |
diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h index 4a2985e21969..b681575ad3de 100644 --- a/arch/arm/include/asm/prom.h +++ b/arch/arm/include/asm/prom.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef __ASMARM_PROM_H | 11 | #ifndef __ASMARM_PROM_H |
12 | #define __ASMARM_PROM_H | 12 | #define __ASMARM_PROM_H |
13 | 13 | ||
14 | #define HAVE_ARCH_DEVTREE_FIXUPS | ||
15 | |||
16 | #ifdef CONFIG_OF | 14 | #ifdef CONFIG_OF |
17 | 15 | ||
18 | extern const struct machine_desc *setup_machine_fdt(unsigned int dt_phys); | 16 | extern const struct machine_desc *setup_machine_fdt(unsigned int dt_phys); |
diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h index 6d34d080372a..7dcc10d67253 100644 --- a/arch/arm/include/uapi/asm/hwcap.h +++ b/arch/arm/include/uapi/asm/hwcap.h | |||
@@ -26,5 +26,6 @@ | |||
26 | #define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ | 26 | #define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ |
27 | #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) | 27 | #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) |
28 | #define HWCAP_LPAE (1 << 20) | 28 | #define HWCAP_LPAE (1 << 20) |
29 | #define HWCAP_EVTSTRM (1 << 21) | ||
29 | 30 | ||
30 | #endif /* _UAPI__ASMARM_HWCAP_H */ | 31 | #endif /* _UAPI__ASMARM_HWCAP_H */ |
diff --git a/arch/arm/kernel/arch_timer.c b/arch/arm/kernel/arch_timer.c index 221f07b11ccb..1791f12c180b 100644 --- a/arch/arm/kernel/arch_timer.c +++ b/arch/arm/kernel/arch_timer.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/sched_clock.h> | ||
15 | 14 | ||
16 | #include <asm/delay.h> | 15 | #include <asm/delay.h> |
17 | 16 | ||
@@ -22,13 +21,6 @@ static unsigned long arch_timer_read_counter_long(void) | |||
22 | return arch_timer_read_counter(); | 21 | return arch_timer_read_counter(); |
23 | } | 22 | } |
24 | 23 | ||
25 | static u32 sched_clock_mult __read_mostly; | ||
26 | |||
27 | static unsigned long long notrace arch_timer_sched_clock(void) | ||
28 | { | ||
29 | return arch_timer_read_counter() * sched_clock_mult; | ||
30 | } | ||
31 | |||
32 | static struct delay_timer arch_delay_timer; | 24 | static struct delay_timer arch_delay_timer; |
33 | 25 | ||
34 | static void __init arch_timer_delay_timer_register(void) | 26 | static void __init arch_timer_delay_timer_register(void) |
@@ -48,11 +40,5 @@ int __init arch_timer_arch_init(void) | |||
48 | 40 | ||
49 | arch_timer_delay_timer_register(); | 41 | arch_timer_delay_timer_register(); |
50 | 42 | ||
51 | /* Cache the sched_clock multiplier to save a divide in the hot path. */ | ||
52 | sched_clock_mult = NSEC_PER_SEC / arch_timer_rate; | ||
53 | sched_clock_func = arch_timer_sched_clock; | ||
54 | pr_info("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %uns\n", | ||
55 | arch_timer_rate / 1000, sched_clock_mult); | ||
56 | |||
57 | return 0; | 43 | return 0; |
58 | } | 44 | } |
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index f35906b3d8c9..739c3dfc1da2 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c | |||
@@ -174,6 +174,19 @@ bool arch_match_cpu_phys_id(int cpu, u64 phys_id) | |||
174 | return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu); | 174 | return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu); |
175 | } | 175 | } |
176 | 176 | ||
177 | static const void * __init arch_get_next_mach(const char *const **match) | ||
178 | { | ||
179 | static const struct machine_desc *mdesc = __arch_info_begin; | ||
180 | const struct machine_desc *m = mdesc; | ||
181 | |||
182 | if (m >= __arch_info_end) | ||
183 | return NULL; | ||
184 | |||
185 | mdesc++; | ||
186 | *match = m->dt_compat; | ||
187 | return m; | ||
188 | } | ||
189 | |||
177 | /** | 190 | /** |
178 | * setup_machine_fdt - Machine setup when an dtb was passed to the kernel | 191 | * setup_machine_fdt - Machine setup when an dtb was passed to the kernel |
179 | * @dt_phys: physical address of dt blob | 192 | * @dt_phys: physical address of dt blob |
@@ -183,11 +196,7 @@ bool arch_match_cpu_phys_id(int cpu, u64 phys_id) | |||
183 | */ | 196 | */ |
184 | const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) | 197 | const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) |
185 | { | 198 | { |
186 | struct boot_param_header *devtree; | ||
187 | const struct machine_desc *mdesc, *mdesc_best = NULL; | 199 | const struct machine_desc *mdesc, *mdesc_best = NULL; |
188 | unsigned int score, mdesc_score = ~1; | ||
189 | unsigned long dt_root; | ||
190 | const char *model; | ||
191 | 200 | ||
192 | #ifdef CONFIG_ARCH_MULTIPLATFORM | 201 | #ifdef CONFIG_ARCH_MULTIPLATFORM |
193 | DT_MACHINE_START(GENERIC_DT, "Generic DT based system") | 202 | DT_MACHINE_START(GENERIC_DT, "Generic DT based system") |
@@ -196,32 +205,20 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) | |||
196 | mdesc_best = &__mach_desc_GENERIC_DT; | 205 | mdesc_best = &__mach_desc_GENERIC_DT; |
197 | #endif | 206 | #endif |
198 | 207 | ||
199 | if (!dt_phys) | 208 | if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys))) |
200 | return NULL; | 209 | return NULL; |
201 | 210 | ||
202 | devtree = phys_to_virt(dt_phys); | 211 | mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach); |
203 | 212 | ||
204 | /* check device tree validity */ | 213 | if (!mdesc) { |
205 | if (be32_to_cpu(devtree->magic) != OF_DT_HEADER) | ||
206 | return NULL; | ||
207 | |||
208 | /* Search the mdescs for the 'best' compatible value match */ | ||
209 | initial_boot_params = devtree; | ||
210 | dt_root = of_get_flat_dt_root(); | ||
211 | for_each_machine_desc(mdesc) { | ||
212 | score = of_flat_dt_match(dt_root, mdesc->dt_compat); | ||
213 | if (score > 0 && score < mdesc_score) { | ||
214 | mdesc_best = mdesc; | ||
215 | mdesc_score = score; | ||
216 | } | ||
217 | } | ||
218 | if (!mdesc_best) { | ||
219 | const char *prop; | 214 | const char *prop; |
220 | long size; | 215 | long size; |
216 | unsigned long dt_root; | ||
221 | 217 | ||
222 | early_print("\nError: unrecognized/unsupported " | 218 | early_print("\nError: unrecognized/unsupported " |
223 | "device tree compatible list:\n[ "); | 219 | "device tree compatible list:\n[ "); |
224 | 220 | ||
221 | dt_root = of_get_flat_dt_root(); | ||
225 | prop = of_get_flat_dt_prop(dt_root, "compatible", &size); | 222 | prop = of_get_flat_dt_prop(dt_root, "compatible", &size); |
226 | while (size > 0) { | 223 | while (size > 0) { |
227 | early_print("'%s' ", prop); | 224 | early_print("'%s' ", prop); |
@@ -233,22 +230,8 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) | |||
233 | dump_machine_table(); /* does not return */ | 230 | dump_machine_table(); /* does not return */ |
234 | } | 231 | } |
235 | 232 | ||
236 | model = of_get_flat_dt_prop(dt_root, "model", NULL); | ||
237 | if (!model) | ||
238 | model = of_get_flat_dt_prop(dt_root, "compatible", NULL); | ||
239 | if (!model) | ||
240 | model = "<unknown>"; | ||
241 | pr_info("Machine: %s, model: %s\n", mdesc_best->name, model); | ||
242 | |||
243 | /* Retrieve various information from the /chosen node */ | ||
244 | of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); | ||
245 | /* Initialize {size,address}-cells info */ | ||
246 | of_scan_flat_dt(early_init_dt_scan_root, NULL); | ||
247 | /* Setup memory, calling early_init_dt_add_memory_arch */ | ||
248 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); | ||
249 | |||
250 | /* Change machine number to match the mdesc we're using */ | 233 | /* Change machine number to match the mdesc we're using */ |
251 | __machine_arch_type = mdesc_best->nr; | 234 | __machine_arch_type = mdesc->nr; |
252 | 235 | ||
253 | return mdesc_best; | 236 | return mdesc; |
254 | } | 237 | } |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 0e1e2b3afa45..5d65438685d8 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -975,6 +975,7 @@ static const char *hwcap_str[] = { | |||
975 | "idivt", | 975 | "idivt", |
976 | "vfpd32", | 976 | "vfpd32", |
977 | "lpae", | 977 | "lpae", |
978 | "evtstrm", | ||
978 | NULL | 979 | NULL |
979 | }; | 980 | }; |
980 | 981 | ||
diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c index d50135be0c20..70f2f3925f0e 100644 --- a/arch/arm/mach-bcm2835/bcm2835.c +++ b/arch/arm/mach-bcm2835/bcm2835.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/irqchip/bcm2835.h> | 17 | #include <linux/irqchip.h> |
18 | #include <linux/of_address.h> | 18 | #include <linux/of_address.h> |
19 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
20 | #include <linux/clk/bcm2835.h> | 20 | #include <linux/clk/bcm2835.h> |
@@ -130,8 +130,7 @@ static const char * const bcm2835_compat[] = { | |||
130 | 130 | ||
131 | DT_MACHINE_START(BCM2835, "BCM2835") | 131 | DT_MACHINE_START(BCM2835, "BCM2835") |
132 | .map_io = bcm2835_map_io, | 132 | .map_io = bcm2835_map_io, |
133 | .init_irq = bcm2835_init_irq, | 133 | .init_irq = irqchip_init, |
134 | .handle_irq = bcm2835_handle_irq, | ||
135 | .init_machine = bcm2835_init, | 134 | .init_machine = bcm2835_init, |
136 | .restart = bcm2835_restart, | 135 | .restart = bcm2835_restart, |
137 | .dt_compat = bcm2835_compat | 136 | .dt_compat = bcm2835_compat |
diff --git a/arch/arm/mach-gemini/gpio.c b/arch/arm/mach-gemini/gpio.c index 70bfa571b24b..f8cb5710d6ee 100644 --- a/arch/arm/mach-gemini/gpio.c +++ b/arch/arm/mach-gemini/gpio.c | |||
@@ -21,9 +21,9 @@ | |||
21 | 21 | ||
22 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
23 | #include <mach/irqs.h> | 23 | #include <mach/irqs.h> |
24 | #include <mach/gpio.h> | ||
25 | 24 | ||
26 | #define GPIO_BASE(x) IO_ADDRESS(GEMINI_GPIO_BASE(x)) | 25 | #define GPIO_BASE(x) IO_ADDRESS(GEMINI_GPIO_BASE(x)) |
26 | #define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE) | ||
27 | 27 | ||
28 | /* GPIO registers definition */ | 28 | /* GPIO registers definition */ |
29 | #define GPIO_DATA_OUT 0x0 | 29 | #define GPIO_DATA_OUT 0x0 |
diff --git a/arch/arm/mach-gemini/include/mach/gpio.h b/arch/arm/mach-gemini/include/mach/gpio.h deleted file mode 100644 index 40a0527bada7..000000000000 --- a/arch/arm/mach-gemini/include/mach/gpio.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * Gemini gpiolib specific defines | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __MACH_GPIO_H__ | ||
13 | #define __MACH_GPIO_H__ | ||
14 | |||
15 | #include <mach/irqs.h> | ||
16 | |||
17 | #define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE) | ||
18 | #define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE) | ||
19 | |||
20 | #endif /* __MACH_GPIO_H__ */ | ||
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index c9c5a33bc802..c5e01b24d9fb 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
@@ -808,22 +808,6 @@ static u8 __init pci_v3_swizzle(struct pci_dev *dev, u8 *pinp) | |||
808 | return pci_common_swizzle(dev, pinp); | 808 | return pci_common_swizzle(dev, pinp); |
809 | } | 809 | } |
810 | 810 | ||
811 | static int __init pci_v3_map_irq_dt(const struct pci_dev *dev, u8 slot, u8 pin) | ||
812 | { | ||
813 | struct of_irq oirq; | ||
814 | int ret; | ||
815 | |||
816 | ret = of_irq_map_pci(dev, &oirq); | ||
817 | if (ret) { | ||
818 | dev_err(&dev->dev, "of_irq_map_pci() %d\n", ret); | ||
819 | /* Proper return code 0 == NO_IRQ */ | ||
820 | return 0; | ||
821 | } | ||
822 | |||
823 | return irq_create_of_mapping(oirq.controller, oirq.specifier, | ||
824 | oirq.size); | ||
825 | } | ||
826 | |||
827 | static struct hw_pci pci_v3 __initdata = { | 811 | static struct hw_pci pci_v3 __initdata = { |
828 | .swizzle = pci_v3_swizzle, | 812 | .swizzle = pci_v3_swizzle, |
829 | .setup = pci_v3_setup, | 813 | .setup = pci_v3_setup, |
@@ -914,7 +898,7 @@ static int __init pci_v3_probe(struct platform_device *pdev) | |||
914 | return -EINVAL; | 898 | return -EINVAL; |
915 | } | 899 | } |
916 | 900 | ||
917 | pci_v3.map_irq = pci_v3_map_irq_dt; | 901 | pci_v3.map_irq = of_irq_parse_and_map_pci; |
918 | pci_common_init_dev(&pdev->dev, &pci_v3); | 902 | pci_common_init_dev(&pdev->dev, &pci_v3); |
919 | 903 | ||
920 | return 0; | 904 | return 0; |
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c index 31fbb6c61b25..177cd073a83b 100644 --- a/arch/arm/mach-iop32x/em7210.c +++ b/arch/arm/mach-iop32x/em7210.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/mach/time.h> | 32 | #include <asm/mach/time.h> |
33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
34 | #include <mach/time.h> | 34 | #include <mach/time.h> |
35 | #include "gpio-iop32x.h" | ||
35 | 36 | ||
36 | static void __init em7210_timer_init(void) | 37 | static void __init em7210_timer_init(void) |
37 | { | 38 | { |
@@ -183,6 +184,7 @@ void em7210_power_off(void) | |||
183 | 184 | ||
184 | static void __init em7210_init_machine(void) | 185 | static void __init em7210_init_machine(void) |
185 | { | 186 | { |
187 | register_iop32x_gpio(); | ||
186 | platform_device_register(&em7210_serial_device); | 188 | platform_device_register(&em7210_serial_device); |
187 | platform_device_register(&iop3xx_i2c0_device); | 189 | platform_device_register(&iop3xx_i2c0_device); |
188 | platform_device_register(&iop3xx_i2c1_device); | 190 | platform_device_register(&iop3xx_i2c1_device); |
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c index ac304705fe68..547b2342d61a 100644 --- a/arch/arm/mach-iop32x/glantank.c +++ b/arch/arm/mach-iop32x/glantank.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
35 | #include <asm/page.h> | 35 | #include <asm/page.h> |
36 | #include <mach/time.h> | 36 | #include <mach/time.h> |
37 | #include "gpio-iop32x.h" | ||
37 | 38 | ||
38 | /* | 39 | /* |
39 | * GLAN Tank timer tick configuration. | 40 | * GLAN Tank timer tick configuration. |
@@ -187,6 +188,7 @@ static void glantank_power_off(void) | |||
187 | 188 | ||
188 | static void __init glantank_init_machine(void) | 189 | static void __init glantank_init_machine(void) |
189 | { | 190 | { |
191 | register_iop32x_gpio(); | ||
190 | platform_device_register(&iop3xx_i2c0_device); | 192 | platform_device_register(&iop3xx_i2c0_device); |
191 | platform_device_register(&iop3xx_i2c1_device); | 193 | platform_device_register(&iop3xx_i2c1_device); |
192 | platform_device_register(&glantank_flash_device); | 194 | platform_device_register(&glantank_flash_device); |
diff --git a/arch/arm/mach-iop32x/gpio-iop32x.h b/arch/arm/mach-iop32x/gpio-iop32x.h new file mode 100644 index 000000000000..3c7309c02029 --- /dev/null +++ b/arch/arm/mach-iop32x/gpio-iop32x.h | |||
@@ -0,0 +1,10 @@ | |||
1 | static struct resource iop32x_gpio_res[] = { | ||
2 | DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x07c4), 0x10), | ||
3 | }; | ||
4 | |||
5 | static inline void register_iop32x_gpio(void) | ||
6 | { | ||
7 | platform_device_register_simple("gpio-iop", 0, | ||
8 | iop32x_gpio_res, | ||
9 | ARRAY_SIZE(iop32x_gpio_res)); | ||
10 | } | ||
diff --git a/arch/arm/mach-iop32x/include/mach/gpio.h b/arch/arm/mach-iop32x/include/mach/gpio.h deleted file mode 100644 index 708f4ec9db1d..000000000000 --- a/arch/arm/mach-iop32x/include/mach/gpio.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_ARCH_IOP32X_GPIO_H | ||
2 | #define __ASM_ARCH_IOP32X_GPIO_H | ||
3 | |||
4 | #include <asm/hardware/iop3xx-gpio.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/arm/mach-iop32x/include/mach/iop32x.h b/arch/arm/mach-iop32x/include/mach/iop32x.h index 941f363aca56..56ec864ec313 100644 --- a/arch/arm/mach-iop32x/include/mach/iop32x.h +++ b/arch/arm/mach-iop32x/include/mach/iop32x.h | |||
@@ -19,7 +19,6 @@ | |||
19 | * Peripherals that are shared between the iop32x and iop33x but | 19 | * Peripherals that are shared between the iop32x and iop33x but |
20 | * located at different addresses. | 20 | * located at different addresses. |
21 | */ | 21 | */ |
22 | #define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c4 + (reg)) | ||
23 | #define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg)) | 22 | #define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg)) |
24 | 23 | ||
25 | #include <asm/hardware/iop3xx.h> | 24 | #include <asm/hardware/iop3xx.h> |
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c index f2cd2966212d..0e1392b20d18 100644 --- a/arch/arm/mach-iop32x/iq31244.c +++ b/arch/arm/mach-iop32x/iq31244.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <asm/page.h> | 37 | #include <asm/page.h> |
38 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
39 | #include <mach/time.h> | 39 | #include <mach/time.h> |
40 | #include "gpio-iop32x.h" | ||
40 | 41 | ||
41 | /* | 42 | /* |
42 | * Until March of 2007 iq31244 platforms and ep80219 platforms shared the | 43 | * Until March of 2007 iq31244 platforms and ep80219 platforms shared the |
@@ -283,6 +284,7 @@ void ep80219_power_off(void) | |||
283 | 284 | ||
284 | static void __init iq31244_init_machine(void) | 285 | static void __init iq31244_init_machine(void) |
285 | { | 286 | { |
287 | register_iop32x_gpio(); | ||
286 | platform_device_register(&iop3xx_i2c0_device); | 288 | platform_device_register(&iop3xx_i2c0_device); |
287 | platform_device_register(&iop3xx_i2c1_device); | 289 | platform_device_register(&iop3xx_i2c1_device); |
288 | platform_device_register(&iq31244_flash_device); | 290 | platform_device_register(&iq31244_flash_device); |
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c index 015435de90dd..66782ff1f46a 100644 --- a/arch/arm/mach-iop32x/iq80321.c +++ b/arch/arm/mach-iop32x/iq80321.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/page.h> | 33 | #include <asm/page.h> |
34 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
35 | #include <mach/time.h> | 35 | #include <mach/time.h> |
36 | #include "gpio-iop32x.h" | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * IQ80321 timer tick configuration. | 39 | * IQ80321 timer tick configuration. |
@@ -170,6 +171,7 @@ static struct platform_device iq80321_serial_device = { | |||
170 | 171 | ||
171 | static void __init iq80321_init_machine(void) | 172 | static void __init iq80321_init_machine(void) |
172 | { | 173 | { |
174 | register_iop32x_gpio(); | ||
173 | platform_device_register(&iop3xx_i2c0_device); | 175 | platform_device_register(&iop3xx_i2c0_device); |
174 | platform_device_register(&iop3xx_i2c1_device); | 176 | platform_device_register(&iop3xx_i2c1_device); |
175 | platform_device_register(&iq80321_flash_device); | 177 | platform_device_register(&iq80321_flash_device); |
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c index 069144300b77..c1cd80ecc219 100644 --- a/arch/arm/mach-iop32x/n2100.c +++ b/arch/arm/mach-iop32x/n2100.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/platform_device.h> | 30 | #include <linux/platform_device.h> |
31 | #include <linux/reboot.h> | 31 | #include <linux/reboot.h> |
32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
33 | #include <linux/gpio.h> | ||
33 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
34 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
35 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
@@ -40,6 +41,7 @@ | |||
40 | #include <asm/page.h> | 41 | #include <asm/page.h> |
41 | #include <asm/pgtable.h> | 42 | #include <asm/pgtable.h> |
42 | #include <mach/time.h> | 43 | #include <mach/time.h> |
44 | #include "gpio-iop32x.h" | ||
43 | 45 | ||
44 | /* | 46 | /* |
45 | * N2100 timer tick configuration. | 47 | * N2100 timer tick configuration. |
@@ -288,8 +290,14 @@ static void n2100_power_off(void) | |||
288 | 290 | ||
289 | static void n2100_restart(enum reboot_mode mode, const char *cmd) | 291 | static void n2100_restart(enum reboot_mode mode, const char *cmd) |
290 | { | 292 | { |
291 | gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW); | 293 | int ret; |
292 | gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT); | 294 | |
295 | ret = gpio_direction_output(N2100_HARDWARE_RESET, 0); | ||
296 | if (ret) { | ||
297 | pr_crit("could not drive reset GPIO low\n"); | ||
298 | return; | ||
299 | } | ||
300 | /* Wait for reset to happen */ | ||
293 | while (1) | 301 | while (1) |
294 | ; | 302 | ; |
295 | } | 303 | } |
@@ -299,7 +307,7 @@ static struct timer_list power_button_poll_timer; | |||
299 | 307 | ||
300 | static void power_button_poll(unsigned long dummy) | 308 | static void power_button_poll(unsigned long dummy) |
301 | { | 309 | { |
302 | if (gpio_line_get(N2100_POWER_BUTTON) == 0) { | 310 | if (gpio_get_value(N2100_POWER_BUTTON) == 0) { |
303 | ctrl_alt_del(); | 311 | ctrl_alt_del(); |
304 | return; | 312 | return; |
305 | } | 313 | } |
@@ -308,9 +316,37 @@ static void power_button_poll(unsigned long dummy) | |||
308 | add_timer(&power_button_poll_timer); | 316 | add_timer(&power_button_poll_timer); |
309 | } | 317 | } |
310 | 318 | ||
319 | static int __init n2100_request_gpios(void) | ||
320 | { | ||
321 | int ret; | ||
322 | |||
323 | if (!machine_is_n2100()) | ||
324 | return 0; | ||
325 | |||
326 | ret = gpio_request(N2100_HARDWARE_RESET, "reset"); | ||
327 | if (ret) | ||
328 | pr_err("could not request reset GPIO\n"); | ||
329 | |||
330 | ret = gpio_request(N2100_POWER_BUTTON, "power"); | ||
331 | if (ret) | ||
332 | pr_err("could not request power GPIO\n"); | ||
333 | else { | ||
334 | ret = gpio_direction_input(N2100_POWER_BUTTON); | ||
335 | if (ret) | ||
336 | pr_err("could not set power GPIO as input\n"); | ||
337 | } | ||
338 | /* Set up power button poll timer */ | ||
339 | init_timer(&power_button_poll_timer); | ||
340 | power_button_poll_timer.function = power_button_poll; | ||
341 | power_button_poll_timer.expires = jiffies + (HZ / 10); | ||
342 | add_timer(&power_button_poll_timer); | ||
343 | return 0; | ||
344 | } | ||
345 | device_initcall(n2100_request_gpios); | ||
311 | 346 | ||
312 | static void __init n2100_init_machine(void) | 347 | static void __init n2100_init_machine(void) |
313 | { | 348 | { |
349 | register_iop32x_gpio(); | ||
314 | platform_device_register(&iop3xx_i2c0_device); | 350 | platform_device_register(&iop3xx_i2c0_device); |
315 | platform_device_register(&n2100_flash_device); | 351 | platform_device_register(&n2100_flash_device); |
316 | platform_device_register(&n2100_serial_device); | 352 | platform_device_register(&n2100_serial_device); |
@@ -321,11 +357,6 @@ static void __init n2100_init_machine(void) | |||
321 | ARRAY_SIZE(n2100_i2c_devices)); | 357 | ARRAY_SIZE(n2100_i2c_devices)); |
322 | 358 | ||
323 | pm_power_off = n2100_power_off; | 359 | pm_power_off = n2100_power_off; |
324 | |||
325 | init_timer(&power_button_poll_timer); | ||
326 | power_button_poll_timer.function = power_button_poll; | ||
327 | power_button_poll_timer.expires = jiffies + (HZ / 10); | ||
328 | add_timer(&power_button_poll_timer); | ||
329 | } | 360 | } |
330 | 361 | ||
331 | MACHINE_START(N2100, "Thecus N2100") | 362 | MACHINE_START(N2100, "Thecus N2100") |
diff --git a/arch/arm/mach-iop33x/include/mach/gpio.h b/arch/arm/mach-iop33x/include/mach/gpio.h deleted file mode 100644 index ddd55bba9bb9..000000000000 --- a/arch/arm/mach-iop33x/include/mach/gpio.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_ARCH_IOP33X_GPIO_H | ||
2 | #define __ASM_ARCH_IOP33X_GPIO_H | ||
3 | |||
4 | #include <asm/hardware/iop3xx-gpio.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/arm/mach-iop33x/include/mach/iop33x.h b/arch/arm/mach-iop33x/include/mach/iop33x.h index a89c0a234bff..c95122653094 100644 --- a/arch/arm/mach-iop33x/include/mach/iop33x.h +++ b/arch/arm/mach-iop33x/include/mach/iop33x.h | |||
@@ -18,7 +18,6 @@ | |||
18 | * Peripherals that are shared between the iop32x and iop33x but | 18 | * Peripherals that are shared between the iop32x and iop33x but |
19 | * located at different addresses. | 19 | * located at different addresses. |
20 | */ | 20 | */ |
21 | #define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1780 + (reg)) | ||
22 | #define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07d0 + (reg)) | 21 | #define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07d0 + (reg)) |
23 | 22 | ||
24 | #include <asm/hardware/iop3xx.h> | 23 | #include <asm/hardware/iop3xx.h> |
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c index c43304a10fa7..e2cb65cfbe23 100644 --- a/arch/arm/mach-iop33x/iq80331.c +++ b/arch/arm/mach-iop33x/iq80331.c | |||
@@ -122,8 +122,15 @@ static struct platform_device iq80331_flash_device = { | |||
122 | .resource = &iq80331_flash_resource, | 122 | .resource = &iq80331_flash_resource, |
123 | }; | 123 | }; |
124 | 124 | ||
125 | static struct resource iq80331_gpio_res[] = { | ||
126 | DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x1780), 0x10), | ||
127 | }; | ||
128 | |||
125 | static void __init iq80331_init_machine(void) | 129 | static void __init iq80331_init_machine(void) |
126 | { | 130 | { |
131 | platform_device_register_simple("gpio-iop", 0, | ||
132 | iq80331_gpio_res, | ||
133 | ARRAY_SIZE(iq80331_gpio_res)); | ||
127 | platform_device_register(&iop3xx_i2c0_device); | 134 | platform_device_register(&iop3xx_i2c0_device); |
128 | platform_device_register(&iop3xx_i2c1_device); | 135 | platform_device_register(&iop3xx_i2c1_device); |
129 | platform_device_register(&iop33x_uart0_device); | 136 | platform_device_register(&iop33x_uart0_device); |
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c index 8192987e78e5..0b6269d94f89 100644 --- a/arch/arm/mach-iop33x/iq80332.c +++ b/arch/arm/mach-iop33x/iq80332.c | |||
@@ -122,8 +122,15 @@ static struct platform_device iq80332_flash_device = { | |||
122 | .resource = &iq80332_flash_resource, | 122 | .resource = &iq80332_flash_resource, |
123 | }; | 123 | }; |
124 | 124 | ||
125 | static struct resource iq80332_gpio_res[] = { | ||
126 | DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x1780), 0x10), | ||
127 | }; | ||
128 | |||
125 | static void __init iq80332_init_machine(void) | 129 | static void __init iq80332_init_machine(void) |
126 | { | 130 | { |
131 | platform_device_register_simple("gpio-iop", 0, | ||
132 | iq80332_gpio_res, | ||
133 | ARRAY_SIZE(iq80332_gpio_res)); | ||
127 | platform_device_register(&iop3xx_i2c0_device); | 134 | platform_device_register(&iop3xx_i2c0_device); |
128 | platform_device_register(&iop3xx_i2c1_device); | 135 | platform_device_register(&iop3xx_i2c1_device); |
129 | platform_device_register(&iop33x_uart0_device); | 136 | platform_device_register(&iop33x_uart0_device); |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 5327decde5a0..9edaf4734fa8 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -81,6 +81,44 @@ void __init ixp4xx_map_io(void) | |||
81 | iotable_init(ixp4xx_io_desc, ARRAY_SIZE(ixp4xx_io_desc)); | 81 | iotable_init(ixp4xx_io_desc, ARRAY_SIZE(ixp4xx_io_desc)); |
82 | } | 82 | } |
83 | 83 | ||
84 | /* | ||
85 | * GPIO-functions | ||
86 | */ | ||
87 | /* | ||
88 | * The following converted to the real HW bits the gpio_line_config | ||
89 | */ | ||
90 | /* GPIO pin types */ | ||
91 | #define IXP4XX_GPIO_OUT 0x1 | ||
92 | #define IXP4XX_GPIO_IN 0x2 | ||
93 | |||
94 | /* GPIO signal types */ | ||
95 | #define IXP4XX_GPIO_LOW 0 | ||
96 | #define IXP4XX_GPIO_HIGH 1 | ||
97 | |||
98 | /* GPIO Clocks */ | ||
99 | #define IXP4XX_GPIO_CLK_0 14 | ||
100 | #define IXP4XX_GPIO_CLK_1 15 | ||
101 | |||
102 | static void gpio_line_config(u8 line, u32 direction) | ||
103 | { | ||
104 | if (direction == IXP4XX_GPIO_IN) | ||
105 | *IXP4XX_GPIO_GPOER |= (1 << line); | ||
106 | else | ||
107 | *IXP4XX_GPIO_GPOER &= ~(1 << line); | ||
108 | } | ||
109 | |||
110 | static void gpio_line_get(u8 line, int *value) | ||
111 | { | ||
112 | *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1; | ||
113 | } | ||
114 | |||
115 | static void gpio_line_set(u8 line, int value) | ||
116 | { | ||
117 | if (value == IXP4XX_GPIO_HIGH) | ||
118 | *IXP4XX_GPIO_GPOUTR |= (1 << line); | ||
119 | else if (value == IXP4XX_GPIO_LOW) | ||
120 | *IXP4XX_GPIO_GPOUTR &= ~(1 << line); | ||
121 | } | ||
84 | 122 | ||
85 | /************************************************************************* | 123 | /************************************************************************* |
86 | * IXP4xx chipset IRQ handling | 124 | * IXP4xx chipset IRQ handling |
@@ -117,17 +155,6 @@ static int ixp4xx_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) | |||
117 | return -EINVAL; | 155 | return -EINVAL; |
118 | } | 156 | } |
119 | 157 | ||
120 | int irq_to_gpio(unsigned int irq) | ||
121 | { | ||
122 | int gpio = (irq < 32) ? irq2gpio[irq] : -EINVAL; | ||
123 | |||
124 | if (gpio == -1) | ||
125 | return -EINVAL; | ||
126 | |||
127 | return gpio; | ||
128 | } | ||
129 | EXPORT_SYMBOL(irq_to_gpio); | ||
130 | |||
131 | static int ixp4xx_set_irq_type(struct irq_data *d, unsigned int type) | 158 | static int ixp4xx_set_irq_type(struct irq_data *d, unsigned int type) |
132 | { | 159 | { |
133 | int line = irq2gpio[d->irq]; | 160 | int line = irq2gpio[d->irq]; |
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c index 63de1b3fd06b..736dc692d540 100644 --- a/arch/arm/mach-ixp4xx/dsmg600-setup.c +++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/reboot.h> | 26 | #include <linux/reboot.h> |
27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
28 | #include <linux/i2c-gpio.h> | 28 | #include <linux/i2c-gpio.h> |
29 | #include <linux/gpio.h> | ||
29 | 30 | ||
30 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
31 | 32 | ||
@@ -161,11 +162,8 @@ static struct platform_device *dsmg600_devices[] __initdata = { | |||
161 | 162 | ||
162 | static void dsmg600_power_off(void) | 163 | static void dsmg600_power_off(void) |
163 | { | 164 | { |
164 | /* enable the pwr cntl gpio */ | 165 | /* enable the pwr cntl and drive it high */ |
165 | gpio_line_config(DSMG600_PO_GPIO, IXP4XX_GPIO_OUT); | 166 | gpio_direction_output(DSMG600_PO_GPIO, 1); |
166 | |||
167 | /* poweroff */ | ||
168 | gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH); | ||
169 | } | 167 | } |
170 | 168 | ||
171 | /* This is used to make sure the power-button pusher is serious. The button | 169 | /* This is used to make sure the power-button pusher is serious. The button |
@@ -202,7 +200,7 @@ static void dsmg600_power_handler(unsigned long data) | |||
202 | ctrl_alt_del(); | 200 | ctrl_alt_del(); |
203 | 201 | ||
204 | /* Change the state of the power LED to "blink" */ | 202 | /* Change the state of the power LED to "blink" */ |
205 | gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW); | 203 | gpio_set_value(DSMG600_LED_PWR_GPIO, 0); |
206 | } else { | 204 | } else { |
207 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; | 205 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; |
208 | } | 206 | } |
@@ -228,6 +226,40 @@ static void __init dsmg600_timer_init(void) | |||
228 | ixp4xx_timer_init(); | 226 | ixp4xx_timer_init(); |
229 | } | 227 | } |
230 | 228 | ||
229 | static int __init dsmg600_gpio_init(void) | ||
230 | { | ||
231 | if (!machine_is_dsmg600()) | ||
232 | return 0; | ||
233 | |||
234 | gpio_request(DSMG600_RB_GPIO, "reset button"); | ||
235 | if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler, | ||
236 | IRQF_DISABLED | IRQF_TRIGGER_LOW, | ||
237 | "DSM-G600 reset button", NULL) < 0) { | ||
238 | |||
239 | printk(KERN_DEBUG "Reset Button IRQ %d not available\n", | ||
240 | gpio_to_irq(DSMG600_RB_GPIO)); | ||
241 | } | ||
242 | |||
243 | /* | ||
244 | * The power button on the D-Link DSM-G600 is on GPIO 15, but | ||
245 | * it cannot handle interrupts on that GPIO line. So we'll | ||
246 | * have to poll it with a kernel timer. | ||
247 | */ | ||
248 | |||
249 | /* Make sure that the power button GPIO is set up as an input */ | ||
250 | gpio_request(DSMG600_PB_GPIO, "power button"); | ||
251 | gpio_direction_input(DSMG600_PB_GPIO); | ||
252 | /* Request poweroff GPIO line */ | ||
253 | gpio_request(DSMG600_PO_GPIO, "power off button"); | ||
254 | |||
255 | /* Set the initial value for the power button IRQ handler */ | ||
256 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; | ||
257 | |||
258 | mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500)); | ||
259 | return 0; | ||
260 | } | ||
261 | device_initcall(dsmg600_gpio_init); | ||
262 | |||
231 | static void __init dsmg600_init(void) | 263 | static void __init dsmg600_init(void) |
232 | { | 264 | { |
233 | ixp4xx_sys_init(); | 265 | ixp4xx_sys_init(); |
@@ -251,27 +283,6 @@ static void __init dsmg600_init(void) | |||
251 | platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); | 283 | platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); |
252 | 284 | ||
253 | pm_power_off = dsmg600_power_off; | 285 | pm_power_off = dsmg600_power_off; |
254 | |||
255 | if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler, | ||
256 | IRQF_DISABLED | IRQF_TRIGGER_LOW, | ||
257 | "DSM-G600 reset button", NULL) < 0) { | ||
258 | |||
259 | printk(KERN_DEBUG "Reset Button IRQ %d not available\n", | ||
260 | gpio_to_irq(DSMG600_RB_GPIO)); | ||
261 | } | ||
262 | |||
263 | /* The power button on the D-Link DSM-G600 is on GPIO 15, but | ||
264 | * it cannot handle interrupts on that GPIO line. So we'll | ||
265 | * have to poll it with a kernel timer. | ||
266 | */ | ||
267 | |||
268 | /* Make sure that the power button GPIO is set up as an input */ | ||
269 | gpio_line_config(DSMG600_PB_GPIO, IXP4XX_GPIO_IN); | ||
270 | |||
271 | /* Set the initial value for the power button IRQ handler */ | ||
272 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; | ||
273 | |||
274 | mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500)); | ||
275 | } | 286 | } |
276 | 287 | ||
277 | MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") | 288 | MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") |
diff --git a/arch/arm/mach-ixp4xx/include/mach/platform.h b/arch/arm/mach-ixp4xx/include/mach/platform.h index 4c4c6a6f4526..75c4c6572ad0 100644 --- a/arch/arm/mach-ixp4xx/include/mach/platform.h +++ b/arch/arm/mach-ixp4xx/include/mach/platform.h | |||
@@ -131,44 +131,5 @@ struct pci_sys_data; | |||
131 | extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); | 131 | extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); |
132 | extern struct pci_ops ixp4xx_ops; | 132 | extern struct pci_ops ixp4xx_ops; |
133 | 133 | ||
134 | /* | ||
135 | * GPIO-functions | ||
136 | */ | ||
137 | /* | ||
138 | * The following converted to the real HW bits the gpio_line_config | ||
139 | */ | ||
140 | /* GPIO pin types */ | ||
141 | #define IXP4XX_GPIO_OUT 0x1 | ||
142 | #define IXP4XX_GPIO_IN 0x2 | ||
143 | |||
144 | /* GPIO signal types */ | ||
145 | #define IXP4XX_GPIO_LOW 0 | ||
146 | #define IXP4XX_GPIO_HIGH 1 | ||
147 | |||
148 | /* GPIO Clocks */ | ||
149 | #define IXP4XX_GPIO_CLK_0 14 | ||
150 | #define IXP4XX_GPIO_CLK_1 15 | ||
151 | |||
152 | static inline void gpio_line_config(u8 line, u32 direction) | ||
153 | { | ||
154 | if (direction == IXP4XX_GPIO_IN) | ||
155 | *IXP4XX_GPIO_GPOER |= (1 << line); | ||
156 | else | ||
157 | *IXP4XX_GPIO_GPOER &= ~(1 << line); | ||
158 | } | ||
159 | |||
160 | static inline void gpio_line_get(u8 line, int *value) | ||
161 | { | ||
162 | *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1; | ||
163 | } | ||
164 | |||
165 | static inline void gpio_line_set(u8 line, int value) | ||
166 | { | ||
167 | if (value == IXP4XX_GPIO_HIGH) | ||
168 | *IXP4XX_GPIO_GPOUTR |= (1 << line); | ||
169 | else if (value == IXP4XX_GPIO_LOW) | ||
170 | *IXP4XX_GPIO_GPOUTR &= ~(1 << line); | ||
171 | } | ||
172 | |||
173 | #endif // __ASSEMBLY__ | 134 | #endif // __ASSEMBLY__ |
174 | 135 | ||
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index 22d688b7d513..e7b8befa8729 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/mtd/nand.h> | 20 | #include <linux/mtd/nand.h> |
21 | #include <linux/mtd/partitions.h> | 21 | #include <linux/mtd/partitions.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/gpio.h> | ||
23 | #include <asm/types.h> | 24 | #include <asm/types.h> |
24 | #include <asm/setup.h> | 25 | #include <asm/setup.h> |
25 | #include <asm/memory.h> | 26 | #include <asm/memory.h> |
@@ -80,10 +81,10 @@ ixdp425_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | |||
80 | 81 | ||
81 | if (ctrl & NAND_CTRL_CHANGE) { | 82 | if (ctrl & NAND_CTRL_CHANGE) { |
82 | if (ctrl & NAND_NCE) { | 83 | if (ctrl & NAND_NCE) { |
83 | gpio_line_set(IXDP425_NAND_NCE_PIN, IXP4XX_GPIO_LOW); | 84 | gpio_set_value(IXDP425_NAND_NCE_PIN, 0); |
84 | udelay(5); | 85 | udelay(5); |
85 | } else | 86 | } else |
86 | gpio_line_set(IXDP425_NAND_NCE_PIN, IXP4XX_GPIO_HIGH); | 87 | gpio_set_value(IXDP425_NAND_NCE_PIN, 1); |
87 | 88 | ||
88 | offset = (ctrl & NAND_CLE) ? IXDP425_NAND_CMD_BYTE : 0; | 89 | offset = (ctrl & NAND_CLE) ? IXDP425_NAND_CMD_BYTE : 0; |
89 | offset |= (ctrl & NAND_ALE) ? IXDP425_NAND_ADDR_BYTE : 0; | 90 | offset |= (ctrl & NAND_ALE) ? IXDP425_NAND_ADDR_BYTE : 0; |
@@ -227,7 +228,8 @@ static void __init ixdp425_init(void) | |||
227 | ixdp425_flash_nand_resource.start = IXP4XX_EXP_BUS_BASE(3), | 228 | ixdp425_flash_nand_resource.start = IXP4XX_EXP_BUS_BASE(3), |
228 | ixdp425_flash_nand_resource.end = IXP4XX_EXP_BUS_BASE(3) + 0x10 - 1; | 229 | ixdp425_flash_nand_resource.end = IXP4XX_EXP_BUS_BASE(3) + 0x10 - 1; |
229 | 230 | ||
230 | gpio_line_config(IXDP425_NAND_NCE_PIN, IXP4XX_GPIO_OUT); | 231 | gpio_request(IXDP425_NAND_NCE_PIN, "NAND NCE pin"); |
232 | gpio_direction_output(IXDP425_NAND_NCE_PIN, 0); | ||
231 | 233 | ||
232 | /* Configure expansion bus for NAND Flash */ | 234 | /* Configure expansion bus for NAND Flash */ |
233 | *IXP4XX_EXP_CS3 = IXP4XX_EXP_BUS_CS_EN | | 235 | *IXP4XX_EXP_CS3 = IXP4XX_EXP_BUS_CS_EN | |
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c index ed667ce9f576..507cb5233537 100644 --- a/arch/arm/mach-ixp4xx/nas100d-setup.c +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c | |||
@@ -184,11 +184,8 @@ static void nas100d_power_off(void) | |||
184 | { | 184 | { |
185 | /* This causes the box to drop the power and go dead. */ | 185 | /* This causes the box to drop the power and go dead. */ |
186 | 186 | ||
187 | /* enable the pwr cntl gpio */ | 187 | /* enable the pwr cntl gpio and assert power off */ |
188 | gpio_line_config(NAS100D_PO_GPIO, IXP4XX_GPIO_OUT); | 188 | gpio_direction_output(NAS100D_PO_GPIO, 1); |
189 | |||
190 | /* do the deed */ | ||
191 | gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH); | ||
192 | } | 189 | } |
193 | 190 | ||
194 | /* This is used to make sure the power-button pusher is serious. The button | 191 | /* This is used to make sure the power-button pusher is serious. The button |
@@ -225,7 +222,7 @@ static void nas100d_power_handler(unsigned long data) | |||
225 | ctrl_alt_del(); | 222 | ctrl_alt_del(); |
226 | 223 | ||
227 | /* Change the state of the power LED to "blink" */ | 224 | /* Change the state of the power LED to "blink" */ |
228 | gpio_line_set(NAS100D_LED_PWR_GPIO, IXP4XX_GPIO_LOW); | 225 | gpio_set_value(NAS100D_LED_PWR_GPIO, 0); |
229 | } else { | 226 | } else { |
230 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; | 227 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; |
231 | } | 228 | } |
@@ -242,6 +239,33 @@ static irqreturn_t nas100d_reset_handler(int irq, void *dev_id) | |||
242 | return IRQ_HANDLED; | 239 | return IRQ_HANDLED; |
243 | } | 240 | } |
244 | 241 | ||
242 | static int __init nas100d_gpio_init(void) | ||
243 | { | ||
244 | if (!machine_is_nas100d()) | ||
245 | return 0; | ||
246 | |||
247 | /* | ||
248 | * The power button on the Iomega NAS100d is on GPIO 14, but | ||
249 | * it cannot handle interrupts on that GPIO line. So we'll | ||
250 | * have to poll it with a kernel timer. | ||
251 | */ | ||
252 | |||
253 | /* Request the power off GPIO */ | ||
254 | gpio_request(NAS100D_PO_GPIO, "power off"); | ||
255 | |||
256 | /* Make sure that the power button GPIO is set up as an input */ | ||
257 | gpio_request(NAS100D_PB_GPIO, "power button"); | ||
258 | gpio_direction_input(NAS100D_PB_GPIO); | ||
259 | |||
260 | /* Set the initial value for the power button IRQ handler */ | ||
261 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; | ||
262 | |||
263 | mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500)); | ||
264 | |||
265 | return 0; | ||
266 | } | ||
267 | device_initcall(nas100d_gpio_init); | ||
268 | |||
245 | static void __init nas100d_init(void) | 269 | static void __init nas100d_init(void) |
246 | { | 270 | { |
247 | uint8_t __iomem *f; | 271 | uint8_t __iomem *f; |
@@ -278,19 +302,6 @@ static void __init nas100d_init(void) | |||
278 | gpio_to_irq(NAS100D_RB_GPIO)); | 302 | gpio_to_irq(NAS100D_RB_GPIO)); |
279 | } | 303 | } |
280 | 304 | ||
281 | /* The power button on the Iomega NAS100d is on GPIO 14, but | ||
282 | * it cannot handle interrupts on that GPIO line. So we'll | ||
283 | * have to poll it with a kernel timer. | ||
284 | */ | ||
285 | |||
286 | /* Make sure that the power button GPIO is set up as an input */ | ||
287 | gpio_line_config(NAS100D_PB_GPIO, IXP4XX_GPIO_IN); | ||
288 | |||
289 | /* Set the initial value for the power button IRQ handler */ | ||
290 | power_button_countdown = PBUTTON_HOLDDOWN_COUNT; | ||
291 | |||
292 | mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500)); | ||
293 | |||
294 | /* | 305 | /* |
295 | * Map in a portion of the flash and read the MAC address. | 306 | * Map in a portion of the flash and read the MAC address. |
296 | * Since it is stored in BE in the flash itself, we need to | 307 | * Since it is stored in BE in the flash itself, we need to |
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c index 7e55236c26ea..ba5f1cda2a9d 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c | |||
@@ -197,11 +197,8 @@ static void nslu2_power_off(void) | |||
197 | { | 197 | { |
198 | /* This causes the box to drop the power and go dead. */ | 198 | /* This causes the box to drop the power and go dead. */ |
199 | 199 | ||
200 | /* enable the pwr cntl gpio */ | 200 | /* enable the pwr cntl gpio and assert power off */ |
201 | gpio_line_config(NSLU2_PO_GPIO, IXP4XX_GPIO_OUT); | 201 | gpio_direction_output(NSLU2_PO_GPIO, 1); |
202 | |||
203 | /* do the deed */ | ||
204 | gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH); | ||
205 | } | 202 | } |
206 | 203 | ||
207 | static irqreturn_t nslu2_power_handler(int irq, void *dev_id) | 204 | static irqreturn_t nslu2_power_handler(int irq, void *dev_id) |
@@ -223,6 +220,16 @@ static irqreturn_t nslu2_reset_handler(int irq, void *dev_id) | |||
223 | return IRQ_HANDLED; | 220 | return IRQ_HANDLED; |
224 | } | 221 | } |
225 | 222 | ||
223 | static int __init nslu2_gpio_init(void) | ||
224 | { | ||
225 | if (!machine_is_nslu2()) | ||
226 | return 0; | ||
227 | |||
228 | /* Request the power off GPIO */ | ||
229 | return gpio_request(NSLU2_PO_GPIO, "power off"); | ||
230 | } | ||
231 | device_initcall(nslu2_gpio_init); | ||
232 | |||
226 | static void __init nslu2_timer_init(void) | 233 | static void __init nslu2_timer_init(void) |
227 | { | 234 | { |
228 | /* The xtal on this machine is non-standard. */ | 235 | /* The xtal on this machine is non-standard. */ |
diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c index c12296157d4a..5cf0683577ea 100644 --- a/arch/arm/mach-keystone/platsmp.c +++ b/arch/arm/mach-keystone/platsmp.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | 18 | ||
19 | #include <asm/smp_plat.h> | 19 | #include <asm/smp_plat.h> |
20 | #include <asm/prom.h> | ||
21 | 20 | ||
22 | #include "keystone.h" | 21 | #include "keystone.h" |
23 | 22 | ||
diff --git a/arch/arm/mach-mmp/include/mach/gpio.h b/arch/arm/mach-mmp/include/mach/gpio.h deleted file mode 100644 index 13219ebf5128..000000000000 --- a/arch/arm/mach-mmp/include/mach/gpio.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_GPIO_H | ||
2 | #define __ASM_MACH_GPIO_H | ||
3 | |||
4 | #include <asm-generic/gpio.h> | ||
5 | |||
6 | #include <mach/cputype.h> | ||
7 | |||
8 | #endif /* __ASM_MACH_GPIO_H */ | ||
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 696fb73296d0..1e9c3383daba 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -274,7 +274,6 @@ static void __init msm_dt_timer_init(struct device_node *np) | |||
274 | pr_err("Unknown frequency\n"); | 274 | pr_err("Unknown frequency\n"); |
275 | return; | 275 | return; |
276 | } | 276 | } |
277 | of_node_put(np); | ||
278 | 277 | ||
279 | event_base = base + 0x4; | 278 | event_base = base + 0x4; |
280 | sts_base = base + 0x88; | 279 | sts_base = base + 0x88; |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index e15ac005ef17..1f25f3e99c05 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -40,7 +40,7 @@ omap-4-5-common = omap4-common.o omap-wakeupgen.o | |||
40 | obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-common) $(smp-y) sleep44xx.o | 40 | obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-common) $(smp-y) sleep44xx.o |
41 | obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-common) $(smp-y) sleep44xx.o | 41 | obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-common) $(smp-y) sleep44xx.o |
42 | obj-$(CONFIG_SOC_AM43XX) += $(omap-4-5-common) | 42 | obj-$(CONFIG_SOC_AM43XX) += $(omap-4-5-common) |
43 | obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-common) $(smp-y) | 43 | obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-common) $(smp-y) sleep44xx.o |
44 | 44 | ||
45 | plus_sec := $(call as-instr,.arch_extension sec,+sec) | 45 | plus_sec := $(call as-instr,.arch_extension sec,+sec) |
46 | AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) | 46 | AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 8b9cd0690ce7..09f6149b59a9 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -510,7 +510,7 @@ static int __init beagle_opp_init(void) | |||
510 | mpu_dev = get_cpu_device(0); | 510 | mpu_dev = get_cpu_device(0); |
511 | iva_dev = omap_device_get_by_hwmod_name("iva"); | 511 | iva_dev = omap_device_get_by_hwmod_name("iva"); |
512 | 512 | ||
513 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { | 513 | if (!mpu_dev || IS_ERR(iva_dev)) { |
514 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", | 514 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", |
515 | __func__, mpu_dev, iva_dev); | 515 | __func__, mpu_dev, iva_dev); |
516 | return -ENODEV; | 516 | return -ENODEV; |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 5c0d0e120420..f093af17f5e6 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -213,29 +213,11 @@ static struct lp55xx_led_config rx51_lp5523_led_config[] = { | |||
213 | } | 213 | } |
214 | }; | 214 | }; |
215 | 215 | ||
216 | static int rx51_lp5523_setup(void) | ||
217 | { | ||
218 | return gpio_request_one(RX51_LP5523_CHIP_EN_GPIO, GPIOF_DIR_OUT, | ||
219 | "lp5523_enable"); | ||
220 | } | ||
221 | |||
222 | static void rx51_lp5523_release(void) | ||
223 | { | ||
224 | gpio_free(RX51_LP5523_CHIP_EN_GPIO); | ||
225 | } | ||
226 | |||
227 | static void rx51_lp5523_enable(bool state) | ||
228 | { | ||
229 | gpio_set_value(RX51_LP5523_CHIP_EN_GPIO, !!state); | ||
230 | } | ||
231 | |||
232 | static struct lp55xx_platform_data rx51_lp5523_platform_data = { | 216 | static struct lp55xx_platform_data rx51_lp5523_platform_data = { |
233 | .led_config = rx51_lp5523_led_config, | 217 | .led_config = rx51_lp5523_led_config, |
234 | .num_channels = ARRAY_SIZE(rx51_lp5523_led_config), | 218 | .num_channels = ARRAY_SIZE(rx51_lp5523_led_config), |
235 | .clock_mode = LP55XX_CLOCK_AUTO, | 219 | .clock_mode = LP55XX_CLOCK_AUTO, |
236 | .setup_resources = rx51_lp5523_setup, | 220 | .enable_gpio = RX51_LP5523_CHIP_EN_GPIO, |
237 | .release_resources = rx51_lp5523_release, | ||
238 | .enable = rx51_lp5523_enable, | ||
239 | }; | 221 | }; |
240 | #endif | 222 | #endif |
241 | 223 | ||
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c index 03a2829beb8e..3b05aea56d1f 100644 --- a/arch/arm/mach-omap2/cclock3xxx_data.c +++ b/arch/arm/mach-omap2/cclock3xxx_data.c | |||
@@ -381,6 +381,42 @@ static struct clk_hw_omap dpll4_ck_hw = { | |||
381 | 381 | ||
382 | DEFINE_STRUCT_CLK(dpll4_ck, dpll3_ck_parent_names, dpll4_ck_ops); | 382 | DEFINE_STRUCT_CLK(dpll4_ck, dpll3_ck_parent_names, dpll4_ck_ops); |
383 | 383 | ||
384 | static const struct clk_div_table dpll4_mx_ck_div_table[] = { | ||
385 | { .div = 1, .val = 1 }, | ||
386 | { .div = 2, .val = 2 }, | ||
387 | { .div = 3, .val = 3 }, | ||
388 | { .div = 4, .val = 4 }, | ||
389 | { .div = 5, .val = 5 }, | ||
390 | { .div = 6, .val = 6 }, | ||
391 | { .div = 7, .val = 7 }, | ||
392 | { .div = 8, .val = 8 }, | ||
393 | { .div = 9, .val = 9 }, | ||
394 | { .div = 10, .val = 10 }, | ||
395 | { .div = 11, .val = 11 }, | ||
396 | { .div = 12, .val = 12 }, | ||
397 | { .div = 13, .val = 13 }, | ||
398 | { .div = 14, .val = 14 }, | ||
399 | { .div = 15, .val = 15 }, | ||
400 | { .div = 16, .val = 16 }, | ||
401 | { .div = 17, .val = 17 }, | ||
402 | { .div = 18, .val = 18 }, | ||
403 | { .div = 19, .val = 19 }, | ||
404 | { .div = 20, .val = 20 }, | ||
405 | { .div = 21, .val = 21 }, | ||
406 | { .div = 22, .val = 22 }, | ||
407 | { .div = 23, .val = 23 }, | ||
408 | { .div = 24, .val = 24 }, | ||
409 | { .div = 25, .val = 25 }, | ||
410 | { .div = 26, .val = 26 }, | ||
411 | { .div = 27, .val = 27 }, | ||
412 | { .div = 28, .val = 28 }, | ||
413 | { .div = 29, .val = 29 }, | ||
414 | { .div = 30, .val = 30 }, | ||
415 | { .div = 31, .val = 31 }, | ||
416 | { .div = 32, .val = 32 }, | ||
417 | { .div = 0 }, | ||
418 | }; | ||
419 | |||
384 | DEFINE_CLK_DIVIDER(dpll4_m5_ck, "dpll4_ck", &dpll4_ck, 0x0, | 420 | DEFINE_CLK_DIVIDER(dpll4_m5_ck, "dpll4_ck", &dpll4_ck, 0x0, |
385 | OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), | 421 | OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), |
386 | OMAP3430_CLKSEL_CAM_SHIFT, OMAP3630_CLKSEL_CAM_WIDTH, | 422 | OMAP3430_CLKSEL_CAM_SHIFT, OMAP3630_CLKSEL_CAM_WIDTH, |
@@ -524,10 +560,10 @@ static const struct clksel_rate clkout2_src_54m_rates[] = { | |||
524 | { .div = 0 } | 560 | { .div = 0 } |
525 | }; | 561 | }; |
526 | 562 | ||
527 | DEFINE_CLK_DIVIDER(dpll4_m3_ck, "dpll4_ck", &dpll4_ck, 0x0, | 563 | DEFINE_CLK_DIVIDER_TABLE(dpll4_m3_ck, "dpll4_ck", &dpll4_ck, 0x0, |
528 | OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | 564 | OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), |
529 | OMAP3430_CLKSEL_TV_SHIFT, OMAP3630_CLKSEL_TV_WIDTH, | 565 | OMAP3430_CLKSEL_TV_SHIFT, OMAP3630_CLKSEL_TV_WIDTH, |
530 | CLK_DIVIDER_ONE_BASED, NULL); | 566 | 0, dpll4_mx_ck_div_table, NULL); |
531 | 567 | ||
532 | static struct clk dpll4_m3x2_ck; | 568 | static struct clk dpll4_m3x2_ck; |
533 | 569 | ||
@@ -847,10 +883,10 @@ static struct clk dpll3_m3x2_ck_3630 = { | |||
847 | 883 | ||
848 | DEFINE_CLK_FIXED_FACTOR(dpll3_x2_ck, "dpll3_ck", &dpll3_ck, 0x0, 2, 1); | 884 | DEFINE_CLK_FIXED_FACTOR(dpll3_x2_ck, "dpll3_ck", &dpll3_ck, 0x0, 2, 1); |
849 | 885 | ||
850 | DEFINE_CLK_DIVIDER(dpll4_m4_ck, "dpll4_ck", &dpll4_ck, 0x0, | 886 | DEFINE_CLK_DIVIDER_TABLE(dpll4_m4_ck, "dpll4_ck", &dpll4_ck, 0x0, |
851 | OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | 887 | OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), |
852 | OMAP3430_CLKSEL_DSS1_SHIFT, OMAP3630_CLKSEL_DSS1_WIDTH, | 888 | OMAP3430_CLKSEL_DSS1_SHIFT, OMAP3630_CLKSEL_DSS1_WIDTH, |
853 | CLK_DIVIDER_ONE_BASED, NULL); | 889 | 0, dpll4_mx_ck_div_table, NULL); |
854 | 890 | ||
855 | static struct clk dpll4_m4x2_ck; | 891 | static struct clk dpll4_m4x2_ck; |
856 | 892 | ||
@@ -869,7 +905,8 @@ static struct clk_hw_omap dpll4_m4x2_ck_hw = { | |||
869 | .clkdm_name = "dpll4_clkdm", | 905 | .clkdm_name = "dpll4_clkdm", |
870 | }; | 906 | }; |
871 | 907 | ||
872 | DEFINE_STRUCT_CLK(dpll4_m4x2_ck, dpll4_m4x2_ck_parent_names, dpll4_m5x2_ck_ops); | 908 | DEFINE_STRUCT_CLK_FLAGS(dpll4_m4x2_ck, dpll4_m4x2_ck_parent_names, |
909 | dpll4_m5x2_ck_ops, CLK_SET_RATE_PARENT); | ||
873 | 910 | ||
874 | static struct clk dpll4_m4x2_ck_3630 = { | 911 | static struct clk dpll4_m4x2_ck_3630 = { |
875 | .name = "dpll4_m4x2_ck", | 912 | .name = "dpll4_m4x2_ck", |
@@ -877,6 +914,7 @@ static struct clk dpll4_m4x2_ck_3630 = { | |||
877 | .parent_names = dpll4_m4x2_ck_parent_names, | 914 | .parent_names = dpll4_m4x2_ck_parent_names, |
878 | .num_parents = ARRAY_SIZE(dpll4_m4x2_ck_parent_names), | 915 | .num_parents = ARRAY_SIZE(dpll4_m4x2_ck_parent_names), |
879 | .ops = &dpll4_m5x2_ck_3630_ops, | 916 | .ops = &dpll4_m5x2_ck_3630_ops, |
917 | .flags = CLK_SET_RATE_PARENT, | ||
880 | }; | 918 | }; |
881 | 919 | ||
882 | DEFINE_CLK_DIVIDER(dpll4_m6_ck, "dpll4_ck", &dpll4_ck, 0x0, | 920 | DEFINE_CLK_DIVIDER(dpll4_m6_ck, "dpll4_ck", &dpll4_ck, 0x0, |
@@ -968,8 +1006,9 @@ static struct clk_hw_omap dss1_alwon_fck_3430es1_hw = { | |||
968 | .clkdm_name = "dss_clkdm", | 1006 | .clkdm_name = "dss_clkdm", |
969 | }; | 1007 | }; |
970 | 1008 | ||
971 | DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es1, dss1_alwon_fck_3430es1_parent_names, | 1009 | DEFINE_STRUCT_CLK_FLAGS(dss1_alwon_fck_3430es1, |
972 | aes2_ick_ops); | 1010 | dss1_alwon_fck_3430es1_parent_names, aes2_ick_ops, |
1011 | CLK_SET_RATE_PARENT); | ||
973 | 1012 | ||
974 | static struct clk dss1_alwon_fck_3430es2; | 1013 | static struct clk dss1_alwon_fck_3430es2; |
975 | 1014 | ||
@@ -983,8 +1022,9 @@ static struct clk_hw_omap dss1_alwon_fck_3430es2_hw = { | |||
983 | .clkdm_name = "dss_clkdm", | 1022 | .clkdm_name = "dss_clkdm", |
984 | }; | 1023 | }; |
985 | 1024 | ||
986 | DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es2, dss1_alwon_fck_3430es1_parent_names, | 1025 | DEFINE_STRUCT_CLK_FLAGS(dss1_alwon_fck_3430es2, |
987 | aes2_ick_ops); | 1026 | dss1_alwon_fck_3430es1_parent_names, aes2_ick_ops, |
1027 | CLK_SET_RATE_PARENT); | ||
988 | 1028 | ||
989 | static struct clk dss2_alwon_fck; | 1029 | static struct clk dss2_alwon_fck; |
990 | 1030 | ||
diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c index b237950eb8a3..ec0dc0b1755e 100644 --- a/arch/arm/mach-omap2/cclock44xx_data.c +++ b/arch/arm/mach-omap2/cclock44xx_data.c | |||
@@ -830,7 +830,8 @@ DEFINE_CLK_GATE(dss_tv_clk, "extalt_clkin_ck", &extalt_clkin_ck, 0x0, | |||
830 | OMAP4430_CM_DSS_DSS_CLKCTRL, | 830 | OMAP4430_CM_DSS_DSS_CLKCTRL, |
831 | OMAP4430_OPTFCLKEN_TV_CLK_SHIFT, 0x0, NULL); | 831 | OMAP4430_OPTFCLKEN_TV_CLK_SHIFT, 0x0, NULL); |
832 | 832 | ||
833 | DEFINE_CLK_GATE(dss_dss_clk, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, 0x0, | 833 | DEFINE_CLK_GATE(dss_dss_clk, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, |
834 | CLK_SET_RATE_PARENT, | ||
834 | OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_DSSCLK_SHIFT, | 835 | OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_DSSCLK_SHIFT, |
835 | 0x0, NULL); | 836 | 0x0, NULL); |
836 | 837 | ||
diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c index ef990118d32b..2757504a13c4 100644 --- a/arch/arm/mach-omap2/gpmc-smsc911x.c +++ b/arch/arm/mach-omap2/gpmc-smsc911x.c | |||
@@ -83,7 +83,7 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *gpmc_cfg) | |||
83 | pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id, | 83 | pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id, |
84 | gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources), | 84 | gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources), |
85 | &gpmc_smsc911x_config, sizeof(gpmc_smsc911x_config)); | 85 | &gpmc_smsc911x_config, sizeof(gpmc_smsc911x_config)); |
86 | if (!pdev) { | 86 | if (IS_ERR(pdev)) { |
87 | pr_err("Unable to register platform device\n"); | 87 | pr_err("Unable to register platform device\n"); |
88 | gpio_free(gpmc_cfg->gpio_reset); | 88 | gpio_free(gpmc_cfg->gpio_reset); |
89 | goto free2; | 89 | goto free2; |
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index b69dd9abb50a..53f0735817bb 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c | |||
@@ -621,6 +621,7 @@ static int _od_suspend_noirq(struct device *dev) | |||
621 | 621 | ||
622 | if (!ret && !pm_runtime_status_suspended(dev)) { | 622 | if (!ret && !pm_runtime_status_suspended(dev)) { |
623 | if (pm_generic_runtime_suspend(dev) == 0) { | 623 | if (pm_generic_runtime_suspend(dev) == 0) { |
624 | pm_runtime_set_suspended(dev); | ||
624 | omap_device_idle(pdev); | 625 | omap_device_idle(pdev); |
625 | od->flags |= OMAP_DEVICE_SUSPENDED; | 626 | od->flags |= OMAP_DEVICE_SUSPENDED; |
626 | } | 627 | } |
@@ -634,10 +635,18 @@ static int _od_resume_noirq(struct device *dev) | |||
634 | struct platform_device *pdev = to_platform_device(dev); | 635 | struct platform_device *pdev = to_platform_device(dev); |
635 | struct omap_device *od = to_omap_device(pdev); | 636 | struct omap_device *od = to_omap_device(pdev); |
636 | 637 | ||
637 | if ((od->flags & OMAP_DEVICE_SUSPENDED) && | 638 | if (od->flags & OMAP_DEVICE_SUSPENDED) { |
638 | !pm_runtime_status_suspended(dev)) { | ||
639 | od->flags &= ~OMAP_DEVICE_SUSPENDED; | 639 | od->flags &= ~OMAP_DEVICE_SUSPENDED; |
640 | omap_device_enable(pdev); | 640 | omap_device_enable(pdev); |
641 | /* | ||
642 | * XXX: we run before core runtime pm has resumed itself. At | ||
643 | * this point in time, we just restore the runtime pm state and | ||
644 | * considering symmetric operations in resume, we donot expect | ||
645 | * to fail. If we failed, something changed in core runtime_pm | ||
646 | * framework OR some device driver messed things up, hence, WARN | ||
647 | */ | ||
648 | WARN(pm_runtime_set_active(dev), | ||
649 | "Could not set %s runtime state active\n", dev_name(dev)); | ||
641 | pm_generic_runtime_resume(dev); | 650 | pm_generic_runtime_resume(dev); |
642 | } | 651 | } |
643 | 652 | ||
diff --git a/arch/arm/mach-omap2/prm44xx_54xx.h b/arch/arm/mach-omap2/prm44xx_54xx.h index a085d9cc1f5d..7a976065e138 100644 --- a/arch/arm/mach-omap2/prm44xx_54xx.h +++ b/arch/arm/mach-omap2/prm44xx_54xx.h | |||
@@ -42,7 +42,8 @@ extern u32 omap4_prm_vcvp_read(u8 offset); | |||
42 | extern void omap4_prm_vcvp_write(u32 val, u8 offset); | 42 | extern void omap4_prm_vcvp_write(u32 val, u8 offset); |
43 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); | 43 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); |
44 | 44 | ||
45 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) | 45 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ |
46 | defined(CONFIG_SOC_DRA7XX) | ||
46 | void omap44xx_prm_reconfigure_io_chain(void); | 47 | void omap44xx_prm_reconfigure_io_chain(void); |
47 | #else | 48 | #else |
48 | static inline void omap44xx_prm_reconfigure_io_chain(void) | 49 | static inline void omap44xx_prm_reconfigure_io_chain(void) |
diff --git a/arch/arm/mach-pxa/include/mach/gpio.h b/arch/arm/mach-pxa/include/mach/gpio.h deleted file mode 100644 index 0248e433bc98..000000000000 --- a/arch/arm/mach-pxa/include/mach/gpio.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pxa/include/mach/gpio.h | ||
3 | * | ||
4 | * PXA GPIO wrappers for arch-neutral GPIO calls | ||
5 | * | ||
6 | * Written by Philipp Zabel <philipp.zabel@gmail.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef __ASM_ARCH_PXA_GPIO_H | ||
25 | #define __ASM_ARCH_PXA_GPIO_H | ||
26 | |||
27 | #include <asm-generic/gpio.h> | ||
28 | |||
29 | #include <mach/irqs.h> | ||
30 | #include <mach/hardware.h> | ||
31 | |||
32 | #endif | ||
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index 1a911df9e451..aca7d16e195d 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c | |||
@@ -310,10 +310,6 @@ static struct regulator_consumer_supply wallvdd_consumers[] = { | |||
310 | 310 | ||
311 | REGULATOR_SUPPLY("SPKVDDL", "spi0.1"), | 311 | REGULATOR_SUPPLY("SPKVDDL", "spi0.1"), |
312 | REGULATOR_SUPPLY("SPKVDDR", "spi0.1"), | 312 | REGULATOR_SUPPLY("SPKVDDR", "spi0.1"), |
313 | REGULATOR_SUPPLY("SPKVDDL", "wm5102-codec"), | ||
314 | REGULATOR_SUPPLY("SPKVDDR", "wm5102-codec"), | ||
315 | REGULATOR_SUPPLY("SPKVDDL", "wm5110-codec"), | ||
316 | REGULATOR_SUPPLY("SPKVDDR", "wm5110-codec"), | ||
317 | 313 | ||
318 | REGULATOR_SUPPLY("DC1VDD", "0-0034"), | 314 | REGULATOR_SUPPLY("DC1VDD", "0-0034"), |
319 | REGULATOR_SUPPLY("DC2VDD", "0-0034"), | 315 | REGULATOR_SUPPLY("DC2VDD", "0-0034"), |
@@ -653,14 +649,6 @@ static struct regulator_consumer_supply pvdd_1v8_consumers[] = { | |||
653 | REGULATOR_SUPPLY("DBVDD3", "spi0.1"), | 649 | REGULATOR_SUPPLY("DBVDD3", "spi0.1"), |
654 | REGULATOR_SUPPLY("LDOVDD", "spi0.1"), | 650 | REGULATOR_SUPPLY("LDOVDD", "spi0.1"), |
655 | REGULATOR_SUPPLY("CPVDD", "spi0.1"), | 651 | REGULATOR_SUPPLY("CPVDD", "spi0.1"), |
656 | |||
657 | REGULATOR_SUPPLY("DBVDD2", "wm5102-codec"), | ||
658 | REGULATOR_SUPPLY("DBVDD3", "wm5102-codec"), | ||
659 | REGULATOR_SUPPLY("CPVDD", "wm5102-codec"), | ||
660 | |||
661 | REGULATOR_SUPPLY("DBVDD2", "wm5110-codec"), | ||
662 | REGULATOR_SUPPLY("DBVDD3", "wm5110-codec"), | ||
663 | REGULATOR_SUPPLY("CPVDD", "wm5110-codec"), | ||
664 | }; | 652 | }; |
665 | 653 | ||
666 | static struct regulator_init_data pvdd_1v8 = { | 654 | static struct regulator_init_data pvdd_1v8 = { |
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index b5db207dfd1e..9a5f9fb352ce 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -358,8 +358,7 @@ static struct delay_timer u300_delay_timer; | |||
358 | */ | 358 | */ |
359 | static void __init u300_timer_init_of(struct device_node *np) | 359 | static void __init u300_timer_init_of(struct device_node *np) |
360 | { | 360 | { |
361 | struct resource irq_res; | 361 | unsigned int irq; |
362 | int irq; | ||
363 | struct clk *clk; | 362 | struct clk *clk; |
364 | unsigned long rate; | 363 | unsigned long rate; |
365 | 364 | ||
@@ -368,11 +367,11 @@ static void __init u300_timer_init_of(struct device_node *np) | |||
368 | panic("could not ioremap system timer\n"); | 367 | panic("could not ioremap system timer\n"); |
369 | 368 | ||
370 | /* Get the IRQ for the GP1 timer */ | 369 | /* Get the IRQ for the GP1 timer */ |
371 | irq = of_irq_to_resource(np, 2, &irq_res); | 370 | irq = irq_of_parse_and_map(np, 2); |
372 | if (irq <= 0) | 371 | if (!irq) |
373 | panic("no IRQ for system timer\n"); | 372 | panic("no IRQ for system timer\n"); |
374 | 373 | ||
375 | pr_info("U300 GP1 timer @ base: %p, IRQ: %d\n", u300_timer_base, irq); | 374 | pr_info("U300 GP1 timer @ base: %p, IRQ: %u\n", u300_timer_base, irq); |
376 | 375 | ||
377 | /* Clock the interrupt controller */ | 376 | /* Clock the interrupt controller */ |
378 | clk = of_clk_get(np, 0); | 377 | clk = of_clk_get(np, 0); |
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h deleted file mode 100644 index 5385a4203277..000000000000 --- a/arch/arm/mach-w90x900/include/mach/gpio.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-w90p910/include/mach/gpio.h | ||
3 | * | ||
4 | * Generic w90p910 GPIO handling | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_W90P910_GPIO_H | ||
14 | #define __ASM_ARCH_W90P910_GPIO_H | ||
15 | |||
16 | #include <mach/hardware.h> | ||
17 | #include <asm/irq.h> | ||
18 | |||
19 | static inline int gpio_to_irq(unsigned gpio) | ||
20 | { | ||
21 | return gpio; | ||
22 | } | ||
23 | #define gpio_to_irq gpio_to_irq | ||
24 | |||
25 | static inline int irq_to_gpio(unsigned irq) | ||
26 | { | ||
27 | return irq; | ||
28 | } | ||
29 | |||
30 | #endif | ||
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig index 04f8a4a6e755..6b04260aa142 100644 --- a/arch/arm/mach-zynq/Kconfig +++ b/arch/arm/mach-zynq/Kconfig | |||
@@ -13,5 +13,6 @@ config ARCH_ZYNQ | |||
13 | select HAVE_SMP | 13 | select HAVE_SMP |
14 | select SPARSE_IRQ | 14 | select SPARSE_IRQ |
15 | select CADENCE_TTC_TIMER | 15 | select CADENCE_TTC_TIMER |
16 | select ARM_GLOBAL_TIMER | ||
16 | help | 17 | help |
17 | Support for Xilinx Zynq ARM Cortex A9 Platform | 18 | Support for Xilinx Zynq ARM Cortex A9 Platform |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 18ec4c504abf..ca907f805c57 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -76,14 +76,6 @@ static int __init parse_tag_initrd2(const struct tag *tag) | |||
76 | 76 | ||
77 | __tagtable(ATAG_INITRD2, parse_tag_initrd2); | 77 | __tagtable(ATAG_INITRD2, parse_tag_initrd2); |
78 | 78 | ||
79 | #ifdef CONFIG_OF_FLATTREE | ||
80 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) | ||
81 | { | ||
82 | phys_initrd_start = start; | ||
83 | phys_initrd_size = end - start; | ||
84 | } | ||
85 | #endif /* CONFIG_OF_FLATTREE */ | ||
86 | |||
87 | /* | 79 | /* |
88 | * This keeps memory configuration data used by a couple memory | 80 | * This keeps memory configuration data used by a couple memory |
89 | * initialization functions, as well as show_mem() for the skipping | 81 | * initialization functions, as well as show_mem() for the skipping |
@@ -350,6 +342,11 @@ void __init arm_memblock_init(struct meminfo *mi, | |||
350 | memblock_reserve(__pa(_stext), _end - _stext); | 342 | memblock_reserve(__pa(_stext), _end - _stext); |
351 | #endif | 343 | #endif |
352 | #ifdef CONFIG_BLK_DEV_INITRD | 344 | #ifdef CONFIG_BLK_DEV_INITRD |
345 | /* FDT scan will populate initrd_start */ | ||
346 | if (initrd_start) { | ||
347 | phys_initrd_start = __virt_to_phys(initrd_start); | ||
348 | phys_initrd_size = initrd_end - initrd_start; | ||
349 | } | ||
353 | if (phys_initrd_size && | 350 | if (phys_initrd_size && |
354 | !memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) { | 351 | !memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) { |
355 | pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region - disabling initrd\n", | 352 | pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region - disabling initrd\n", |
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile index a99dc15a70f7..224e56c6049b 100644 --- a/arch/arm/plat-iop/Makefile +++ b/arch/arm/plat-iop/Makefile | |||
@@ -5,7 +5,6 @@ | |||
5 | obj-y := | 5 | obj-y := |
6 | 6 | ||
7 | # IOP32X | 7 | # IOP32X |
8 | obj-$(CONFIG_ARCH_IOP32X) += gpio.o | ||
9 | obj-$(CONFIG_ARCH_IOP32X) += i2c.o | 8 | obj-$(CONFIG_ARCH_IOP32X) += i2c.o |
10 | obj-$(CONFIG_ARCH_IOP32X) += pci.o | 9 | obj-$(CONFIG_ARCH_IOP32X) += pci.o |
11 | obj-$(CONFIG_ARCH_IOP32X) += setup.o | 10 | obj-$(CONFIG_ARCH_IOP32X) += setup.o |
@@ -16,7 +15,6 @@ obj-$(CONFIG_ARCH_IOP32X) += pmu.o | |||
16 | obj-$(CONFIG_ARCH_IOP32X) += restart.o | 15 | obj-$(CONFIG_ARCH_IOP32X) += restart.o |
17 | 16 | ||
18 | # IOP33X | 17 | # IOP33X |
19 | obj-$(CONFIG_ARCH_IOP33X) += gpio.o | ||
20 | obj-$(CONFIG_ARCH_IOP33X) += i2c.o | 18 | obj-$(CONFIG_ARCH_IOP33X) += i2c.o |
21 | obj-$(CONFIG_ARCH_IOP33X) += pci.o | 19 | obj-$(CONFIG_ARCH_IOP33X) += pci.o |
22 | obj-$(CONFIG_ARCH_IOP33X) += setup.o | 20 | obj-$(CONFIG_ARCH_IOP33X) += setup.o |
diff --git a/arch/arm/plat-iop/gpio.c b/arch/arm/plat-iop/gpio.c deleted file mode 100644 index 697de6dc4936..000000000000 --- a/arch/arm/plat-iop/gpio.c +++ /dev/null | |||
@@ -1,93 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-iop/gpio.c | ||
3 | * GPIO handling for Intel IOP3xx processors. | ||
4 | * | ||
5 | * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or (at | ||
10 | * your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #include <linux/device.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/export.h> | ||
19 | #include <asm/hardware/iop3xx.h> | ||
20 | #include <mach/gpio.h> | ||
21 | |||
22 | void gpio_line_config(int line, int direction) | ||
23 | { | ||
24 | unsigned long flags; | ||
25 | |||
26 | local_irq_save(flags); | ||
27 | if (direction == GPIO_IN) { | ||
28 | *IOP3XX_GPOE |= 1 << line; | ||
29 | } else if (direction == GPIO_OUT) { | ||
30 | *IOP3XX_GPOE &= ~(1 << line); | ||
31 | } | ||
32 | local_irq_restore(flags); | ||
33 | } | ||
34 | EXPORT_SYMBOL(gpio_line_config); | ||
35 | |||
36 | int gpio_line_get(int line) | ||
37 | { | ||
38 | return !!(*IOP3XX_GPID & (1 << line)); | ||
39 | } | ||
40 | EXPORT_SYMBOL(gpio_line_get); | ||
41 | |||
42 | void gpio_line_set(int line, int value) | ||
43 | { | ||
44 | unsigned long flags; | ||
45 | |||
46 | local_irq_save(flags); | ||
47 | if (value == GPIO_LOW) { | ||
48 | *IOP3XX_GPOD &= ~(1 << line); | ||
49 | } else if (value == GPIO_HIGH) { | ||
50 | *IOP3XX_GPOD |= 1 << line; | ||
51 | } | ||
52 | local_irq_restore(flags); | ||
53 | } | ||
54 | EXPORT_SYMBOL(gpio_line_set); | ||
55 | |||
56 | static int iop3xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) | ||
57 | { | ||
58 | gpio_line_config(gpio, GPIO_IN); | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | static int iop3xx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int level) | ||
63 | { | ||
64 | gpio_line_set(gpio, level); | ||
65 | gpio_line_config(gpio, GPIO_OUT); | ||
66 | return 0; | ||
67 | } | ||
68 | |||
69 | static int iop3xx_gpio_get_value(struct gpio_chip *chip, unsigned gpio) | ||
70 | { | ||
71 | return gpio_line_get(gpio); | ||
72 | } | ||
73 | |||
74 | static void iop3xx_gpio_set_value(struct gpio_chip *chip, unsigned gpio, int value) | ||
75 | { | ||
76 | gpio_line_set(gpio, value); | ||
77 | } | ||
78 | |||
79 | static struct gpio_chip iop3xx_chip = { | ||
80 | .label = "iop3xx", | ||
81 | .direction_input = iop3xx_gpio_direction_input, | ||
82 | .get = iop3xx_gpio_get_value, | ||
83 | .direction_output = iop3xx_gpio_direction_output, | ||
84 | .set = iop3xx_gpio_set_value, | ||
85 | .base = 0, | ||
86 | .ngpio = IOP3XX_N_GPIOS, | ||
87 | }; | ||
88 | |||
89 | static int __init iop3xx_gpio_setup(void) | ||
90 | { | ||
91 | return gpiochip_add(&iop3xx_chip); | ||
92 | } | ||
93 | arch_initcall(iop3xx_gpio_setup); | ||