Commit d5cd8605 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge branch 'at91/cleanup' into next/dt

Conflicts:
	arch/arm/boot/dts/at91sam9rl.dtsi

Needed as a dependency for the at91/dt2 branch
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 21c27cab 138e8f1c
...@@ -6,6 +6,16 @@ This binding uses the common clock binding[1]. ...@@ -6,6 +6,16 @@ This binding uses the common clock binding[1].
Required properties: Required properties:
- compatible : shall be one of the following: - compatible : shall be one of the following:
"atmel,at91sam9x5-sckc":
at91 SCKC (Slow Clock Controller)
This node contains the slow clock definitions.
"atmel,at91sam9x5-clk-slow-osc":
at91 slow oscillator
"atmel,at91sam9x5-clk-slow-rc-osc":
at91 internal slow RC oscillator
"atmel,at91rm9200-pmc" or "atmel,at91rm9200-pmc" or
"atmel,at91sam9g45-pmc" or "atmel,at91sam9g45-pmc" or
"atmel,at91sam9n12-pmc" or "atmel,at91sam9n12-pmc" or
...@@ -15,8 +25,18 @@ Required properties: ...@@ -15,8 +25,18 @@ Required properties:
All at91 specific clocks (clocks defined below) must be child All at91 specific clocks (clocks defined below) must be child
node of the PMC node. node of the PMC node.
"atmel,at91sam9x5-clk-slow" (under sckc node)
or
"atmel,at91sam9260-clk-slow" (under pmc node):
at91 slow clk
"atmel,at91rm9200-clk-main-osc"
"atmel,at91sam9x5-clk-main-rc-osc"
at91 main clk sources
"atmel,at91sam9x5-clk-main"
"atmel,at91rm9200-clk-main": "atmel,at91rm9200-clk-main":
at91 main oscillator at91 main clock
"atmel,at91rm9200-clk-master" or "atmel,at91rm9200-clk-master" or
"atmel,at91sam9x5-clk-master": "atmel,at91sam9x5-clk-master":
...@@ -54,6 +74,63 @@ Required properties: ...@@ -54,6 +74,63 @@ Required properties:
"atmel,at91sam9x5-clk-utmi": "atmel,at91sam9x5-clk-utmi":
at91 utmi clock at91 utmi clock
Required properties for SCKC node:
- reg : defines the IO memory reserved for the SCKC.
- #size-cells : shall be 0 (reg is used to encode clk id).
- #address-cells : shall be 1 (reg is used to encode clk id).
For example:
sckc: sckc@fffffe50 {
compatible = "atmel,sama5d3-pmc";
reg = <0xfffffe50 0x4>
#size-cells = <0>;
#address-cells = <1>;
/* put at91 slow clocks here */
};
Required properties for internal slow RC oscillator:
- #clock-cells : from common clock binding; shall be set to 0.
- clock-frequency : define the internal RC oscillator frequency.
Optional properties:
- clock-accuracy : define the internal RC oscillator accuracy.
For example:
slow_rc_osc: slow_rc_osc {
compatible = "atmel,at91sam9x5-clk-slow-rc-osc";
clock-frequency = <32768>;
clock-accuracy = <50000000>;
};
Required properties for slow oscillator:
- #clock-cells : from common clock binding; shall be set to 0.
- clocks : shall encode the main osc source clk sources (see atmel datasheet).
Optional properties:
- atmel,osc-bypass : boolean property. Set this when a clock signal is directly
provided on XIN.
For example:
slow_osc: slow_osc {
compatible = "atmel,at91rm9200-clk-slow-osc";
#clock-cells = <0>;
clocks = <&slow_xtal>;
};
Required properties for slow clock:
- #clock-cells : from common clock binding; shall be set to 0.
- clocks : shall encode the slow clk sources (see atmel datasheet).
For example:
clk32k: slck {
compatible = "atmel,at91sam9x5-clk-slow";
#clock-cells = <0>;
clocks = <&slow_rc_osc &slow_osc>;
};
Required properties for PMC node: Required properties for PMC node:
- reg : defines the IO memory reserved for the PMC. - reg : defines the IO memory reserved for the PMC.
- #size-cells : shall be 0 (reg is used to encode clk id). - #size-cells : shall be 0 (reg is used to encode clk id).
...@@ -85,24 +162,57 @@ For example: ...@@ -85,24 +162,57 @@ For example:
/* put at91 clocks here */ /* put at91 clocks here */
}; };
Required properties for main clock internal RC oscillator:
- interrupt-parent : must reference the PMC node.
- interrupts : shall be set to "<0>".
- clock-frequency : define the internal RC oscillator frequency.
Optional properties:
- clock-accuracy : define the internal RC oscillator accuracy.
For example:
main_rc_osc: main_rc_osc {
compatible = "atmel,at91sam9x5-clk-main-rc-osc";
interrupt-parent = <&pmc>;
interrupts = <0>;
clock-frequency = <12000000>;
clock-accuracy = <50000000>;
};
Required properties for main clock oscillator:
- interrupt-parent : must reference the PMC node.
- interrupts : shall be set to "<0>".
- #clock-cells : from common clock binding; shall be set to 0.
- clocks : shall encode the main osc source clk sources (see atmel datasheet).
Optional properties:
- atmel,osc-bypass : boolean property. Specified if a clock signal is provided
on XIN.
clock signal is directly provided on XIN pin.
For example:
main_osc: main_osc {
compatible = "atmel,at91rm9200-clk-main-osc";
interrupt-parent = <&pmc>;
interrupts = <0>;
#clock-cells = <0>;
clocks = <&main_xtal>;
};
Required properties for main clock: Required properties for main clock:
- interrupt-parent : must reference the PMC node. - interrupt-parent : must reference the PMC node.
- interrupts : shall be set to "<0>". - interrupts : shall be set to "<0>".
- #clock-cells : from common clock binding; shall be set to 0. - #clock-cells : from common clock binding; shall be set to 0.
- clocks (optional if clock-frequency is provided) : shall be the slow clock - clocks : shall encode the main clk sources (see atmel datasheet).
phandle. This clock is used to calculate the main clock rate if
"clock-frequency" is not provided.
- clock-frequency : the main oscillator frequency.Prefer the use of
"clock-frequency" over automatic clock rate calculation.
For example: For example:
main: mainck { main: mainck {
compatible = "atmel,at91rm9200-clk-main"; compatible = "atmel,at91sam9x5-clk-main";
interrupt-parent = <&pmc>; interrupt-parent = <&pmc>;
interrupts = <0>; interrupts = <0>;
#clock-cells = <0>; #clock-cells = <0>;
clocks = <&ck32k>; clocks = <&main_rc_osc &main_osc>;
clock-frequency = <18432000>;
}; };
Required properties for master clock: Required properties for master clock:
......
...@@ -1617,12 +1617,6 @@ S: Supported ...@@ -1617,12 +1617,6 @@ S: Supported
F: drivers/misc/atmel_tclib.c F: drivers/misc/atmel_tclib.c
F: drivers/clocksource/tcb_clksrc.c F: drivers/clocksource/tcb_clksrc.c
ATMEL TSADCC DRIVER
M: Josh Wu <josh.wu@atmel.com>
L: linux-input@vger.kernel.org
S: Supported
F: drivers/input/touchscreen/atmel_tsadcc.c
ATMEL USBA UDC DRIVER ATMEL USBA UDC DRIVER
M: Nicolas Ferre <nicolas.ferre@atmel.com> M: Nicolas Ferre <nicolas.ferre@atmel.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
......
...@@ -376,7 +376,6 @@ config ARCH_AT91 ...@@ -376,7 +376,6 @@ config ARCH_AT91
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select CLKDEV_LOOKUP select CLKDEV_LOOKUP
select IRQ_DOMAIN select IRQ_DOMAIN
select NEED_MACH_GPIO_H
select NEED_MACH_IO_H if PCCARD select NEED_MACH_IO_H if PCCARD
select PINCTRL select PINCTRL
select PINCTRL_AT91 if USE_OF select PINCTRL_AT91 if USE_OF
......
...@@ -32,11 +32,6 @@ adc0: adc@f804c000 { ...@@ -32,11 +32,6 @@ adc0: adc@f804c000 {
status = "okay"; status = "okay";
}; };
tsadcc: tsadcc@f804c000 {
status = "okay";
};
rtc@fffffeb0 { rtc@fffffeb0 {
status = "okay"; status = "okay";
}; };
......
...@@ -21,6 +21,14 @@ memory { ...@@ -21,6 +21,14 @@ memory {
reg = <0x20000000 0x10000000>; reg = <0x20000000 0x10000000>;
}; };
slow_xtal {
clock-frequency = <32768>;
};
main_xtal {
clock-frequency = <12000000>;
};
ahb { ahb {
apb { apb {
mmc0: mmc@f0000000 { mmc0: mmc@f0000000 {
......
...@@ -46,6 +46,18 @@ memory { ...@@ -46,6 +46,18 @@ memory {
reg = <0x20000000 0x08000000>; reg = <0x20000000 0x08000000>;
}; };
main_xtal: main_xtal {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
};
slow_xtal: slow_xtal {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
};
ahb { ahb {
compatible = "simple-bus"; compatible = "simple-bus";
#address-cells = <1>; #address-cells = <1>;
...@@ -556,17 +568,24 @@ pmc: pmc@fffffc00 { ...@@ -556,17 +568,24 @@ pmc: pmc@fffffc00 {
#size-cells = <0>; #size-cells = <0>;
#interrupt-cells = <1>; #interrupt-cells = <1>;
clk32k: slck { slow_rc_osc: slow_rc_osc {
compatible = "fixed-clock"; compatible = "fixed-clock";
#clock-cells = <0>; #clock-cells = <0>;
clock-frequency = <32768>; clock-frequency = <32768>;
clock-accuracy = <50000000>;
};
clk32k: slck {
compatible = "atmel,at91sam9260-clk-slow";
#clock-cells = <0>;
clocks = <&slow_rc_osc &slow_xtal>;
}; };
main: mainck { main: mainck {
compatible = "atmel,at91rm9200-clk-main"; compatible = "atmel,at91rm9200-clk-main";
#clock-cells = <0>; #clock-cells = <0>;
interrupts-extended = <&pmc AT91_PMC_MOSCS>; interrupts-extended = <&pmc AT91_PMC_MOSCS>;
clocks = <&clk32k>; clocks = <&main_xtal>;
}; };
plla: pllack { plla: pllack {
......
...@@ -20,6 +20,10 @@ memory { ...@@ -20,6 +20,10 @@ memory {
reg = <0x20000000 0x4000000>; reg = <0x20000000 0x4000000>;
}; };
main_xtal {
clock-frequency = <18432000>;
};
clocks { clocks {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
......
...@@ -50,6 +50,18 @@ memory { ...@@ -50,6 +50,18 @@ memory {
reg = <0x20000000 0x04000000>; reg = <0x20000000 0x04000000>;
}; };
slow_xtal: slow_xtal {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
};
main_xtal: main_xtal {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
};
clocks { clocks {
adc_op_clk: adc_op_clk{ adc_op_clk: adc_op_clk{
compatible = "fixed-clock"; compatible = "fixed-clock";
...@@ -795,17 +807,11 @@ pmc: pmc@fffffc00 { ...@@ -795,17 +807,11 @@ pmc: pmc@fffffc00 {
#size-cells = <0>; #size-cells = <0>;
#interrupt-cells = <1>; #interrupt-cells = <1>;
clk32k: slck {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <32768>;
};
main: mainck { main: mainck {
compatible = "atmel,at91rm9200-clk-main"; compatible = "atmel,at91rm9200-clk-main";
#clock-cells = <0>; #clock-cells = <0>;
interrupts-extended = <&pmc AT91_PMC_MOSCS>; interrupts-extended = <&pmc AT91_PMC_MOSCS>;
clocks = <&clk32k>; clocks = <&main_xtal>;
}; };
plla: pllack { plla: pllack {
...@@ -1017,6 +1023,32 @@ watchdog@fffffd40 { ...@@ -1017,6 +1023,32 @@ watchdog@fffffd40 {
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
status = "disabled"; status = "disabled";
}; };
sckc@fffffd50 {
compatible = "atmel,at91sam9x5-sckc";
reg = <0xfffffd50 0x4>;
slow_osc: slow_osc {
compatible = "atmel,at91sam9x5-clk-slow-osc";
#clock-cells = <0>;
atmel,startup-time-usec = <1200000>;
clocks = <&slow_xtal>;
};
slow_rc_osc: slow_rc_osc {
compatible = "atmel,at91sam9x5-clk-slow-rc-osc";
#clock-cells = <0>;
atmel,startup-time-usec = <75>;
clock-frequency = <32768>;
clock-accuracy = <50000000>;
};
clk32k: slck {
compatible = "atmel,at91sam9x5-clk-slow";
#clock-cells = <0>;
clocks = <&slow_rc_osc &slow_osc>;
};
};
}; };
}; };
......
...@@ -20,6 +20,15 @@ memory { ...@@ -20,6 +20,15 @@ memory {
reg = <0x20000000 0x4000000>; reg = <0x20000000 0x4000000>;
}; };
slow_xtal {
clock-frequency = <32768>;
};
main_xtal {
clock-frequency = <12000000>;
};
clocks { clocks {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
......
...@@ -58,6 +58,18 @@ memory { ...@@ -58,6 +58,18 @@ memory {
reg = <0x20000000 0x8000000>; reg = <0x20000000 0x8000000>;
}; };
slow_xtal: slow_xtal {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
};
main_xtal: main_xtal {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
};
clocks { clocks {
adc_op_clk: adc_op_clk{ adc_op_clk: adc_op_clk{
compatible = "fixed-clock"; compatible = "fixed-clock";
...@@ -833,18 +845,29 @@ pmc: pmc@fffffc00 { ...@@ -833,18 +845,29 @@ pmc: pmc@fffffc00 {
#size-cells = <0>; #size-cells = <0>;
#interrupt-cells = <1>; #interrupt-cells = <1>;
clk32k: slck { main_rc_osc: main_rc_osc {
compatible = "fixed-clock"; compatible = "atmel,at91sam9x5-clk-main-rc-osc";
#clock-cells = <0>; #clock-cells = <0>;
clock-frequency = <32768>; interrupt-parent = <&pmc>;
interrupts = <AT91_PMC_MOSCRCS>;
clock-frequency = <12000000>;
clock-accuracy = <50000000>;
}; };
main: mainck { main_osc: main_osc {
compatible = "atmel,at91rm9200-clk-main"; compatible = "atmel,at91rm9200-clk-main-osc";
#clock-cells = <0>; #clock-cells = <0>;
interrupt-parent = <&pmc>; interrupt-parent = <&pmc>;
interrupts = <AT91_PMC_MOSCS>; interrupts = <AT91_PMC_MOSCS>;
clocks = <&clk32k>; clocks = <&main_xtal>;
};
main: mainck {
compatible = "atmel,at91sam9x5-clk-main";
#clock-cells = <0>;
interrupt-parent = <&pmc>;
interrupts = <AT91_PMC_MOSCSELS>;
clocks = <&main_rc_osc &main_osc>;
}; };
plla: pllack { plla: pllack {
...@@ -1173,6 +1196,32 @@ watchdog@fffffe40 { ...@@ -1173,6 +1196,32 @@ watchdog@fffffe40 {
status = "disabled"; status = "disabled";
}; };
sckc@fffffe50 {
compatible = "atmel,at91sam9x5-sckc";
reg = <0xfffffe50 0x4>;
slow_rc_osc: slow_rc_osc {
compatible = "atmel,at91sam9x5-clk-slow-rc-osc";
#clock-cells = <0>;
clock-frequency = <32768>;
clock-accuracy = <50000000>;
atmel,startup-time-usec = <75>;
};
slow_osc: slow_osc {
compatible = "atmel,at91sam9x5-clk-slow-osc";
#clock-cells = <0>;
clocks = <&slow_xtal>;
atmel,startup-time-usec = <1200000>;
};
clk32k: slowck {
compatible = "atmel,at91sam9x5-clk-slow";
#clock-cells = <0>;
clocks = <&slow_rc_osc &slow_osc>;
};
};
rtc@fffffeb0 { rtc@fffffeb0 {
compatible = "atmel,at91rm9200-rtc"; compatible = "atmel,at91rm9200-rtc";
reg = <0xfffffeb0 0x30>; reg = <0xfffffeb0 0x30>;
......
...@@ -18,6 +18,14 @@ memory { ...@@ -18,6 +18,14 @@ memory {
reg = <0x20000000 0x20000000>; reg = <0x20000000 0x20000000>;
}; };
slow_xtal {
clock-frequency = <32768>;
};
main_xtal {
clock-frequency = <12000000>;
};
ahb { ahb {
apb { apb {
spi0: spi@f0004000 { spi0: spi@f0004000 {
......
...@@ -83,7 +83,6 @@ CONFIG_KEYBOARD_GPIO=y ...@@ -83,7 +83,6 @@ CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ATMEL_MXT=m CONFIG_TOUCHSCREEN_ATMEL_MXT=m
CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
# CONFIG_SERIO is not set # CONFIG_SERIO is not set
# CONFIG_LEGACY_PTYS is not set # CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_ATMEL=y CONFIG_SERIAL_ATMEL=y
...@@ -146,6 +145,8 @@ CONFIG_DMADEVICES=y ...@@ -146,6 +145,8 @@ CONFIG_DMADEVICES=y
CONFIG_AT_HDMAC=y CONFIG_AT_HDMAC=y
CONFIG_DMATEST=m CONFIG_DMATEST=m
# CONFIG_IOMMU_SUPPORT is not set # CONFIG_IOMMU_SUPPORT is not set
CONFIG_IIO=y
CONFIG_AT91_ADC=y
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
CONFIG_FANOTIFY=y CONFIG_FANOTIFY=y
CONFIG_VFAT_FS=y CONFIG_VFAT_FS=y
......
...@@ -45,7 +45,6 @@ CONFIG_INPUT_EVDEV=y ...@@ -45,7 +45,6 @@ CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_KEYBOARD is not set # CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
# CONFIG_SERIO is not set # CONFIG_SERIO is not set
CONFIG_SERIAL_ATMEL=y CONFIG_SERIAL_ATMEL=y
CONFIG_SERIAL_ATMEL_CONSOLE=y CONFIG_SERIAL_ATMEL_CONSOLE=y
...@@ -65,6 +64,8 @@ CONFIG_MMC=y ...@@ -65,6 +64,8 @@ CONFIG_MMC=y
CONFIG_MMC_ATMELMCI=m CONFIG_MMC_ATMELMCI=m
CONFIG_RTC_CLASS=y CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_AT91SAM9=y CONFIG_RTC_DRV_AT91SAM9=y
CONFIG_IIO=y
CONFIG_AT91_ADC=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_MSDOS_FS=y CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y CONFIG_VFAT_FS=y
......
...@@ -122,7 +122,6 @@ CONFIG_KEYBOARD_GPIO=y ...@@ -122,7 +122,6 @@ CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ATMEL_MXT=y CONFIG_TOUCHSCREEN_ATMEL_MXT=y
CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
# CONFIG_SERIO is not set # CONFIG_SERIO is not set
CONFIG_LEGACY_PTY_COUNT=4 CONFIG_LEGACY_PTY_COUNT=4
CONFIG_SERIAL_ATMEL=y CONFIG_SERIAL_ATMEL=y
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
......
...@@ -24,12 +24,11 @@ ...@@ -24,12 +24,11 @@
#include <mach/at91sam9260_matrix.h> #include <mach/at91sam9260_matrix.h>
#include <mach/at91_matrix.h> #include <mach/at91_matrix.h>
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include <mach/at91_adc.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* USB Host * USB Host
...@@ -1325,13 +1324,6 @@ static struct at91_adc_trigger at91_adc_triggers[] = { ...@@ -1325,13 +1324,6 @@ static struct at91_adc_trigger at91_adc_triggers[] = {
}, },
}; };
static struct at91_adc_reg_desc at91_adc_register_g20 = {
.channel_base = AT91_ADC_CHR(0),
.drdy_mask = AT91_ADC_DRDY,
.status_register = AT91_ADC_SR,
.trigger_register = AT91_ADC_MR,
};
void __init at91_add_device_adc(struct at91_adc_data *data) void __init at91_add_device_adc(struct at91_adc_data *data)
{ {
if (!data) if (!data)
...@@ -1349,9 +1341,7 @@ void __init at91_add_device_adc(struct at91_adc_data *data) ...@@ -1349,9 +1341,7 @@ void __init at91_add_device_adc(struct at91_adc_data *data)
if (data->use_external_triggers) if (data->use_external_triggers)
at91_set_A_periph(AT91_PIN_PA22, 0); at91_set_A_periph(AT91_PIN_PA22, 0);
data->num_channels = 4;
data->startup_time = 10; data->startup_time = 10;
data->registers = &at91_adc_register_g20;
data->trigger_number = 4; data->trigger_number = 4;
data->trigger_list = at91_adc_triggers; data->trigger_list = at91_adc_triggers;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* USB Host * USB Host
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
......
...@@ -182,7 +182,7 @@ static struct clk vdec_clk = { ...@@ -182,7 +182,7 @@ static struct clk vdec_clk = {
static struct clk adc_op_clk = { static struct clk adc_op_clk = {
.name = "adc_op_clk", .name = "adc_op_clk",
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
.rate_hz = 13200000, .rate_hz = 300000,
}; };
/* AES/TDES/SHA clock - Only for sam9m11/sam9g56 */ /* AES/TDES/SHA clock - Only for sam9m11/sam9g56 */
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <video/atmel_lcdc.h> #include <video/atmel_lcdc.h>
#include <mach/at91_adc.h>
#include <mach/at91sam9g45.h> #include <mach/at91sam9g45.h>
#include <mach/at91sam9g45_matrix.h> #include <mach/at91sam9g45_matrix.h>
#include <mach/at91_matrix.h> #include <mach/at91_matrix.h>
...@@ -39,6 +38,7 @@ ...@@ -39,6 +38,7 @@
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "clock.h" #include "clock.h"
#include "gpio.h"
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
...@@ -1133,58 +1133,7 @@ static void __init at91_add_device_rtc(void) {} ...@@ -1133,58 +1133,7 @@ static void __init at91_add_device_rtc(void) {}
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Touchscreen * ADC and touchscreen
* -------------------------------------------------------------------- */
#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
static struct at91_tsadcc_data tsadcc_data;
static struct resource tsadcc_resources[] = {
[0] = {
.start = AT91SAM9G45_BASE_TSC,
.end = AT91SAM9G45_BASE_TSC + SZ_16K - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC,
.end = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC,
.flags = IORESOURCE_IRQ,
}
};
static struct platform_device at91sam9g45_tsadcc_device = {
.name = "atmel_tsadcc",
.id = -1,
.dev = {
.dma_mask = &tsadcc_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &tsadcc_data,
},
.resource = tsadcc_resources,
.num_resources = ARRAY_SIZE(tsadcc_resources),
};
void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data)
{
if (!data)
return;
at91_set_gpio_input(AT91_PIN_PD20, 0); /* AD0_XR */
at91_set_gpio_input(AT91_PIN_PD21, 0); /* AD1_XL */
at91_set_gpio_input(AT91_PIN_PD22, 0); /* AD2_YT */
at91_set_gpio_input(AT91_PIN_PD23, 0); /* AD3_TB */
tsadcc_data = *data;
platform_device_register(&at91sam9g45_tsadcc_device);
}
#else
void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {}
#endif
/* --------------------------------------------------------------------
* ADC
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if IS_ENABLED(CONFIG_AT91_ADC) #if IS_ENABLED(CONFIG_AT91_ADC)
...@@ -1236,13 +1185,6 @@ static struct at91_adc_trigger at91_adc_triggers[] = { ...@@ -1236,13 +1185,6 @@ static struct at91_adc_trigger at91_adc_triggers[] = {
}, },
}; };
static struct at91_adc_reg_desc at91_adc_register_g45 = {
.channel_base = AT91_ADC_CHR(0),
.drdy_mask = AT91_ADC_DRDY,
.status_register = AT91_ADC_SR,
.trigger_register = 0x08,
};
void __init at91_add_device_adc(struct at91_adc_data *data) void __init at91_add_device_adc(struct at91_adc_data *data)
{ {
if (!data) if (!data)
...@@ -1268,9 +1210,7 @@ void __init at91_add_device_adc(struct at91_adc_data *data) ...@@ -1268,9 +1210,7 @@ void __init at91_add_device_adc(struct at91_adc_data *data)
if (data->use_external_triggers) if (data->use_external_triggers)
at91_set_A_periph(AT91_PIN_PD28, 0); at91_set_A_periph(AT91_PIN_PD28, 0);
data->num_channels = 8;
data->startup_time = 40; data->startup_time = 40;
data->registers = &at91_adc_register_g45;
data->trigger_number = 4; data->trigger_number = 4;
data->trigger_list = at91_adc_triggers; data->trigger_list = at91_adc_triggers;
......
...@@ -153,6 +153,11 @@ static struct clk ac97_clk = { ...@@ -153,6 +153,11 @@ static struct clk ac97_clk = {
.pmc_mask = 1 << AT91SAM9RL_ID_AC97C, .pmc_mask = 1 << AT91SAM9RL_ID_AC97C,
.type = CLK_TYPE_PERIPHERAL, .type = CLK_TYPE_PERIPHERAL,
}; };
static struct clk adc_op_clk = {
.name = "adc_op_clk",
.type = CLK_TYPE_PERIPHERAL,
.rate_hz = 1000000,
};
static struct clk *periph_clocks[] __initdata = { static struct clk *periph_clocks[] __initdata = {
&pioA_clk, &pioA_clk,
...@@ -178,6 +183,7 @@ static struct clk *periph_clocks[] __initdata = { ...@@ -178,6 +183,7 @@ static struct clk *periph_clocks[] __initdata = {
&udphs_clk, &udphs_clk,
&lcdc_clk, &lcdc_clk,
&ac97_clk, &ac97_clk,
&adc_op_clk,
// irq0 // irq0
}; };
...@@ -216,6 +222,7 @@ static struct clk_lookup periph_clocks_lookups[] = { ...@@ -216,6 +222,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk), CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk), CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk),
CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioD_clk), CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioD_clk),
CLKDEV_CON_ID("adc_clk", &tsc_clk),
}; };
static struct clk_lookup usart_clocks_lookups[] = { static struct clk_lookup usart_clocks_lookups[] = {
......
...@@ -23,9 +23,11 @@ ...@@ -23,9 +23,11 @@
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <linux/platform_data/dma-atmel.h> #include <linux/platform_data/dma-atmel.h>
#include <linux/platform_data/at91_adc.h>
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
...@@ -608,14 +610,13 @@ static void __init at91_add_device_tc(void) { } ...@@ -608,14 +610,13 @@ static void __init at91_add_device_tc(void) { }
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Touchscreen * ADC and Touchscreen
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE) #if IS_ENABLED(CONFIG_AT91_ADC)
static u64 tsadcc_dmamask = DMA_BIT_MASK(32); static struct at91_adc_data adc_data;
static struct at91_tsadcc_data tsadcc_data;
static struct resource tsadcc_resources[] = { static struct resource adc_resources[] = {
[0] = { [0] = {
.start = AT91SAM9RL_BASE_TSC, .start = AT91SAM9RL_BASE_TSC,
.end = AT91SAM9RL_BASE_TSC + SZ_16K - 1, .end = AT91SAM9RL_BASE_TSC + SZ_16K - 1,
...@@ -628,36 +629,71 @@ static struct resource tsadcc_resources[] = { ...@@ -628,36 +629,71 @@ static struct resource tsadcc_resources[] = {
} }
}; };
static struct platform_device at91sam9rl_tsadcc_device = { static struct platform_device at91_adc_device = {
.name = "atmel_tsadcc", .name = "at91sam9rl-adc",
.id = -1, .id = -1,
.dev = { .dev = {
.dma_mask = &tsadcc_dmamask, .platform_data = &adc_data,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &tsadcc_data,
}, },
.resource = tsadcc_resources, .resource = adc_resources,
.num_resources = ARRAY_SIZE(tsadcc_resources), .num_resources = ARRAY_SIZE(adc_resources),
}; };
void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) static struct at91_adc_trigger at91_adc_triggers[] = {
[0] = {
.name = "external-rising",
.value = 1,
.is_external = true,
},
[1] = {
.name = "external-falling",
.value = 2,
.is_external = true,
},
[2] = {
.name = "external-any",
.value = 3,
.is_external = true,
},
[3] = {
.name = "continuous",
.value = 6,
.is_external = false,
},
};
void __init at91_add_device_adc(struct at91_adc_data *data)
{ {
if (!data) if (!data)
return; return;
at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */ if (test_bit(0, &data->channels_used))
at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */ at91_set_A_periph(AT91_PIN_PA17, 0);
at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */ if (test_bit(1, &data->channels_used))
at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */ at91_set_A_periph(AT91_PIN_PA18, 0);
if (test_bit(2, &data->channels_used))
tsadcc_data = *data; at91_set_A_periph(AT91_PIN_PA19, 0);
platform_device_register(&at91sam9rl_tsadcc_device); if (test_bit(3, &data->channels_used))
at91_set_A_periph(AT91_PIN_PA20, 0);
if (test_bit(4, &data->channels_used))
at91_set_A_periph(AT91_PIN_PD6, 0);
if (test_bit(5, &data->channels_used))
at91_set_A_periph(AT91_PIN_PD7, 0);
if (data->use_external_triggers)
at91_set_A_periph(AT91_PIN_PB15, 0);
data->startup_time = 40;
data->trigger_number = 4;
data->trigger_list = at91_adc_triggers;
adc_data = *data;
platform_device_register(&at91_adc_device);
} }
#else #else
void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {} void __init at91_add_device_adc(struct at91_adc_data *data) {}
#endif #endif
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* RTC * RTC
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init onearm_init_early(void) static void __init onearm_init_early(void)
{ {
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init afeb9260_init_early(void) static void __init afeb9260_init_early(void)
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init cam60_init_early(void) static void __init cam60_init_early(void)
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init carmeva_init_early(void) static void __init carmeva_init_early(void)
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init cpu9krea_init_early(void) static void __init cpu9krea_init_early(void)
{ {
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static struct gpio_led cpuat91_leds[] = { static struct gpio_led cpuat91_leds[] = {
{ {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init csb337_init_early(void) static void __init csb337_init_early(void)
{ {
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init csb637_init_early(void) static void __init csb637_init_early(void)
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init eb9200_init_early(void) static void __init eb9200_init_early(void)
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init ecb_at91init_early(void) static void __init ecb_at91init_early(void)
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init eco920_init_early(void) static void __init eco920_init_early(void)
{ {
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init flexibity_init_early(void) static void __init flexibity_init_early(void)
{ {
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
/* /*
* The FOX Board G20 hardware comes as the "Netus G20" board with * The FOX Board G20 hardware comes as the "Netus G20" board with
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "generic.h" #include "generic.h"
#include "gsia18s.h" #include "gsia18s.h"
#include "stamp9g20.h" #include "stamp9g20.h"
#include "gpio.h"
static void __init gsia18s_init_early(void) static void __init gsia18s_init_early(void)
{ {
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init kafa_init_early(void) static void __init kafa_init_early(void)
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init kb9202_init_early(void) static void __init kb9202_init_early(void)
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "stamp9g20.h" #include "stamp9g20.h"
#include "gpio.h"
static void __init pcontrol_g20_init_early(void) static void __init pcontrol_g20_init_early(void)
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init picotux200_init_early(void) static void __init picotux200_init_early(void)
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init ek_init_early(void) static void __init ek_init_early(void)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init rsi_ews_init_early(void) static void __init rsi_ews_init_early(void)
{ {
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init ek_init_early(void) static void __init ek_init_early(void)
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init ek_init_early(void) static void __init ek_init_early(void)
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init ek_init_early(void) static void __init ek_init_early(void)
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init ek_init_early(void) static void __init ek_init_early(void)
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
/* /*
* board revision encoding * board revision encoding
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init ek_init_early(void) static void __init ek_init_early(void)
...@@ -300,21 +301,13 @@ static struct atmel_lcdfb_pdata __initdata ek_lcdc_data; ...@@ -300,21 +301,13 @@ static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;
/* /*
* Touchscreen * ADCs and touchscreen
*/
static struct at91_tsadcc_data ek_tsadcc_data = {
.adc_clock = 300000,
.pendet_debounce = 0x0d,
.ts_sample_hold_time = 0x0a,
};
/*
* ADCs
*/ */
static struct at91_adc_data ek_adc_data = { static struct at91_adc_data ek_adc_data = {
.channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7), .channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7),
.use_external_triggers = true, .use_external_triggers = true,
.vref = 3300, .vref = 3300,
.touchscreen_type = ATMEL_ADC_TOUCHSCREEN_4WIRE,
}; };
/* /*
...@@ -485,9 +478,7 @@ static void __init ek_board_init(void) ...@@ -485,9 +478,7 @@ static void __init ek_board_init(void)
at91_add_device_isi(&isi_data, true); at91_add_device_isi(&isi_data, true);
/* LCD Controller */ /* LCD Controller */
at91_add_device_lcdc(&ek_lcdc_data); at91_add_device_lcdc(&ek_lcdc_data);
/* Touch Screen */ /* ADC and touchscreen */
at91_add_device_tsadcc(&ek_tsadcc_data);
/* ADC */
at91_add_device_adc(&ek_adc_data); at91_add_device_adc(&ek_adc_data);
/* Push Buttons */ /* Push Buttons */
ek_add_device_buttons(); ek_add_device_buttons();
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/gpio_keys.h> #include <linux/gpio_keys.h>
#include <linux/platform_data/at91_adc.h>
#include <video/atmel_lcdc.h> #include <video/atmel_lcdc.h>
...@@ -38,6 +39,7 @@ ...@@ -38,6 +39,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init ek_init_early(void) static void __init ek_init_early(void)
...@@ -229,12 +231,13 @@ static struct gpio_led ek_leds[] = { ...@@ -229,12 +231,13 @@ static struct gpio_led ek_leds[] = {
/* /*
* Touchscreen * ADC + Touchscreen
*/ */
static struct at91_tsadcc_data ek_tsadcc_data = { static struct at91_adc_data ek_adc_data = {
.adc_clock = 1000000, .channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5),
.pendet_debounce = 0x0f, .use_external_triggers = true,
.ts_sample_hold_time = 0x03, .vref = 3300,
.touchscreen_type = ATMEL_ADC_TOUCHSCREEN_4WIRE,
}; };
...@@ -310,8 +313,8 @@ static void __init ek_board_init(void) ...@@ -310,8 +313,8 @@ static void __init ek_board_init(void)
at91_add_device_lcdc(&ek_lcdc_data); at91_add_device_lcdc(&ek_lcdc_data);
/* AC97 */ /* AC97 */
at91_add_device_ac97(&ek_ac97_data); at91_add_device_ac97(&ek_ac97_data);
/* Touch Screen Controller */ /* Touch Screen Controller + ADC */
at91_add_device_tsadcc(&ek_tsadcc_data); at91_add_device_adc(&ek_adc_data);
/* LEDs */ /* LEDs */
at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
/* Push Buttons */ /* Push Buttons */
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
#define SNAPPER9260_IO_EXP_GPIO(x) (NR_BUILTIN_GPIO + (x)) #define SNAPPER9260_IO_EXP_GPIO(x) (NR_BUILTIN_GPIO + (x))
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "board.h" #include "board.h"
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
void __init stamp9g20_init_early(void) void __init stamp9g20_init_early(void)
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "board.h" #include "board.h"
#include "generic.h" #include "generic.h"
#include "gpio.h"
static void __init yl9200_init_early(void) static void __init yl9200_init_early(void)
......
...@@ -118,9 +118,6 @@ struct isi_platform_data; ...@@ -118,9 +118,6 @@ struct isi_platform_data;
extern void __init at91_add_device_isi(struct isi_platform_data *data, extern void __init at91_add_device_isi(struct isi_platform_data *data,
bool use_pck_as_mck); bool use_pck_as_mck);
/* Touchscreen Controller */
extern void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data);
/* CAN */ /* CAN */
extern void __init at91_add_device_can(struct at91_can_data *data); extern void __init at91_add_device_can(struct at91_can_data *data);
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <mach/at91_pio.h> #include <mach/at91_pio.h>
#include "generic.h" #include "generic.h"
#include "gpio.h"
#define MAX_NB_GPIO_PER_BANK 32 #define MAX_NB_GPIO_PER_BANK 32
......
...@@ -209,14 +209,6 @@ extern int at91_get_gpio_value(unsigned pin); ...@@ -209,14 +209,6 @@ extern int at91_get_gpio_value(unsigned pin);
extern void at91_gpio_suspend(void); extern void at91_gpio_suspend(void);
extern void at91_gpio_resume(void); extern void at91_gpio_resume(void);
#ifdef CONFIG_PINCTRL_AT91
extern void at91_pinctrl_gpio_suspend(void);
extern void at91_pinctrl_gpio_resume(void);
#else
static inline void at91_pinctrl_gpio_suspend(void) {}
static inline void at91_pinctrl_gpio_resume(void) {}
#endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif #endif
/*
* arch/arm/mach-at91/include/mach/at91_adc.h
*
* Copyright (C) SAN People
*
* Analog-to-Digital Converter (ADC) registers.
* Based on AT91SAM9260 datasheet revision D.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef AT91_ADC_H
#define AT91_ADC_H
#define AT91_ADC_CR 0x00 /* Control Register */
#define AT91_ADC_SWRST (1 << 0) /* Software Reset */
#define AT91_ADC_START (1 << 1) /* Start Conversion */
#define AT91_ADC_MR 0x04 /* Mode Register */
#define AT91_ADC_TRGEN (1 << 0) /* Trigger Enable */
#define AT91_ADC_TRGSEL (7 << 1) /* Trigger Selection */
#define AT91_ADC_TRGSEL_TC0 (0 << 1)
#define AT91_ADC_TRGSEL_TC1 (1 << 1)
#define AT91_ADC_TRGSEL_TC2 (2 << 1)
#define AT91_ADC_TRGSEL_EXTERNAL (6 << 1)
#define AT91_ADC_LOWRES (1 << 4) /* Low Resolution */
#define AT91_ADC_SLEEP (1 << 5) /* Sleep Mode */
#define AT91_ADC_PRESCAL_9260 (0x3f << 8) /* Prescalar Rate Selection */
#define AT91_ADC_PRESCAL_9G45 (0xff << 8)
#define AT91_ADC_PRESCAL_(x) ((x) << 8)
#define AT91_ADC_STARTUP_9260 (0x1f << 16) /* Startup Up Time */
#define AT91_ADC_STARTUP_9G45 (0x7f << 16)
#define AT91_ADC_STARTUP_9X5 (0xf << 16)
#define AT91_ADC_STARTUP_(x) ((x) << 16)
#define AT91_ADC_SHTIM (0xf << 24) /* Sample & Hold Time */
#define AT91_ADC_SHTIM_(x) ((x) << 24)
#define AT91_ADC_CHER 0x10 /* Channel Enable Register */
#define AT91_ADC_CHDR 0x14 /* Channel Disable Register */
#define AT91_ADC_CHSR 0x18 /* Channel Status Register */
#define AT91_ADC_CH(n) (1 << (n)) /* Channel Number */
#define AT91_ADC_SR 0x1C /* Status Register */
#define AT91_ADC_EOC(n) (1 << (n)) /* End of Conversion on Channel N */
#define AT91_ADC_OVRE(n) (1 << ((n) + 8))/* Overrun Error on Channel N */
#define AT91_ADC_DRDY (1 << 16) /* Data Ready */
#define AT91_ADC_GOVRE (1 << 17) /* General Overrun Error */
#define AT91_ADC_ENDRX (1 << 18) /* End of RX Buffer */
#define AT91_ADC_RXFUFF (1 << 19) /* RX Buffer Full */
#define AT91_ADC_SR_9X5 0x30 /* Status Register for 9x5 */
#define AT91_ADC_SR_DRDY_9X5 (1 << 24) /* Data Ready */
#define AT91_ADC_LCDR 0x20 /* Last Converted Data Register */
#define AT91_ADC_LDATA (0x3ff)
#define AT91_ADC_IER 0x24 /* Interrupt Enable Register */
#define AT91_ADC_IDR 0x28 /* Interrupt Disable Register */
#define AT91_ADC_IMR 0x2C /* Interrupt Mask Register */
#define AT91_ADC_IER_PEN (1 << 29)
#define AT91_ADC_IER_NOPEN (1 << 30)
#define AT91_ADC_IER_XRDY (1 << 20)
#define AT91_ADC_IER_YRDY (1 << 21)
#define AT91_ADC_IER_PRDY (1 << 22)
#define AT91_ADC_ISR_PENS (1 << 31)
#define AT91_ADC_CHR(n) (0x30 + ((n) * 4)) /* Channel Data Register N */
#define AT91_ADC_DATA (0x3ff)
#define AT91_ADC_CDR0_9X5 (0x50) /* Channel Data Register 0 for 9X5 */
#define AT91_ADC_ACR 0x94 /* Analog Control Register */
#define AT91_ADC_ACR_PENDETSENS (0x3 << 0) /* pull-up resistor */
#define AT91_ADC_TSMR 0xB0
#define AT91_ADC_TSMR_TSMODE (3 << 0) /* Touch Screen Mode */
#define AT91_ADC_TSMR_TSMODE_NONE (0 << 0)
#define AT91_ADC_TSMR_TSMODE_4WIRE_NO_PRESS (1 << 0)
#define AT91_ADC_TSMR_TSMODE_4WIRE_PRESS (2 << 0)
#define AT91_ADC_TSMR_TSMODE_5WIRE (3 << 0)
#define AT91_ADC_TSMR_TSAV (3 << 4) /* Averages samples */
#define AT91_ADC_TSMR_TSAV_(x) ((x) << 4)
#define AT91_ADC_TSMR_SCTIM (0x0f << 16) /* Switch closure time */
#define AT91_ADC_TSMR_PENDBC (0x0f << 28) /* Pen Debounce time */
#define AT91_ADC_TSMR_PENDBC_(x) ((x) << 28)
#define AT91_ADC_TSMR_NOTSDMA (1 << 22) /* No Touchscreen DMA */
#define AT91_ADC_TSMR_PENDET_DIS (0 << 24) /* Pen contact detection disable */
#define AT91_ADC_TSMR_PENDET_ENA (1 << 24) /* Pen contact detection enable */
#define AT91_ADC_TSXPOSR 0xB4
#define AT91_ADC_TSYPOSR 0xB8
#define AT91_ADC_TSPRESSR 0xBC
#define AT91_ADC_TRGR_9260 AT91_ADC_MR
#define AT91_ADC_TRGR_9G45 0x08
#define AT91_ADC_TRGR_9X5 0xC0
/* Trigger Register bit field */
#define AT91_ADC_TRGR_TRGPER (0xffff << 16)
#define AT91_ADC_TRGR_TRGPER_(x) ((x) << 16)
#define AT91_ADC_TRGR_TRGMOD (0x7 << 0)
#define AT91_ADC_TRGR_MOD_PERIOD_TRIG (5 << 0)
#endif
...@@ -104,5 +104,20 @@ ...@@ -104,5 +104,20 @@
/* Clocks */ /* Clocks */
#define AT91_SLOW_CLOCK 32768 /* slow clock */ #define AT91_SLOW_CLOCK 32768 /* slow clock */
/*
* FIXME: this is needed to communicate between the pinctrl driver and
* the PM implementation in the machine. Possibly part of the PM
* implementation should be moved down into the pinctrl driver and get
* called as part of the generic suspend/resume path.
*/
#ifndef __ASSEMBLY__
#ifdef CONFIG_PINCTRL_AT91
extern void at91_pinctrl_gpio_suspend(void);
extern void at91_pinctrl_gpio_resume(void);
#else
static inline void at91_pinctrl_gpio_suspend(void) {}
static inline void at91_pinctrl_gpio_resume(void) {}
#endif
#endif
#endif #endif
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include "board.h" #include "board.h"
#include "gpio.h"
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "at91_aic.h" #include "at91_aic.h"
#include "generic.h" #include "generic.h"
#include "pm.h" #include "pm.h"
#include "gpio.h"
/* /*
* Show the reason for the previous system reset. * Show the reason for the previous system reset.
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# Makefile for at91 specific clk # Makefile for at91 specific clk
# #
obj-y += pmc.o obj-y += pmc.o sckc.o
obj-y += clk-main.o clk-pll.o clk-plldiv.o clk-master.o obj-y += clk-slow.o clk-main.o clk-pll.o clk-plldiv.o clk-master.o
obj-y += clk-system.o clk-peripheral.o clk-programmable.o obj-y += clk-system.o clk-peripheral.o clk-programmable.o
obj-$(CONFIG_HAVE_AT91_UTMI) += clk-utmi.o obj-$(CONFIG_HAVE_AT91_UTMI) += clk-utmi.o
......
This diff is collapsed.
This diff is collapsed.
...@@ -229,11 +229,28 @@ static struct at91_pmc *__init at91_pmc_init(struct device_node *np, ...@@ -229,11 +229,28 @@ static struct at91_pmc *__init at91_pmc_init(struct device_node *np,
} }
static const struct of_device_id pmc_clk_ids[] __initconst = { static const struct of_device_id pmc_clk_ids[] __initconst = {
/* Slow oscillator */
{
.compatible = "atmel,at91sam9260-clk-slow",
.data = of_at91sam9260_clk_slow_setup,
},
/* Main clock */ /* Main clock */
{
.compatible = "atmel,at91rm9200-clk-main-osc",
.data = of_at91rm9200_clk_main_osc_setup,
},
{
.compatible = "atmel,at91sam9x5-clk-main-rc-osc",
.data = of_at91sam9x5_clk_main_rc_osc_setup,
},
{ {
.compatible = "atmel,at91rm9200-clk-main", .compatible = "atmel,at91rm9200-clk-main",
.data = of_at91rm9200_clk_main_setup, .data = of_at91rm9200_clk_main_setup,
}, },
{
.compatible = "atmel,at91sam9x5-clk-main",
.data = of_at91sam9x5_clk_main_setup,
},
/* PLL clocks */ /* PLL clocks */
{ {
.compatible = "atmel,at91rm9200-clk-pll", .compatible = "atmel,at91rm9200-clk-pll",
......
...@@ -58,8 +58,17 @@ static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value) ...@@ -58,8 +58,17 @@ static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value)
int of_at91_get_clk_range(struct device_node *np, const char *propname, int of_at91_get_clk_range(struct device_node *np, const char *propname,
struct clk_range *range); struct clk_range *range);
extern void __init of_at91sam9260_clk_slow_setup(struct device_node *np,
struct at91_pmc *pmc);
extern void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np,
struct at91_pmc *pmc);
extern void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np,
struct at91_pmc *pmc);
extern void __init of_at91rm9200_clk_main_setup(struct device_node *np, extern void __init of_at91rm9200_clk_main_setup(struct device_node *np,
struct at91_pmc *pmc); struct at91_pmc *pmc);
extern void __init of_at91sam9x5_clk_main_setup(struct device_node *np,
struct at91_pmc *pmc);
extern void __init of_at91rm9200_clk_pll_setup(struct device_node *np, extern void __init of_at91rm9200_clk_pll_setup(struct device_node *np,
struct at91_pmc *pmc); struct at91_pmc *pmc);
......
/*
* drivers/clk/at91/sckc.c
*
* Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*/
#include <linux/clk-provider.h>
#include <linux/clkdev.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/io.h>
#include "sckc.h"
static const struct of_device_id sckc_clk_ids[] __initconst = {
/* Slow clock */
{
.compatible = "atmel,at91sam9x5-clk-slow-osc",
.data = of_at91sam9x5_clk_slow_osc_setup,
},
{
.compatible = "atmel,at91sam9x5-clk-slow-rc-osc",
.data = of_at91sam9x5_clk_slow_rc_osc_setup,
},
{
.compatible = "atmel,at91sam9x5-clk-slow",
.data = of_at91sam9x5_clk_slow_setup,
},
{ /*sentinel*/ }
};
static void __init of_at91sam9x5_sckc_setup(struct device_node *np)
{
struct device_node *childnp;
void (*clk_setup)(struct device_node *, void __iomem *);
const struct of_device_id *clk_id;
void __iomem *regbase = of_iomap(np, 0);
if (!regbase)
return;
for_each_child_of_node(np, childnp) {
clk_id = of_match_node(sckc_clk_ids, childnp);
if (!clk_id)
continue;
clk_setup = clk_id->data;
clk_setup(childnp, regbase);
}
}
CLK_OF_DECLARE(at91sam9x5_clk_sckc, "atmel,at91sam9x5-sckc",
of_at91sam9x5_sckc_setup);
/*
* drivers/clk/at91/sckc.h
*
* Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef __AT91_SCKC_H_
#define __AT91_SCKC_H_
extern void __init of_at91sam9x5_clk_slow_osc_setup(struct device_node *np,
void __iomem *sckcr);
extern void __init of_at91sam9x5_clk_slow_rc_osc_setup(struct device_node *np,
void __iomem *sckcr);
extern void __init of_at91sam9x5_clk_slow_setup(struct device_node *np,
void __iomem *sckcr);
#endif /* __AT91_SCKC_H_ */
This diff is collapsed.
...@@ -550,18 +550,6 @@ config TOUCHSCREEN_TI_AM335X_TSC ...@@ -550,18 +550,6 @@ config TOUCHSCREEN_TI_AM335X_TSC
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called ti_am335x_tsc. module will be called ti_am335x_tsc.
config TOUCHSCREEN_ATMEL_TSADCC
tristate "Atmel Touchscreen Interface"
depends on ARCH_AT91
help
Say Y here if you have a 4-wire touchscreen connected to the
ADC Controller on your Atmel SoC.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called atmel_tsadcc.
config TOUCHSCREEN_UCB1400 config TOUCHSCREEN_UCB1400
tristate "Philips UCB1400 touchscreen" tristate "Philips UCB1400 touchscreen"
depends on AC97_BUS depends on AC97_BUS
......
...@@ -13,7 +13,6 @@ obj-$(CONFIG_TOUCHSCREEN_AD7879_I2C) += ad7879-i2c.o ...@@ -13,7 +13,6 @@ obj-$(CONFIG_TOUCHSCREEN_AD7879_I2C) += ad7879-i2c.o
obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI) += ad7879-spi.o obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI) += ad7879-spi.o
obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o
obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o
obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o
obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o
obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o
obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o
......
This diff is collapsed.
...@@ -155,6 +155,7 @@ extern void __iomem *at91_pmc_base; ...@@ -155,6 +155,7 @@ extern void __iomem *at91_pmc_base;
#define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */
#define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ #define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */
#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9] */ #define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9] */
#define AT91_PMC_OSCSEL (1 << 7) /* Slow Oscillator Selection [some SAM9] */
#define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ #define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */
#define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ #define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */
#define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */ #define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */
......
...@@ -7,23 +7,10 @@ ...@@ -7,23 +7,10 @@
#ifndef _AT91_ADC_H_ #ifndef _AT91_ADC_H_
#define _AT91_ADC_H_ #define _AT91_ADC_H_
/** enum atmel_adc_ts_type {
* struct at91_adc_reg_desc - Various informations relative to registers ATMEL_ADC_TOUCHSCREEN_NONE = 0,
* @channel_base: Base offset for the channel data registers ATMEL_ADC_TOUCHSCREEN_4WIRE = 4,
* @drdy_mask: Mask of the DRDY field in the relevant registers ATMEL_ADC_TOUCHSCREEN_5WIRE = 5,
(Interruptions registers mostly)
* @status_register: Offset of the Interrupt Status Register
* @trigger_register: Offset of the Trigger setup register
* @mr_prescal_mask: Mask of the PRESCAL field in the adc MR register
* @mr_startup_mask: Mask of the STARTUP field in the adc MR register
*/
struct at91_adc_reg_desc {
u8 channel_base;
u32 drdy_mask;
u8 status_register;
u8 trigger_register;
u32 mr_prescal_mask;
u32 mr_startup_mask;
}; };
/** /**
...@@ -42,23 +29,21 @@ struct at91_adc_trigger { ...@@ -42,23 +29,21 @@ struct at91_adc_trigger {
/** /**
* struct at91_adc_data - platform data for ADC driver * struct at91_adc_data - platform data for ADC driver
* @channels_used: channels in use on the board as a bitmask * @channels_used: channels in use on the board as a bitmask
* @num_channels: global number of channels available on the board
* @registers: Registers definition on the board
* @startup_time: startup time of the ADC in microseconds * @startup_time: startup time of the ADC in microseconds
* @trigger_list: Triggers available in the ADC * @trigger_list: Triggers available in the ADC
* @trigger_number: Number of triggers available in the ADC * @trigger_number: Number of triggers available in the ADC
* @use_external_triggers: does the board has external triggers availables * @use_external_triggers: does the board has external triggers availables
* @vref: Reference voltage for the ADC in millivolts * @vref: Reference voltage for the ADC in millivolts
* @touchscreen_type: If a touchscreen is connected, its type (4 or 5 wires)
*/ */
struct at91_adc_data { struct at91_adc_data {
unsigned long channels_used; unsigned long channels_used;
u8 num_channels;
struct at91_adc_reg_desc *registers;
u8 startup_time; u8 startup_time;
struct at91_adc_trigger *trigger_list; struct at91_adc_trigger *trigger_list;
u8 trigger_number; u8 trigger_number;
bool use_external_triggers; bool use_external_triggers;
u16 vref; u16 vref;
enum atmel_adc_ts_type touchscreen_type;
}; };
extern void __init at91_add_device_adc(struct at91_adc_data *data); extern void __init at91_add_device_adc(struct at91_adc_data *data);
......
...@@ -87,13 +87,6 @@ struct atmel_uart_data { ...@@ -87,13 +87,6 @@ struct atmel_uart_data {
int rts_gpio; /* optional RTS GPIO */ int rts_gpio; /* optional RTS GPIO */
}; };
/* Touchscreen Controller */
struct at91_tsadcc_data {
unsigned int adc_clock;
u8 pendet_debounce;
u8 ts_sample_hold_time;
};
/* CAN */ /* CAN */
struct at91_can_data { struct at91_can_data {
void (*transceiver_switch)(int on); void (*transceiver_switch)(int on);
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/gpio.h>
#include "../codecs/wm8731.h" #include "../codecs/wm8731.h"
#include "atmel-pcm.h" #include "atmel-pcm.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment