diff options
Diffstat (limited to 'arch/arm')
57 files changed, 284 insertions, 263 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index db3c5414223e..1c1fbbf6e4ae 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -376,7 +376,6 @@ config ARCH_AT91 | |||
376 | select ARCH_REQUIRE_GPIOLIB | 376 | select ARCH_REQUIRE_GPIOLIB |
377 | select CLKDEV_LOOKUP | 377 | select CLKDEV_LOOKUP |
378 | select IRQ_DOMAIN | 378 | select IRQ_DOMAIN |
379 | select NEED_MACH_GPIO_H | ||
380 | select NEED_MACH_IO_H if PCCARD | 379 | select NEED_MACH_IO_H if PCCARD |
381 | select PINCTRL | 380 | select PINCTRL |
382 | select PINCTRL_AT91 if USE_OF | 381 | select PINCTRL_AT91 if USE_OF |
diff --git a/arch/arm/boot/dts/at91-cosino_mega2560.dts b/arch/arm/boot/dts/at91-cosino_mega2560.dts index a542d5837a17..27ebb0f722fd 100644 --- a/arch/arm/boot/dts/at91-cosino_mega2560.dts +++ b/arch/arm/boot/dts/at91-cosino_mega2560.dts | |||
@@ -32,11 +32,6 @@ | |||
32 | status = "okay"; | 32 | status = "okay"; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | |||
36 | tsadcc: tsadcc@f804c000 { | ||
37 | status = "okay"; | ||
38 | }; | ||
39 | |||
40 | rtc@fffffeb0 { | 35 | rtc@fffffeb0 { |
41 | status = "okay"; | 36 | status = "okay"; |
42 | }; | 37 | }; |
diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts index 4537259ce529..099111bd4221 100644 --- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts +++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts | |||
@@ -21,6 +21,14 @@ | |||
21 | reg = <0x20000000 0x10000000>; | 21 | reg = <0x20000000 0x10000000>; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | slow_xtal { | ||
25 | clock-frequency = <32768>; | ||
26 | }; | ||
27 | |||
28 | main_xtal { | ||
29 | clock-frequency = <12000000>; | ||
30 | }; | ||
31 | |||
24 | ahb { | 32 | ahb { |
25 | apb { | 33 | apb { |
26 | mmc0: mmc@f0000000 { | 34 | mmc0: mmc@f0000000 { |
diff --git a/arch/arm/boot/dts/at91sam9261.dtsi b/arch/arm/boot/dts/at91sam9261.dtsi index 3be973e9889a..80cdcecf0332 100644 --- a/arch/arm/boot/dts/at91sam9261.dtsi +++ b/arch/arm/boot/dts/at91sam9261.dtsi | |||
@@ -45,6 +45,18 @@ | |||
45 | reg = <0x20000000 0x08000000>; | 45 | reg = <0x20000000 0x08000000>; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | main_xtal: main_xtal { | ||
49 | compatible = "fixed-clock"; | ||
50 | #clock-cells = <0>; | ||
51 | clock-frequency = <0>; | ||
52 | }; | ||
53 | |||
54 | slow_xtal: slow_xtal { | ||
55 | compatible = "fixed-clock"; | ||
56 | #clock-cells = <0>; | ||
57 | clock-frequency = <0>; | ||
58 | }; | ||
59 | |||
48 | ahb { | 60 | ahb { |
49 | compatible = "simple-bus"; | 61 | compatible = "simple-bus"; |
50 | #address-cells = <1>; | 62 | #address-cells = <1>; |
@@ -524,17 +536,24 @@ | |||
524 | #size-cells = <0>; | 536 | #size-cells = <0>; |
525 | #interrupt-cells = <1>; | 537 | #interrupt-cells = <1>; |
526 | 538 | ||
527 | clk32k: slck { | 539 | slow_rc_osc: slow_rc_osc { |
528 | compatible = "fixed-clock"; | 540 | compatible = "fixed-clock"; |
529 | #clock-cells = <0>; | 541 | #clock-cells = <0>; |
530 | clock-frequency = <32768>; | 542 | clock-frequency = <32768>; |
543 | clock-accuracy = <50000000>; | ||
544 | }; | ||
545 | |||
546 | clk32k: slck { | ||
547 | compatible = "atmel,at91sam9260-clk-slow"; | ||
548 | #clock-cells = <0>; | ||
549 | clocks = <&slow_rc_osc &slow_xtal>; | ||
531 | }; | 550 | }; |
532 | 551 | ||
533 | main: mainck { | 552 | main: mainck { |
534 | compatible = "atmel,at91rm9200-clk-main"; | 553 | compatible = "atmel,at91rm9200-clk-main"; |
535 | #clock-cells = <0>; | 554 | #clock-cells = <0>; |
536 | interrupts-extended = <&pmc AT91_PMC_MOSCS>; | 555 | interrupts-extended = <&pmc AT91_PMC_MOSCS>; |
537 | clocks = <&clk32k>; | 556 | clocks = <&main_xtal>; |
538 | }; | 557 | }; |
539 | 558 | ||
540 | plla: pllack { | 559 | plla: pllack { |
diff --git a/arch/arm/boot/dts/at91sam9261ek.dts b/arch/arm/boot/dts/at91sam9261ek.dts index 2ce527e70c7a..c6683ea8b743 100644 --- a/arch/arm/boot/dts/at91sam9261ek.dts +++ b/arch/arm/boot/dts/at91sam9261ek.dts | |||
@@ -20,6 +20,10 @@ | |||
20 | reg = <0x20000000 0x4000000>; | 20 | reg = <0x20000000 0x4000000>; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | main_xtal { | ||
24 | clock-frequency = <18432000>; | ||
25 | }; | ||
26 | |||
23 | clocks { | 27 | clocks { |
24 | #address-cells = <1>; | 28 | #address-cells = <1>; |
25 | #size-cells = <1>; | 29 | #size-cells = <1>; |
diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi index 92a52faebef7..ae9c39a28c63 100644 --- a/arch/arm/boot/dts/at91sam9rl.dtsi +++ b/arch/arm/boot/dts/at91sam9rl.dtsi | |||
@@ -48,6 +48,18 @@ | |||
48 | reg = <0x20000000 0x04000000>; | 48 | reg = <0x20000000 0x04000000>; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | slow_xtal: slow_xtal { | ||
52 | compatible = "fixed-clock"; | ||
53 | #clock-cells = <0>; | ||
54 | clock-frequency = <0>; | ||
55 | }; | ||
56 | |||
57 | main_xtal: main_xtal { | ||
58 | compatible = "fixed-clock"; | ||
59 | #clock-cells = <0>; | ||
60 | clock-frequency = <0>; | ||
61 | }; | ||
62 | |||
51 | ahb { | 63 | ahb { |
52 | compatible = "simple-bus"; | 64 | compatible = "simple-bus"; |
53 | #address-cells = <1>; | 65 | #address-cells = <1>; |
@@ -548,17 +560,11 @@ | |||
548 | #size-cells = <0>; | 560 | #size-cells = <0>; |
549 | #interrupt-cells = <1>; | 561 | #interrupt-cells = <1>; |
550 | 562 | ||
551 | clk32k: slck { | ||
552 | compatible = "fixed-clock"; | ||
553 | #clock-cells = <0>; | ||
554 | clock-frequency = <32768>; | ||
555 | }; | ||
556 | |||
557 | main: mainck { | 563 | main: mainck { |
558 | compatible = "atmel,at91rm9200-clk-main"; | 564 | compatible = "atmel,at91rm9200-clk-main"; |
559 | #clock-cells = <0>; | 565 | #clock-cells = <0>; |
560 | interrupts-extended = <&pmc AT91_PMC_MOSCS>; | 566 | interrupts-extended = <&pmc AT91_PMC_MOSCS>; |
561 | clocks = <&clk32k>; | 567 | clocks = <&main_xtal>; |
562 | }; | 568 | }; |
563 | 569 | ||
564 | plla: pllack { | 570 | plla: pllack { |
@@ -769,6 +775,32 @@ | |||
769 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; | 775 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; |
770 | status = "disabled"; | 776 | status = "disabled"; |
771 | }; | 777 | }; |
778 | |||
779 | sckc@fffffd50 { | ||
780 | compatible = "atmel,at91sam9x5-sckc"; | ||
781 | reg = <0xfffffd50 0x4>; | ||
782 | |||
783 | slow_osc: slow_osc { | ||
784 | compatible = "atmel,at91sam9x5-clk-slow-osc"; | ||
785 | #clock-cells = <0>; | ||
786 | atmel,startup-time-usec = <1200000>; | ||
787 | clocks = <&slow_xtal>; | ||
788 | }; | ||
789 | |||
790 | slow_rc_osc: slow_rc_osc { | ||
791 | compatible = "atmel,at91sam9x5-clk-slow-rc-osc"; | ||
792 | #clock-cells = <0>; | ||
793 | atmel,startup-time-usec = <75>; | ||
794 | clock-frequency = <32768>; | ||
795 | clock-accuracy = <50000000>; | ||
796 | }; | ||
797 | |||
798 | clk32k: slck { | ||
799 | compatible = "atmel,at91sam9x5-clk-slow"; | ||
800 | #clock-cells = <0>; | ||
801 | clocks = <&slow_rc_osc &slow_osc>; | ||
802 | }; | ||
803 | }; | ||
772 | }; | 804 | }; |
773 | }; | 805 | }; |
774 | 806 | ||
diff --git a/arch/arm/boot/dts/at91sam9rlek.dts b/arch/arm/boot/dts/at91sam9rlek.dts index cddb37825fad..b3b89baf972e 100644 --- a/arch/arm/boot/dts/at91sam9rlek.dts +++ b/arch/arm/boot/dts/at91sam9rlek.dts | |||
@@ -20,6 +20,15 @@ | |||
20 | reg = <0x20000000 0x4000000>; | 20 | reg = <0x20000000 0x4000000>; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | |||
24 | slow_xtal { | ||
25 | clock-frequency = <32768>; | ||
26 | }; | ||
27 | |||
28 | main_xtal { | ||
29 | clock-frequency = <12000000>; | ||
30 | }; | ||
31 | |||
23 | clocks { | 32 | clocks { |
24 | #address-cells = <1>; | 33 | #address-cells = <1>; |
25 | #size-cells = <1>; | 34 | #size-cells = <1>; |
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index a106b0872910..3f260b9cd51f 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi | |||
@@ -58,6 +58,18 @@ | |||
58 | reg = <0x20000000 0x8000000>; | 58 | reg = <0x20000000 0x8000000>; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | slow_xtal: slow_xtal { | ||
62 | compatible = "fixed-clock"; | ||
63 | #clock-cells = <0>; | ||
64 | clock-frequency = <0>; | ||
65 | }; | ||
66 | |||
67 | main_xtal: main_xtal { | ||
68 | compatible = "fixed-clock"; | ||
69 | #clock-cells = <0>; | ||
70 | clock-frequency = <0>; | ||
71 | }; | ||
72 | |||
61 | clocks { | 73 | clocks { |
62 | adc_op_clk: adc_op_clk{ | 74 | adc_op_clk: adc_op_clk{ |
63 | compatible = "fixed-clock"; | 75 | compatible = "fixed-clock"; |
@@ -749,18 +761,29 @@ | |||
749 | #size-cells = <0>; | 761 | #size-cells = <0>; |
750 | #interrupt-cells = <1>; | 762 | #interrupt-cells = <1>; |
751 | 763 | ||
752 | clk32k: slck { | 764 | main_rc_osc: main_rc_osc { |
753 | compatible = "fixed-clock"; | 765 | compatible = "atmel,at91sam9x5-clk-main-rc-osc"; |
754 | #clock-cells = <0>; | 766 | #clock-cells = <0>; |
755 | clock-frequency = <32768>; | 767 | interrupt-parent = <&pmc>; |
768 | interrupts = <AT91_PMC_MOSCRCS>; | ||
769 | clock-frequency = <12000000>; | ||
770 | clock-accuracy = <50000000>; | ||
756 | }; | 771 | }; |
757 | 772 | ||
758 | main: mainck { | 773 | main_osc: main_osc { |
759 | compatible = "atmel,at91rm9200-clk-main"; | 774 | compatible = "atmel,at91rm9200-clk-main-osc"; |
760 | #clock-cells = <0>; | 775 | #clock-cells = <0>; |
761 | interrupt-parent = <&pmc>; | 776 | interrupt-parent = <&pmc>; |
762 | interrupts = <AT91_PMC_MOSCS>; | 777 | interrupts = <AT91_PMC_MOSCS>; |
763 | clocks = <&clk32k>; | 778 | clocks = <&main_xtal>; |
779 | }; | ||
780 | |||
781 | main: mainck { | ||
782 | compatible = "atmel,at91sam9x5-clk-main"; | ||
783 | #clock-cells = <0>; | ||
784 | interrupt-parent = <&pmc>; | ||
785 | interrupts = <AT91_PMC_MOSCSELS>; | ||
786 | clocks = <&main_rc_osc &main_osc>; | ||
764 | }; | 787 | }; |
765 | 788 | ||
766 | plla: pllack { | 789 | plla: pllack { |
@@ -1089,6 +1112,32 @@ | |||
1089 | status = "disabled"; | 1112 | status = "disabled"; |
1090 | }; | 1113 | }; |
1091 | 1114 | ||
1115 | sckc@fffffe50 { | ||
1116 | compatible = "atmel,at91sam9x5-sckc"; | ||
1117 | reg = <0xfffffe50 0x4>; | ||
1118 | |||
1119 | slow_rc_osc: slow_rc_osc { | ||
1120 | compatible = "atmel,at91sam9x5-clk-slow-rc-osc"; | ||
1121 | #clock-cells = <0>; | ||
1122 | clock-frequency = <32768>; | ||
1123 | clock-accuracy = <50000000>; | ||
1124 | atmel,startup-time-usec = <75>; | ||
1125 | }; | ||
1126 | |||
1127 | slow_osc: slow_osc { | ||
1128 | compatible = "atmel,at91sam9x5-clk-slow-osc"; | ||
1129 | #clock-cells = <0>; | ||
1130 | clocks = <&slow_xtal>; | ||
1131 | atmel,startup-time-usec = <1200000>; | ||
1132 | }; | ||
1133 | |||
1134 | clk32k: slowck { | ||
1135 | compatible = "atmel,at91sam9x5-clk-slow"; | ||
1136 | #clock-cells = <0>; | ||
1137 | clocks = <&slow_rc_osc &slow_osc>; | ||
1138 | }; | ||
1139 | }; | ||
1140 | |||
1092 | rtc@fffffeb0 { | 1141 | rtc@fffffeb0 { |
1093 | compatible = "atmel,at91rm9200-rtc"; | 1142 | compatible = "atmel,at91rm9200-rtc"; |
1094 | reg = <0xfffffeb0 0x30>; | 1143 | reg = <0xfffffeb0 0x30>; |
diff --git a/arch/arm/boot/dts/sama5d3xcm.dtsi b/arch/arm/boot/dts/sama5d3xcm.dtsi index f55ed072c8e6..b0b1331c1974 100644 --- a/arch/arm/boot/dts/sama5d3xcm.dtsi +++ b/arch/arm/boot/dts/sama5d3xcm.dtsi | |||
@@ -18,6 +18,14 @@ | |||
18 | reg = <0x20000000 0x20000000>; | 18 | reg = <0x20000000 0x20000000>; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | slow_xtal { | ||
22 | clock-frequency = <32768>; | ||
23 | }; | ||
24 | |||
25 | main_xtal { | ||
26 | clock-frequency = <12000000>; | ||
27 | }; | ||
28 | |||
21 | ahb { | 29 | ahb { |
22 | apb { | 30 | apb { |
23 | spi0: spi@f0004000 { | 31 | spi0: spi@f0004000 { |
diff --git a/arch/arm/configs/at91sam9g45_defconfig b/arch/arm/configs/at91sam9g45_defconfig index e181a50fd65a..c6661a60025d 100644 --- a/arch/arm/configs/at91sam9g45_defconfig +++ b/arch/arm/configs/at91sam9g45_defconfig | |||
@@ -83,7 +83,6 @@ CONFIG_KEYBOARD_GPIO=y | |||
83 | # CONFIG_INPUT_MOUSE is not set | 83 | # CONFIG_INPUT_MOUSE is not set |
84 | CONFIG_INPUT_TOUCHSCREEN=y | 84 | CONFIG_INPUT_TOUCHSCREEN=y |
85 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m | 85 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m |
86 | CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y | ||
87 | # CONFIG_SERIO is not set | 86 | # CONFIG_SERIO is not set |
88 | # CONFIG_LEGACY_PTYS is not set | 87 | # CONFIG_LEGACY_PTYS is not set |
89 | CONFIG_SERIAL_ATMEL=y | 88 | CONFIG_SERIAL_ATMEL=y |
@@ -146,6 +145,8 @@ CONFIG_DMADEVICES=y | |||
146 | CONFIG_AT_HDMAC=y | 145 | CONFIG_AT_HDMAC=y |
147 | CONFIG_DMATEST=m | 146 | CONFIG_DMATEST=m |
148 | # CONFIG_IOMMU_SUPPORT is not set | 147 | # CONFIG_IOMMU_SUPPORT is not set |
148 | CONFIG_IIO=y | ||
149 | CONFIG_AT91_ADC=y | ||
149 | CONFIG_EXT4_FS=y | 150 | CONFIG_EXT4_FS=y |
150 | CONFIG_FANOTIFY=y | 151 | CONFIG_FANOTIFY=y |
151 | CONFIG_VFAT_FS=y | 152 | CONFIG_VFAT_FS=y |
diff --git a/arch/arm/configs/at91sam9rl_defconfig b/arch/arm/configs/at91sam9rl_defconfig index 85f846ae9ff2..5d7797d43d23 100644 --- a/arch/arm/configs/at91sam9rl_defconfig +++ b/arch/arm/configs/at91sam9rl_defconfig | |||
@@ -45,7 +45,6 @@ CONFIG_INPUT_EVDEV=y | |||
45 | # CONFIG_INPUT_KEYBOARD is not set | 45 | # CONFIG_INPUT_KEYBOARD is not set |
46 | # CONFIG_INPUT_MOUSE is not set | 46 | # CONFIG_INPUT_MOUSE is not set |
47 | CONFIG_INPUT_TOUCHSCREEN=y | 47 | CONFIG_INPUT_TOUCHSCREEN=y |
48 | CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y | ||
49 | # CONFIG_SERIO is not set | 48 | # CONFIG_SERIO is not set |
50 | CONFIG_SERIAL_ATMEL=y | 49 | CONFIG_SERIAL_ATMEL=y |
51 | CONFIG_SERIAL_ATMEL_CONSOLE=y | 50 | CONFIG_SERIAL_ATMEL_CONSOLE=y |
@@ -65,6 +64,8 @@ CONFIG_MMC=y | |||
65 | CONFIG_MMC_ATMELMCI=m | 64 | CONFIG_MMC_ATMELMCI=m |
66 | CONFIG_RTC_CLASS=y | 65 | CONFIG_RTC_CLASS=y |
67 | CONFIG_RTC_DRV_AT91SAM9=y | 66 | CONFIG_RTC_DRV_AT91SAM9=y |
67 | CONFIG_IIO=y | ||
68 | CONFIG_AT91_ADC=y | ||
68 | CONFIG_EXT2_FS=y | 69 | CONFIG_EXT2_FS=y |
69 | CONFIG_MSDOS_FS=y | 70 | CONFIG_MSDOS_FS=y |
70 | CONFIG_VFAT_FS=y | 71 | CONFIG_VFAT_FS=y |
diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig index dc3881e07630..869fa18ebeb2 100644 --- a/arch/arm/configs/sama5_defconfig +++ b/arch/arm/configs/sama5_defconfig | |||
@@ -122,7 +122,6 @@ CONFIG_KEYBOARD_GPIO=y | |||
122 | # CONFIG_INPUT_MOUSE is not set | 122 | # CONFIG_INPUT_MOUSE is not set |
123 | CONFIG_INPUT_TOUCHSCREEN=y | 123 | CONFIG_INPUT_TOUCHSCREEN=y |
124 | CONFIG_TOUCHSCREEN_ATMEL_MXT=y | 124 | CONFIG_TOUCHSCREEN_ATMEL_MXT=y |
125 | CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y | ||
126 | # CONFIG_SERIO is not set | 125 | # CONFIG_SERIO is not set |
127 | CONFIG_LEGACY_PTY_COUNT=4 | 126 | CONFIG_LEGACY_PTY_COUNT=4 |
128 | CONFIG_SERIAL_ATMEL=y | 127 | CONFIG_SERIAL_ATMEL=y |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index f3f19f21352a..4860918b411e 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include "board.h" | 26 | #include "board.h" |
27 | #include "generic.h" | 27 | #include "generic.h" |
28 | #include "gpio.h" | ||
28 | 29 | ||
29 | 30 | ||
30 | /* -------------------------------------------------------------------- | 31 | /* -------------------------------------------------------------------- |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index a0282928e9c1..14a6e35801ff 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -24,12 +24,11 @@ | |||
24 | #include <mach/at91sam9260_matrix.h> | 24 | #include <mach/at91sam9260_matrix.h> |
25 | #include <mach/at91_matrix.h> | 25 | #include <mach/at91_matrix.h> |
26 | #include <mach/at91sam9_smc.h> | 26 | #include <mach/at91sam9_smc.h> |
27 | #include <mach/at91_adc.h> | ||
28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
29 | 28 | ||
30 | #include "board.h" | 29 | #include "board.h" |
31 | #include "generic.h" | 30 | #include "generic.h" |
32 | 31 | #include "gpio.h" | |
33 | 32 | ||
34 | /* -------------------------------------------------------------------- | 33 | /* -------------------------------------------------------------------- |
35 | * USB Host | 34 | * USB Host |
@@ -1325,13 +1324,6 @@ static struct at91_adc_trigger at91_adc_triggers[] = { | |||
1325 | }, | 1324 | }, |
1326 | }; | 1325 | }; |
1327 | 1326 | ||
1328 | static struct at91_adc_reg_desc at91_adc_register_g20 = { | ||
1329 | .channel_base = AT91_ADC_CHR(0), | ||
1330 | .drdy_mask = AT91_ADC_DRDY, | ||
1331 | .status_register = AT91_ADC_SR, | ||
1332 | .trigger_register = AT91_ADC_MR, | ||
1333 | }; | ||
1334 | |||
1335 | void __init at91_add_device_adc(struct at91_adc_data *data) | 1327 | void __init at91_add_device_adc(struct at91_adc_data *data) |
1336 | { | 1328 | { |
1337 | if (!data) | 1329 | if (!data) |
@@ -1349,9 +1341,7 @@ void __init at91_add_device_adc(struct at91_adc_data *data) | |||
1349 | if (data->use_external_triggers) | 1341 | if (data->use_external_triggers) |
1350 | at91_set_A_periph(AT91_PIN_PA22, 0); | 1342 | at91_set_A_periph(AT91_PIN_PA22, 0); |
1351 | 1343 | ||
1352 | data->num_channels = 4; | ||
1353 | data->startup_time = 10; | 1344 | data->startup_time = 10; |
1354 | data->registers = &at91_adc_register_g20; | ||
1355 | data->trigger_number = 4; | 1345 | data->trigger_number = 4; |
1356 | data->trigger_list = at91_adc_triggers; | 1346 | data->trigger_list = at91_adc_triggers; |
1357 | 1347 | ||
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 80e35895d28f..43b21f456f6e 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #include "board.h" | 30 | #include "board.h" |
31 | #include "generic.h" | 31 | #include "generic.h" |
32 | 32 | #include "gpio.h" | |
33 | 33 | ||
34 | /* -------------------------------------------------------------------- | 34 | /* -------------------------------------------------------------------- |
35 | * USB Host | 35 | * USB Host |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 43d53d6156dd..953616e5dbcb 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include "board.h" | 29 | #include "board.h" |
30 | #include "generic.h" | 30 | #include "generic.h" |
31 | #include "gpio.h" | ||
31 | 32 | ||
32 | 33 | ||
33 | /* -------------------------------------------------------------------- | 34 | /* -------------------------------------------------------------------- |
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index 5e6f498db0a8..9d3d544ac19c 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c | |||
@@ -182,7 +182,7 @@ static struct clk vdec_clk = { | |||
182 | static struct clk adc_op_clk = { | 182 | static struct clk adc_op_clk = { |
183 | .name = "adc_op_clk", | 183 | .name = "adc_op_clk", |
184 | .type = CLK_TYPE_PERIPHERAL, | 184 | .type = CLK_TYPE_PERIPHERAL, |
185 | .rate_hz = 13200000, | 185 | .rate_hz = 300000, |
186 | }; | 186 | }; |
187 | 187 | ||
188 | /* AES/TDES/SHA clock - Only for sam9m11/sam9g56 */ | 188 | /* AES/TDES/SHA clock - Only for sam9m11/sam9g56 */ |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index dab362c06487..d943363c1845 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/fb.h> | 25 | #include <linux/fb.h> |
26 | #include <video/atmel_lcdc.h> | 26 | #include <video/atmel_lcdc.h> |
27 | 27 | ||
28 | #include <mach/at91_adc.h> | ||
29 | #include <mach/at91sam9g45.h> | 28 | #include <mach/at91sam9g45.h> |
30 | #include <mach/at91sam9g45_matrix.h> | 29 | #include <mach/at91sam9g45_matrix.h> |
31 | #include <mach/at91_matrix.h> | 30 | #include <mach/at91_matrix.h> |
@@ -39,6 +38,7 @@ | |||
39 | #include "board.h" | 38 | #include "board.h" |
40 | #include "generic.h" | 39 | #include "generic.h" |
41 | #include "clock.h" | 40 | #include "clock.h" |
41 | #include "gpio.h" | ||
42 | 42 | ||
43 | 43 | ||
44 | /* -------------------------------------------------------------------- | 44 | /* -------------------------------------------------------------------- |
@@ -1133,58 +1133,7 @@ static void __init at91_add_device_rtc(void) {} | |||
1133 | 1133 | ||
1134 | 1134 | ||
1135 | /* -------------------------------------------------------------------- | 1135 | /* -------------------------------------------------------------------- |
1136 | * Touchscreen | 1136 | * ADC and touchscreen |
1137 | * -------------------------------------------------------------------- */ | ||
1138 | |||
1139 | #if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE) | ||
1140 | static u64 tsadcc_dmamask = DMA_BIT_MASK(32); | ||
1141 | static struct at91_tsadcc_data tsadcc_data; | ||
1142 | |||
1143 | static struct resource tsadcc_resources[] = { | ||
1144 | [0] = { | ||
1145 | .start = AT91SAM9G45_BASE_TSC, | ||
1146 | .end = AT91SAM9G45_BASE_TSC + SZ_16K - 1, | ||
1147 | .flags = IORESOURCE_MEM, | ||
1148 | }, | ||
1149 | [1] = { | ||
1150 | .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC, | ||
1151 | .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC, | ||
1152 | .flags = IORESOURCE_IRQ, | ||
1153 | } | ||
1154 | }; | ||
1155 | |||
1156 | static struct platform_device at91sam9g45_tsadcc_device = { | ||
1157 | .name = "atmel_tsadcc", | ||
1158 | .id = -1, | ||
1159 | .dev = { | ||
1160 | .dma_mask = &tsadcc_dmamask, | ||
1161 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1162 | .platform_data = &tsadcc_data, | ||
1163 | }, | ||
1164 | .resource = tsadcc_resources, | ||
1165 | .num_resources = ARRAY_SIZE(tsadcc_resources), | ||
1166 | }; | ||
1167 | |||
1168 | void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) | ||
1169 | { | ||
1170 | if (!data) | ||
1171 | return; | ||
1172 | |||
1173 | at91_set_gpio_input(AT91_PIN_PD20, 0); /* AD0_XR */ | ||
1174 | at91_set_gpio_input(AT91_PIN_PD21, 0); /* AD1_XL */ | ||
1175 | at91_set_gpio_input(AT91_PIN_PD22, 0); /* AD2_YT */ | ||
1176 | at91_set_gpio_input(AT91_PIN_PD23, 0); /* AD3_TB */ | ||
1177 | |||
1178 | tsadcc_data = *data; | ||
1179 | platform_device_register(&at91sam9g45_tsadcc_device); | ||
1180 | } | ||
1181 | #else | ||
1182 | void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {} | ||
1183 | #endif | ||
1184 | |||
1185 | |||
1186 | /* -------------------------------------------------------------------- | ||
1187 | * ADC | ||
1188 | * -------------------------------------------------------------------- */ | 1137 | * -------------------------------------------------------------------- */ |
1189 | 1138 | ||
1190 | #if IS_ENABLED(CONFIG_AT91_ADC) | 1139 | #if IS_ENABLED(CONFIG_AT91_ADC) |
@@ -1236,13 +1185,6 @@ static struct at91_adc_trigger at91_adc_triggers[] = { | |||
1236 | }, | 1185 | }, |
1237 | }; | 1186 | }; |
1238 | 1187 | ||
1239 | static struct at91_adc_reg_desc at91_adc_register_g45 = { | ||
1240 | .channel_base = AT91_ADC_CHR(0), | ||
1241 | .drdy_mask = AT91_ADC_DRDY, | ||
1242 | .status_register = AT91_ADC_SR, | ||
1243 | .trigger_register = 0x08, | ||
1244 | }; | ||
1245 | |||
1246 | void __init at91_add_device_adc(struct at91_adc_data *data) | 1188 | void __init at91_add_device_adc(struct at91_adc_data *data) |
1247 | { | 1189 | { |
1248 | if (!data) | 1190 | if (!data) |
@@ -1268,9 +1210,7 @@ void __init at91_add_device_adc(struct at91_adc_data *data) | |||
1268 | if (data->use_external_triggers) | 1210 | if (data->use_external_triggers) |
1269 | at91_set_A_periph(AT91_PIN_PD28, 0); | 1211 | at91_set_A_periph(AT91_PIN_PD28, 0); |
1270 | 1212 | ||
1271 | data->num_channels = 8; | ||
1272 | data->startup_time = 40; | 1213 | data->startup_time = 40; |
1273 | data->registers = &at91_adc_register_g45; | ||
1274 | data->trigger_number = 4; | 1214 | data->trigger_number = 4; |
1275 | data->trigger_list = at91_adc_triggers; | 1215 | data->trigger_list = at91_adc_triggers; |
1276 | 1216 | ||
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c index 57f12d86c0e6..a79960f57e6a 100644 --- a/arch/arm/mach-at91/at91sam9rl.c +++ b/arch/arm/mach-at91/at91sam9rl.c | |||
@@ -153,6 +153,11 @@ static struct clk ac97_clk = { | |||
153 | .pmc_mask = 1 << AT91SAM9RL_ID_AC97C, | 153 | .pmc_mask = 1 << AT91SAM9RL_ID_AC97C, |
154 | .type = CLK_TYPE_PERIPHERAL, | 154 | .type = CLK_TYPE_PERIPHERAL, |
155 | }; | 155 | }; |
156 | static struct clk adc_op_clk = { | ||
157 | .name = "adc_op_clk", | ||
158 | .type = CLK_TYPE_PERIPHERAL, | ||
159 | .rate_hz = 1000000, | ||
160 | }; | ||
156 | 161 | ||
157 | static struct clk *periph_clocks[] __initdata = { | 162 | static struct clk *periph_clocks[] __initdata = { |
158 | &pioA_clk, | 163 | &pioA_clk, |
@@ -178,6 +183,7 @@ static struct clk *periph_clocks[] __initdata = { | |||
178 | &udphs_clk, | 183 | &udphs_clk, |
179 | &lcdc_clk, | 184 | &lcdc_clk, |
180 | &ac97_clk, | 185 | &ac97_clk, |
186 | &adc_op_clk, | ||
181 | // irq0 | 187 | // irq0 |
182 | }; | 188 | }; |
183 | 189 | ||
@@ -216,6 +222,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
216 | CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk), | 222 | CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk), |
217 | CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk), | 223 | CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk), |
218 | CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioD_clk), | 224 | CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioD_clk), |
225 | CLKDEV_CON_ID("adc_clk", &tsc_clk), | ||
219 | }; | 226 | }; |
220 | 227 | ||
221 | static struct clk_lookup usart_clocks_lookups[] = { | 228 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 428fc412aaf1..044ad8bc6963 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -23,9 +23,11 @@ | |||
23 | #include <mach/at91sam9_smc.h> | 23 | #include <mach/at91sam9_smc.h> |
24 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
25 | #include <linux/platform_data/dma-atmel.h> | 25 | #include <linux/platform_data/dma-atmel.h> |
26 | #include <linux/platform_data/at91_adc.h> | ||
26 | 27 | ||
27 | #include "board.h" | 28 | #include "board.h" |
28 | #include "generic.h" | 29 | #include "generic.h" |
30 | #include "gpio.h" | ||
29 | 31 | ||
30 | 32 | ||
31 | /* -------------------------------------------------------------------- | 33 | /* -------------------------------------------------------------------- |
@@ -608,14 +610,13 @@ static void __init at91_add_device_tc(void) { } | |||
608 | 610 | ||
609 | 611 | ||
610 | /* -------------------------------------------------------------------- | 612 | /* -------------------------------------------------------------------- |
611 | * Touchscreen | 613 | * ADC and Touchscreen |
612 | * -------------------------------------------------------------------- */ | 614 | * -------------------------------------------------------------------- */ |
613 | 615 | ||
614 | #if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE) | 616 | #if IS_ENABLED(CONFIG_AT91_ADC) |
615 | static u64 tsadcc_dmamask = DMA_BIT_MASK(32); | 617 | static struct at91_adc_data adc_data; |
616 | static struct at91_tsadcc_data tsadcc_data; | ||
617 | 618 | ||
618 | static struct resource tsadcc_resources[] = { | 619 | static struct resource adc_resources[] = { |
619 | [0] = { | 620 | [0] = { |
620 | .start = AT91SAM9RL_BASE_TSC, | 621 | .start = AT91SAM9RL_BASE_TSC, |
621 | .end = AT91SAM9RL_BASE_TSC + SZ_16K - 1, | 622 | .end = AT91SAM9RL_BASE_TSC + SZ_16K - 1, |
@@ -628,36 +629,71 @@ static struct resource tsadcc_resources[] = { | |||
628 | } | 629 | } |
629 | }; | 630 | }; |
630 | 631 | ||
631 | static struct platform_device at91sam9rl_tsadcc_device = { | 632 | static struct platform_device at91_adc_device = { |
632 | .name = "atmel_tsadcc", | 633 | .name = "at91sam9rl-adc", |
633 | .id = -1, | 634 | .id = -1, |
634 | .dev = { | 635 | .dev = { |
635 | .dma_mask = &tsadcc_dmamask, | 636 | .platform_data = &adc_data, |
636 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
637 | .platform_data = &tsadcc_data, | ||
638 | }, | 637 | }, |
639 | .resource = tsadcc_resources, | 638 | .resource = adc_resources, |
640 | .num_resources = ARRAY_SIZE(tsadcc_resources), | 639 | .num_resources = ARRAY_SIZE(adc_resources), |
641 | }; | 640 | }; |
642 | 641 | ||
643 | void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) | 642 | static struct at91_adc_trigger at91_adc_triggers[] = { |
643 | [0] = { | ||
644 | .name = "external-rising", | ||
645 | .value = 1, | ||
646 | .is_external = true, | ||
647 | }, | ||
648 | [1] = { | ||
649 | .name = "external-falling", | ||
650 | .value = 2, | ||
651 | .is_external = true, | ||
652 | }, | ||
653 | [2] = { | ||
654 | .name = "external-any", | ||
655 | .value = 3, | ||
656 | .is_external = true, | ||
657 | }, | ||
658 | [3] = { | ||
659 | .name = "continuous", | ||
660 | .value = 6, | ||
661 | .is_external = false, | ||
662 | }, | ||
663 | }; | ||
664 | |||
665 | void __init at91_add_device_adc(struct at91_adc_data *data) | ||
644 | { | 666 | { |
645 | if (!data) | 667 | if (!data) |
646 | return; | 668 | return; |
647 | 669 | ||
648 | at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */ | 670 | if (test_bit(0, &data->channels_used)) |
649 | at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */ | 671 | at91_set_A_periph(AT91_PIN_PA17, 0); |
650 | at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */ | 672 | if (test_bit(1, &data->channels_used)) |
651 | at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */ | 673 | at91_set_A_periph(AT91_PIN_PA18, 0); |
652 | 674 | if (test_bit(2, &data->channels_used)) | |
653 | tsadcc_data = *data; | 675 | at91_set_A_periph(AT91_PIN_PA19, 0); |
654 | platform_device_register(&at91sam9rl_tsadcc_device); | 676 | if (test_bit(3, &data->channels_used)) |
677 | at91_set_A_periph(AT91_PIN_PA20, 0); | ||
678 | if (test_bit(4, &data->channels_used)) | ||
679 | at91_set_A_periph(AT91_PIN_PD6, 0); | ||
680 | if (test_bit(5, &data->channels_used)) | ||
681 | at91_set_A_periph(AT91_PIN_PD7, 0); | ||
682 | |||
683 | if (data->use_external_triggers) | ||
684 | at91_set_A_periph(AT91_PIN_PB15, 0); | ||
685 | |||
686 | data->startup_time = 40; | ||
687 | data->trigger_number = 4; | ||
688 | data->trigger_list = at91_adc_triggers; | ||
689 | |||
690 | adc_data = *data; | ||
691 | platform_device_register(&at91_adc_device); | ||
655 | } | 692 | } |
656 | #else | 693 | #else |
657 | void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {} | 694 | void __init at91_add_device_adc(struct at91_adc_data *data) {} |
658 | #endif | 695 | #endif |
659 | 696 | ||
660 | |||
661 | /* -------------------------------------------------------------------- | 697 | /* -------------------------------------------------------------------- |
662 | * RTC | 698 | * RTC |
663 | * -------------------------------------------------------------------- */ | 699 | * -------------------------------------------------------------------- */ |
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c index 35ab632bbf68..3f6dbcc34022 100644 --- a/arch/arm/mach-at91/board-1arm.c +++ b/arch/arm/mach-at91/board-1arm.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include "at91_aic.h" | 39 | #include "at91_aic.h" |
40 | #include "board.h" | 40 | #include "board.h" |
41 | #include "generic.h" | 41 | #include "generic.h" |
42 | 42 | #include "gpio.h" | |
43 | 43 | ||
44 | static void __init onearm_init_early(void) | 44 | static void __init onearm_init_early(void) |
45 | { | 45 | { |
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c index f95e31cda4b3..597c649170aa 100644 --- a/arch/arm/mach-at91/board-afeb-9260v1.c +++ b/arch/arm/mach-at91/board-afeb-9260v1.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include "at91_aic.h" | 46 | #include "at91_aic.h" |
47 | #include "board.h" | 47 | #include "board.h" |
48 | #include "generic.h" | 48 | #include "generic.h" |
49 | #include "gpio.h" | ||
49 | 50 | ||
50 | 51 | ||
51 | static void __init afeb9260_init_early(void) | 52 | static void __init afeb9260_init_early(void) |
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c index 112e867c4abe..a30502c8d379 100644 --- a/arch/arm/mach-at91/board-cam60.c +++ b/arch/arm/mach-at91/board-cam60.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "board.h" | 44 | #include "board.h" |
45 | #include "sam9_smc.h" | 45 | #include "sam9_smc.h" |
46 | #include "generic.h" | 46 | #include "generic.h" |
47 | #include "gpio.h" | ||
47 | 48 | ||
48 | 49 | ||
49 | static void __init cam60_init_early(void) | 50 | static void __init cam60_init_early(void) |
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c index 92983050a9bd..47313d3ee037 100644 --- a/arch/arm/mach-at91/board-carmeva.c +++ b/arch/arm/mach-at91/board-carmeva.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "at91_aic.h" | 39 | #include "at91_aic.h" |
40 | #include "board.h" | 40 | #include "board.h" |
41 | #include "generic.h" | 41 | #include "generic.h" |
42 | #include "gpio.h" | ||
42 | 43 | ||
43 | 44 | ||
44 | static void __init carmeva_init_early(void) | 45 | static void __init carmeva_init_early(void) |
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c index 008527efdbcf..2037f78c84e7 100644 --- a/arch/arm/mach-at91/board-cpu9krea.c +++ b/arch/arm/mach-at91/board-cpu9krea.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include "board.h" | 48 | #include "board.h" |
49 | #include "sam9_smc.h" | 49 | #include "sam9_smc.h" |
50 | #include "generic.h" | 50 | #include "generic.h" |
51 | #include "gpio.h" | ||
51 | 52 | ||
52 | static void __init cpu9krea_init_early(void) | 53 | static void __init cpu9krea_init_early(void) |
53 | { | 54 | { |
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c index 42f1353a4baf..c094350c9314 100644 --- a/arch/arm/mach-at91/board-cpuat91.c +++ b/arch/arm/mach-at91/board-cpuat91.c | |||
@@ -43,6 +43,8 @@ | |||
43 | #include "at91_aic.h" | 43 | #include "at91_aic.h" |
44 | #include "board.h" | 44 | #include "board.h" |
45 | #include "generic.h" | 45 | #include "generic.h" |
46 | #include "gpio.h" | ||
47 | |||
46 | 48 | ||
47 | static struct gpio_led cpuat91_leds[] = { | 49 | static struct gpio_led cpuat91_leds[] = { |
48 | { | 50 | { |
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c index e5fde215225b..0e35a45cf8d4 100644 --- a/arch/arm/mach-at91/board-csb337.c +++ b/arch/arm/mach-at91/board-csb337.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include "at91_aic.h" | 42 | #include "at91_aic.h" |
43 | #include "board.h" | 43 | #include "board.h" |
44 | #include "generic.h" | 44 | #include "generic.h" |
45 | 45 | #include "gpio.h" | |
46 | 46 | ||
47 | static void __init csb337_init_early(void) | 47 | static void __init csb337_init_early(void) |
48 | { | 48 | { |
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c index fdf11061c577..18d027f529a8 100644 --- a/arch/arm/mach-at91/board-csb637.c +++ b/arch/arm/mach-at91/board-csb637.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "at91_aic.h" | 39 | #include "at91_aic.h" |
40 | #include "board.h" | 40 | #include "board.h" |
41 | #include "generic.h" | 41 | #include "generic.h" |
42 | #include "gpio.h" | ||
42 | 43 | ||
43 | 44 | ||
44 | static void __init csb637_init_early(void) | 45 | static void __init csb637_init_early(void) |
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c index f9be8161bbfa..aa457a8b22f5 100644 --- a/arch/arm/mach-at91/board-eb9200.c +++ b/arch/arm/mach-at91/board-eb9200.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "at91_aic.h" | 38 | #include "at91_aic.h" |
39 | #include "board.h" | 39 | #include "board.h" |
40 | #include "generic.h" | 40 | #include "generic.h" |
41 | #include "gpio.h" | ||
41 | 42 | ||
42 | 43 | ||
43 | static void __init eb9200_init_early(void) | 44 | static void __init eb9200_init_early(void) |
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c index b2fcd71262ba..ede1373ccaba 100644 --- a/arch/arm/mach-at91/board-ecbat91.c +++ b/arch/arm/mach-at91/board-ecbat91.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "at91_aic.h" | 42 | #include "at91_aic.h" |
43 | #include "board.h" | 43 | #include "board.h" |
44 | #include "generic.h" | 44 | #include "generic.h" |
45 | #include "gpio.h" | ||
45 | 46 | ||
46 | 47 | ||
47 | static void __init ecb_at91init_early(void) | 48 | static void __init ecb_at91init_early(void) |
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c index 77de410efc90..4e75321a8f2a 100644 --- a/arch/arm/mach-at91/board-eco920.c +++ b/arch/arm/mach-at91/board-eco920.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include "at91_aic.h" | 31 | #include "at91_aic.h" |
32 | #include "board.h" | 32 | #include "board.h" |
33 | #include "generic.h" | 33 | #include "generic.h" |
34 | #include "gpio.h" | ||
35 | |||
34 | 36 | ||
35 | static void __init eco920_init_early(void) | 37 | static void __init eco920_init_early(void) |
36 | { | 38 | { |
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c index 737c08563628..68f1ab6bd08f 100644 --- a/arch/arm/mach-at91/board-flexibity.c +++ b/arch/arm/mach-at91/board-flexibity.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "at91_aic.h" | 37 | #include "at91_aic.h" |
38 | #include "board.h" | 38 | #include "board.h" |
39 | #include "generic.h" | 39 | #include "generic.h" |
40 | #include "gpio.h" | ||
40 | 41 | ||
41 | static void __init flexibity_init_early(void) | 42 | static void __init flexibity_init_early(void) |
42 | { | 43 | { |
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c index c20a870ea9c9..8b22c60bb238 100644 --- a/arch/arm/mach-at91/board-foxg20.c +++ b/arch/arm/mach-at91/board-foxg20.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include "board.h" | 47 | #include "board.h" |
48 | #include "sam9_smc.h" | 48 | #include "sam9_smc.h" |
49 | #include "generic.h" | 49 | #include "generic.h" |
50 | #include "gpio.h" | ||
50 | 51 | ||
51 | /* | 52 | /* |
52 | * The FOX Board G20 hardware comes as the "Netus G20" board with | 53 | * The FOX Board G20 hardware comes as the "Netus G20" board with |
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c index 416bae8435ee..b729dd1271bf 100644 --- a/arch/arm/mach-at91/board-gsia18s.c +++ b/arch/arm/mach-at91/board-gsia18s.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "generic.h" | 39 | #include "generic.h" |
40 | #include "gsia18s.h" | 40 | #include "gsia18s.h" |
41 | #include "stamp9g20.h" | 41 | #include "stamp9g20.h" |
42 | #include "gpio.h" | ||
42 | 43 | ||
43 | static void __init gsia18s_init_early(void) | 44 | static void __init gsia18s_init_early(void) |
44 | { | 45 | { |
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c index 88e2f5d2d16d..93b1df42f639 100644 --- a/arch/arm/mach-at91/board-kafa.c +++ b/arch/arm/mach-at91/board-kafa.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "at91_aic.h" | 39 | #include "at91_aic.h" |
40 | #include "board.h" | 40 | #include "board.h" |
41 | #include "generic.h" | 41 | #include "generic.h" |
42 | #include "gpio.h" | ||
42 | 43 | ||
43 | 44 | ||
44 | static void __init kafa_init_early(void) | 45 | static void __init kafa_init_early(void) |
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c index 0c519d9ebffc..d58d36225e08 100644 --- a/arch/arm/mach-at91/board-kb9202.c +++ b/arch/arm/mach-at91/board-kb9202.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "at91_aic.h" | 42 | #include "at91_aic.h" |
43 | #include "board.h" | 43 | #include "board.h" |
44 | #include "generic.h" | 44 | #include "generic.h" |
45 | #include "gpio.h" | ||
45 | 46 | ||
46 | 47 | ||
47 | static void __init kb9202_init_early(void) | 48 | static void __init kb9202_init_early(void) |
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c index 5f25fa54eb93..b48d95ec5152 100644 --- a/arch/arm/mach-at91/board-pcontrol-g20.c +++ b/arch/arm/mach-at91/board-pcontrol-g20.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "sam9_smc.h" | 37 | #include "sam9_smc.h" |
38 | #include "generic.h" | 38 | #include "generic.h" |
39 | #include "stamp9g20.h" | 39 | #include "stamp9g20.h" |
40 | #include "gpio.h" | ||
40 | 41 | ||
41 | 42 | ||
42 | static void __init pcontrol_g20_init_early(void) | 43 | static void __init pcontrol_g20_init_early(void) |
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c index ab2b2ec36c14..2c0f2d554d84 100644 --- a/arch/arm/mach-at91/board-picotux200.c +++ b/arch/arm/mach-at91/board-picotux200.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "at91_aic.h" | 43 | #include "at91_aic.h" |
44 | #include "board.h" | 44 | #include "board.h" |
45 | #include "generic.h" | 45 | #include "generic.h" |
46 | #include "gpio.h" | ||
46 | 47 | ||
47 | 48 | ||
48 | static void __init picotux200_init_early(void) | 49 | static void __init picotux200_init_early(void) |
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c index 8b17dadc1aba..953cea416754 100644 --- a/arch/arm/mach-at91/board-rm9200ek.c +++ b/arch/arm/mach-at91/board-rm9200ek.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include "at91_aic.h" | 45 | #include "at91_aic.h" |
46 | #include "board.h" | 46 | #include "board.h" |
47 | #include "generic.h" | 47 | #include "generic.h" |
48 | #include "gpio.h" | ||
48 | 49 | ||
49 | 50 | ||
50 | static void __init ek_init_early(void) | 51 | static void __init ek_init_early(void) |
diff --git a/arch/arm/mach-at91/board-rsi-ews.c b/arch/arm/mach-at91/board-rsi-ews.c index f6d7f1958c7e..f28e8b74df4b 100644 --- a/arch/arm/mach-at91/board-rsi-ews.c +++ b/arch/arm/mach-at91/board-rsi-ews.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "at91_aic.h" | 31 | #include "at91_aic.h" |
32 | #include "board.h" | 32 | #include "board.h" |
33 | #include "generic.h" | 33 | #include "generic.h" |
34 | #include "gpio.h" | ||
34 | 35 | ||
35 | static void __init rsi_ews_init_early(void) | 36 | static void __init rsi_ews_init_early(void) |
36 | { | 37 | { |
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c index 43ee4dc43b50..d24dda67e2d3 100644 --- a/arch/arm/mach-at91/board-sam9-l9260.c +++ b/arch/arm/mach-at91/board-sam9-l9260.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "board.h" | 43 | #include "board.h" |
44 | #include "sam9_smc.h" | 44 | #include "sam9_smc.h" |
45 | #include "generic.h" | 45 | #include "generic.h" |
46 | #include "gpio.h" | ||
46 | 47 | ||
47 | 48 | ||
48 | static void __init ek_init_early(void) | 49 | static void __init ek_init_early(void) |
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c index f4f8735315da..65dea12d685e 100644 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ b/arch/arm/mach-at91/board-sam9260ek.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include "board.h" | 49 | #include "board.h" |
50 | #include "sam9_smc.h" | 50 | #include "sam9_smc.h" |
51 | #include "generic.h" | 51 | #include "generic.h" |
52 | #include "gpio.h" | ||
52 | 53 | ||
53 | 54 | ||
54 | static void __init ek_init_early(void) | 55 | static void __init ek_init_early(void) |
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 473546b9408b..4637432de08f 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include "board.h" | 53 | #include "board.h" |
54 | #include "sam9_smc.h" | 54 | #include "sam9_smc.h" |
55 | #include "generic.h" | 55 | #include "generic.h" |
56 | #include "gpio.h" | ||
56 | 57 | ||
57 | 58 | ||
58 | static void __init ek_init_early(void) | 59 | static void __init ek_init_early(void) |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 2f931915c80c..cd2726ee5add 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include "board.h" | 52 | #include "board.h" |
53 | #include "sam9_smc.h" | 53 | #include "sam9_smc.h" |
54 | #include "generic.h" | 54 | #include "generic.h" |
55 | #include "gpio.h" | ||
55 | 56 | ||
56 | 57 | ||
57 | static void __init ek_init_early(void) | 58 | static void __init ek_init_early(void) |
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c index f9cd1f2c7146..e1be6e25b380 100644 --- a/arch/arm/mach-at91/board-sam9g20ek.c +++ b/arch/arm/mach-at91/board-sam9g20ek.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include "board.h" | 50 | #include "board.h" |
51 | #include "sam9_smc.h" | 51 | #include "sam9_smc.h" |
52 | #include "generic.h" | 52 | #include "generic.h" |
53 | #include "gpio.h" | ||
53 | 54 | ||
54 | /* | 55 | /* |
55 | * board revision encoding | 56 | * board revision encoding |
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index ef39078c8ce2..1ea61328f30d 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include "board.h" | 50 | #include "board.h" |
51 | #include "sam9_smc.h" | 51 | #include "sam9_smc.h" |
52 | #include "generic.h" | 52 | #include "generic.h" |
53 | #include "gpio.h" | ||
53 | 54 | ||
54 | 55 | ||
55 | static void __init ek_init_early(void) | 56 | static void __init ek_init_early(void) |
@@ -300,21 +301,13 @@ static struct atmel_lcdfb_pdata __initdata ek_lcdc_data; | |||
300 | 301 | ||
301 | 302 | ||
302 | /* | 303 | /* |
303 | * Touchscreen | 304 | * ADCs and touchscreen |
304 | */ | ||
305 | static struct at91_tsadcc_data ek_tsadcc_data = { | ||
306 | .adc_clock = 300000, | ||
307 | .pendet_debounce = 0x0d, | ||
308 | .ts_sample_hold_time = 0x0a, | ||
309 | }; | ||
310 | |||
311 | /* | ||
312 | * ADCs | ||
313 | */ | 305 | */ |
314 | static struct at91_adc_data ek_adc_data = { | 306 | static struct at91_adc_data ek_adc_data = { |
315 | .channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7), | 307 | .channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7), |
316 | .use_external_triggers = true, | 308 | .use_external_triggers = true, |
317 | .vref = 3300, | 309 | .vref = 3300, |
310 | .touchscreen_type = ATMEL_ADC_TOUCHSCREEN_4WIRE, | ||
318 | }; | 311 | }; |
319 | 312 | ||
320 | /* | 313 | /* |
@@ -485,9 +478,7 @@ static void __init ek_board_init(void) | |||
485 | at91_add_device_isi(&isi_data, true); | 478 | at91_add_device_isi(&isi_data, true); |
486 | /* LCD Controller */ | 479 | /* LCD Controller */ |
487 | at91_add_device_lcdc(&ek_lcdc_data); | 480 | at91_add_device_lcdc(&ek_lcdc_data); |
488 | /* Touch Screen */ | 481 | /* ADC and touchscreen */ |
489 | at91_add_device_tsadcc(&ek_tsadcc_data); | ||
490 | /* ADC */ | ||
491 | at91_add_device_adc(&ek_adc_data); | 482 | at91_add_device_adc(&ek_adc_data); |
492 | /* Push Buttons */ | 483 | /* Push Buttons */ |
493 | ek_add_device_buttons(); | 484 | ek_add_device_buttons(); |
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index 604eecf6cd70..b64648b4a1fc 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/input.h> | 19 | #include <linux/input.h> |
20 | #include <linux/gpio_keys.h> | 20 | #include <linux/gpio_keys.h> |
21 | #include <linux/platform_data/at91_adc.h> | ||
21 | 22 | ||
22 | #include <video/atmel_lcdc.h> | 23 | #include <video/atmel_lcdc.h> |
23 | 24 | ||
@@ -38,6 +39,7 @@ | |||
38 | #include "board.h" | 39 | #include "board.h" |
39 | #include "sam9_smc.h" | 40 | #include "sam9_smc.h" |
40 | #include "generic.h" | 41 | #include "generic.h" |
42 | #include "gpio.h" | ||
41 | 43 | ||
42 | 44 | ||
43 | static void __init ek_init_early(void) | 45 | static void __init ek_init_early(void) |
@@ -229,12 +231,13 @@ static struct gpio_led ek_leds[] = { | |||
229 | 231 | ||
230 | 232 | ||
231 | /* | 233 | /* |
232 | * Touchscreen | 234 | * ADC + Touchscreen |
233 | */ | 235 | */ |
234 | static struct at91_tsadcc_data ek_tsadcc_data = { | 236 | static struct at91_adc_data ek_adc_data = { |
235 | .adc_clock = 1000000, | 237 | .channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5), |
236 | .pendet_debounce = 0x0f, | 238 | .use_external_triggers = true, |
237 | .ts_sample_hold_time = 0x03, | 239 | .vref = 3300, |
240 | .touchscreen_type = ATMEL_ADC_TOUCHSCREEN_4WIRE, | ||
238 | }; | 241 | }; |
239 | 242 | ||
240 | 243 | ||
@@ -310,8 +313,8 @@ static void __init ek_board_init(void) | |||
310 | at91_add_device_lcdc(&ek_lcdc_data); | 313 | at91_add_device_lcdc(&ek_lcdc_data); |
311 | /* AC97 */ | 314 | /* AC97 */ |
312 | at91_add_device_ac97(&ek_ac97_data); | 315 | at91_add_device_ac97(&ek_ac97_data); |
313 | /* Touch Screen Controller */ | 316 | /* Touch Screen Controller + ADC */ |
314 | at91_add_device_tsadcc(&ek_tsadcc_data); | 317 | at91_add_device_adc(&ek_adc_data); |
315 | /* LEDs */ | 318 | /* LEDs */ |
316 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | 319 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); |
317 | /* Push Buttons */ | 320 | /* Push Buttons */ |
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c index f1d49e929ccb..1b870e6def0c 100644 --- a/arch/arm/mach-at91/board-snapper9260.c +++ b/arch/arm/mach-at91/board-snapper9260.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "board.h" | 38 | #include "board.h" |
39 | #include "sam9_smc.h" | 39 | #include "sam9_smc.h" |
40 | #include "generic.h" | 40 | #include "generic.h" |
41 | #include "gpio.h" | ||
41 | 42 | ||
42 | #define SNAPPER9260_IO_EXP_GPIO(x) (NR_BUILTIN_GPIO + (x)) | 43 | #define SNAPPER9260_IO_EXP_GPIO(x) (NR_BUILTIN_GPIO + (x)) |
43 | 44 | ||
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c index e4a5ac17cdbc..3b575036ff96 100644 --- a/arch/arm/mach-at91/board-stamp9g20.c +++ b/arch/arm/mach-at91/board-stamp9g20.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "board.h" | 32 | #include "board.h" |
33 | #include "sam9_smc.h" | 33 | #include "sam9_smc.h" |
34 | #include "generic.h" | 34 | #include "generic.h" |
35 | #include "gpio.h" | ||
35 | 36 | ||
36 | 37 | ||
37 | void __init stamp9g20_init_early(void) | 38 | void __init stamp9g20_init_early(void) |
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c index be083771df2e..46fdb0c68a68 100644 --- a/arch/arm/mach-at91/board-yl-9200.c +++ b/arch/arm/mach-at91/board-yl-9200.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include "at91_aic.h" | 50 | #include "at91_aic.h" |
51 | #include "board.h" | 51 | #include "board.h" |
52 | #include "generic.h" | 52 | #include "generic.h" |
53 | #include "gpio.h" | ||
53 | 54 | ||
54 | 55 | ||
55 | static void __init yl9200_init_early(void) | 56 | static void __init yl9200_init_early(void) |
diff --git a/arch/arm/mach-at91/board.h b/arch/arm/mach-at91/board.h index 6c08b341167d..4e773b55bc2d 100644 --- a/arch/arm/mach-at91/board.h +++ b/arch/arm/mach-at91/board.h | |||
@@ -118,9 +118,6 @@ struct isi_platform_data; | |||
118 | extern void __init at91_add_device_isi(struct isi_platform_data *data, | 118 | extern void __init at91_add_device_isi(struct isi_platform_data *data, |
119 | bool use_pck_as_mck); | 119 | bool use_pck_as_mck); |
120 | 120 | ||
121 | /* Touchscreen Controller */ | ||
122 | extern void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data); | ||
123 | |||
124 | /* CAN */ | 121 | /* CAN */ |
125 | extern void __init at91_add_device_can(struct at91_can_data *data); | 122 | extern void __init at91_add_device_can(struct at91_can_data *data); |
126 | 123 | ||
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index a5afcf76550e..12ed05bbdc5c 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <mach/at91_pio.h> | 29 | #include <mach/at91_pio.h> |
30 | 30 | ||
31 | #include "generic.h" | 31 | #include "generic.h" |
32 | #include "gpio.h" | ||
32 | 33 | ||
33 | #define MAX_NB_GPIO_PER_BANK 32 | 34 | #define MAX_NB_GPIO_PER_BANK 32 |
34 | 35 | ||
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/gpio.h index 5fc23771c154..eed465ab0dd7 100644 --- a/arch/arm/mach-at91/include/mach/gpio.h +++ b/arch/arm/mach-at91/gpio.h | |||
@@ -209,14 +209,6 @@ extern int at91_get_gpio_value(unsigned pin); | |||
209 | extern void at91_gpio_suspend(void); | 209 | extern void at91_gpio_suspend(void); |
210 | extern void at91_gpio_resume(void); | 210 | extern void at91_gpio_resume(void); |
211 | 211 | ||
212 | #ifdef CONFIG_PINCTRL_AT91 | ||
213 | extern void at91_pinctrl_gpio_suspend(void); | ||
214 | extern void at91_pinctrl_gpio_resume(void); | ||
215 | #else | ||
216 | static inline void at91_pinctrl_gpio_suspend(void) {} | ||
217 | static inline void at91_pinctrl_gpio_resume(void) {} | ||
218 | #endif | ||
219 | |||
220 | #endif /* __ASSEMBLY__ */ | 212 | #endif /* __ASSEMBLY__ */ |
221 | 213 | ||
222 | #endif | 214 | #endif |
diff --git a/arch/arm/mach-at91/include/mach/at91_adc.h b/arch/arm/mach-at91/include/mach/at91_adc.h deleted file mode 100644 index c287307b9a3b..000000000000 --- a/arch/arm/mach-at91/include/mach/at91_adc.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/include/mach/at91_adc.h | ||
3 | * | ||
4 | * Copyright (C) SAN People | ||
5 | * | ||
6 | * Analog-to-Digital Converter (ADC) registers. | ||
7 | * Based on AT91SAM9260 datasheet revision D. | ||
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 | |||
15 | #ifndef AT91_ADC_H | ||
16 | #define AT91_ADC_H | ||
17 | |||
18 | #define AT91_ADC_CR 0x00 /* Control Register */ | ||
19 | #define AT91_ADC_SWRST (1 << 0) /* Software Reset */ | ||
20 | #define AT91_ADC_START (1 << 1) /* Start Conversion */ | ||
21 | |||
22 | #define AT91_ADC_MR 0x04 /* Mode Register */ | ||
23 | #define AT91_ADC_TRGEN (1 << 0) /* Trigger Enable */ | ||
24 | #define AT91_ADC_TRGSEL (7 << 1) /* Trigger Selection */ | ||
25 | #define AT91_ADC_TRGSEL_TC0 (0 << 1) | ||
26 | #define AT91_ADC_TRGSEL_TC1 (1 << 1) | ||
27 | #define AT91_ADC_TRGSEL_TC2 (2 << 1) | ||
28 | #define AT91_ADC_TRGSEL_EXTERNAL (6 << 1) | ||
29 | #define AT91_ADC_LOWRES (1 << 4) /* Low Resolution */ | ||
30 | #define AT91_ADC_SLEEP (1 << 5) /* Sleep Mode */ | ||
31 | #define AT91_ADC_PRESCAL_9260 (0x3f << 8) /* Prescalar Rate Selection */ | ||
32 | #define AT91_ADC_PRESCAL_9G45 (0xff << 8) | ||
33 | #define AT91_ADC_PRESCAL_(x) ((x) << 8) | ||
34 | #define AT91_ADC_STARTUP_9260 (0x1f << 16) /* Startup Up Time */ | ||
35 | #define AT91_ADC_STARTUP_9G45 (0x7f << 16) | ||
36 | #define AT91_ADC_STARTUP_9X5 (0xf << 16) | ||
37 | #define AT91_ADC_STARTUP_(x) ((x) << 16) | ||
38 | #define AT91_ADC_SHTIM (0xf << 24) /* Sample & Hold Time */ | ||
39 | #define AT91_ADC_SHTIM_(x) ((x) << 24) | ||
40 | |||
41 | #define AT91_ADC_CHER 0x10 /* Channel Enable Register */ | ||
42 | #define AT91_ADC_CHDR 0x14 /* Channel Disable Register */ | ||
43 | #define AT91_ADC_CHSR 0x18 /* Channel Status Register */ | ||
44 | #define AT91_ADC_CH(n) (1 << (n)) /* Channel Number */ | ||
45 | |||
46 | #define AT91_ADC_SR 0x1C /* Status Register */ | ||
47 | #define AT91_ADC_EOC(n) (1 << (n)) /* End of Conversion on Channel N */ | ||
48 | #define AT91_ADC_OVRE(n) (1 << ((n) + 8))/* Overrun Error on Channel N */ | ||
49 | #define AT91_ADC_DRDY (1 << 16) /* Data Ready */ | ||
50 | #define AT91_ADC_GOVRE (1 << 17) /* General Overrun Error */ | ||
51 | #define AT91_ADC_ENDRX (1 << 18) /* End of RX Buffer */ | ||
52 | #define AT91_ADC_RXFUFF (1 << 19) /* RX Buffer Full */ | ||
53 | |||
54 | #define AT91_ADC_SR_9X5 0x30 /* Status Register for 9x5 */ | ||
55 | #define AT91_ADC_SR_DRDY_9X5 (1 << 24) /* Data Ready */ | ||
56 | |||
57 | #define AT91_ADC_LCDR 0x20 /* Last Converted Data Register */ | ||
58 | #define AT91_ADC_LDATA (0x3ff) | ||
59 | |||
60 | #define AT91_ADC_IER 0x24 /* Interrupt Enable Register */ | ||
61 | #define AT91_ADC_IDR 0x28 /* Interrupt Disable Register */ | ||
62 | #define AT91_ADC_IMR 0x2C /* Interrupt Mask Register */ | ||
63 | #define AT91_ADC_IER_PEN (1 << 29) | ||
64 | #define AT91_ADC_IER_NOPEN (1 << 30) | ||
65 | #define AT91_ADC_IER_XRDY (1 << 20) | ||
66 | #define AT91_ADC_IER_YRDY (1 << 21) | ||
67 | #define AT91_ADC_IER_PRDY (1 << 22) | ||
68 | #define AT91_ADC_ISR_PENS (1 << 31) | ||
69 | |||
70 | #define AT91_ADC_CHR(n) (0x30 + ((n) * 4)) /* Channel Data Register N */ | ||
71 | #define AT91_ADC_DATA (0x3ff) | ||
72 | |||
73 | #define AT91_ADC_CDR0_9X5 (0x50) /* Channel Data Register 0 for 9X5 */ | ||
74 | |||
75 | #define AT91_ADC_ACR 0x94 /* Analog Control Register */ | ||
76 | #define AT91_ADC_ACR_PENDETSENS (0x3 << 0) /* pull-up resistor */ | ||
77 | |||
78 | #define AT91_ADC_TSMR 0xB0 | ||
79 | #define AT91_ADC_TSMR_TSMODE (3 << 0) /* Touch Screen Mode */ | ||
80 | #define AT91_ADC_TSMR_TSMODE_NONE (0 << 0) | ||
81 | #define AT91_ADC_TSMR_TSMODE_4WIRE_NO_PRESS (1 << 0) | ||
82 | #define AT91_ADC_TSMR_TSMODE_4WIRE_PRESS (2 << 0) | ||
83 | #define AT91_ADC_TSMR_TSMODE_5WIRE (3 << 0) | ||
84 | #define AT91_ADC_TSMR_TSAV (3 << 4) /* Averages samples */ | ||
85 | #define AT91_ADC_TSMR_TSAV_(x) ((x) << 4) | ||
86 | #define AT91_ADC_TSMR_SCTIM (0x0f << 16) /* Switch closure time */ | ||
87 | #define AT91_ADC_TSMR_PENDBC (0x0f << 28) /* Pen Debounce time */ | ||
88 | #define AT91_ADC_TSMR_PENDBC_(x) ((x) << 28) | ||
89 | #define AT91_ADC_TSMR_NOTSDMA (1 << 22) /* No Touchscreen DMA */ | ||
90 | #define AT91_ADC_TSMR_PENDET_DIS (0 << 24) /* Pen contact detection disable */ | ||
91 | #define AT91_ADC_TSMR_PENDET_ENA (1 << 24) /* Pen contact detection enable */ | ||
92 | |||
93 | #define AT91_ADC_TSXPOSR 0xB4 | ||
94 | #define AT91_ADC_TSYPOSR 0xB8 | ||
95 | #define AT91_ADC_TSPRESSR 0xBC | ||
96 | |||
97 | #define AT91_ADC_TRGR_9260 AT91_ADC_MR | ||
98 | #define AT91_ADC_TRGR_9G45 0x08 | ||
99 | #define AT91_ADC_TRGR_9X5 0xC0 | ||
100 | |||
101 | /* Trigger Register bit field */ | ||
102 | #define AT91_ADC_TRGR_TRGPER (0xffff << 16) | ||
103 | #define AT91_ADC_TRGR_TRGPER_(x) ((x) << 16) | ||
104 | #define AT91_ADC_TRGR_TRGMOD (0x7 << 0) | ||
105 | #define AT91_ADC_TRGR_MOD_PERIOD_TRIG (5 << 0) | ||
106 | |||
107 | #endif | ||
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h index f17aa3150019..56338245653a 100644 --- a/arch/arm/mach-at91/include/mach/hardware.h +++ b/arch/arm/mach-at91/include/mach/hardware.h | |||
@@ -104,5 +104,20 @@ | |||
104 | /* Clocks */ | 104 | /* Clocks */ |
105 | #define AT91_SLOW_CLOCK 32768 /* slow clock */ | 105 | #define AT91_SLOW_CLOCK 32768 /* slow clock */ |
106 | 106 | ||
107 | /* | ||
108 | * FIXME: this is needed to communicate between the pinctrl driver and | ||
109 | * the PM implementation in the machine. Possibly part of the PM | ||
110 | * implementation should be moved down into the pinctrl driver and get | ||
111 | * called as part of the generic suspend/resume path. | ||
112 | */ | ||
113 | #ifndef __ASSEMBLY__ | ||
114 | #ifdef CONFIG_PINCTRL_AT91 | ||
115 | extern void at91_pinctrl_gpio_suspend(void); | ||
116 | extern void at91_pinctrl_gpio_resume(void); | ||
117 | #else | ||
118 | static inline void at91_pinctrl_gpio_suspend(void) {} | ||
119 | static inline void at91_pinctrl_gpio_resume(void) {} | ||
120 | #endif | ||
121 | #endif | ||
107 | 122 | ||
108 | #endif | 123 | #endif |
diff --git a/arch/arm/mach-at91/leds.c b/arch/arm/mach-at91/leds.c index 3e22978b5547..77c4d8fd03fd 100644 --- a/arch/arm/mach-at91/leds.c +++ b/arch/arm/mach-at91/leds.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | 17 | ||
18 | #include "board.h" | 18 | #include "board.h" |
19 | #include "gpio.h" | ||
19 | 20 | ||
20 | 21 | ||
21 | /* ------------------------------------------------------------------------- */ | 22 | /* ------------------------------------------------------------------------- */ |
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 8bda1cefdf96..e95554532987 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "at91_aic.h" | 32 | #include "at91_aic.h" |
33 | #include "generic.h" | 33 | #include "generic.h" |
34 | #include "pm.h" | 34 | #include "pm.h" |
35 | #include "gpio.h" | ||
35 | 36 | ||
36 | /* | 37 | /* |
37 | * Show the reason for the previous system reset. | 38 | * Show the reason for the previous system reset. |