summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2015-03-17 16:07:48 +0100
committerpopcornmix <popcornmix@gmail.com>2015-05-25 18:14:06 +0100
commit833c2d598c0fbfe5c47d233cd4302e290d403c16 (patch)
tree365ac638c2ea2efe629d385042b6afab4be24837
parentef724874a73fdecf9bcb98d7124ea751a9203891 (diff)
downloadlinux-833c2d598c0fbfe5c47d233cd4302e290d403c16.tar.gz
dts: overlay: add generic support for ads7846
Add generic support for the ADS7846 touch controller. Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/ads7846-overlay.dts83
2 files changed, 84 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index dbcbedb33d00..ecdd3229b34f 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -13,6 +13,7 @@ ifeq ($(CONFIG_BCM2709_DT),y)
RPI_DT_OVERLAYS=y
endif
+dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += ds1307-rtc-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb
diff --git a/arch/arm/boot/dts/ads7846-overlay.dts b/arch/arm/boot/dts/ads7846-overlay.dts
new file mode 100644
index 000000000000..6a92cd1a9ffc
--- /dev/null
+++ b/arch/arm/boot/dts/ads7846-overlay.dts
@@ -0,0 +1,83 @@
+/*
+ * Generic Device Tree overlay for the ADS7846 touch controller
+ *
+ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
+
+ fragment@0 {
+ target = <&spi0>;
+ __overlay__ {
+ status = "okay";
+
+ spidev@0{
+ status = "disabled";
+ };
+
+ spidev@1{
+ status = "disabled";
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&gpio>;
+ __overlay__ {
+ ads7846_pins: ads7846_pins {
+ brcm,pins = <255>; /* illegal default value */
+ brcm,function = <0>; /* in */
+ brcm,pull = <0>; /* none */
+ };
+ };
+ };
+
+ fragment@2 {
+ target = <&spi0>;
+ __overlay__ {
+ /* needed to avoid dtc warning */
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ads7846: ads7846@1 {
+ compatible = "ti,ads7846";
+ reg = <1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&ads7846_pins>;
+
+ spi-max-frequency = <2000000>;
+ interrupts = <255 2>; /* high-to-low edge triggered */
+ interrupt-parent = <&gpio>;
+ pendown-gpio = <&gpio 255 0>;
+
+ /* driver defaults */
+ ti,x-min = /bits/ 16 <0>;
+ ti,y-min = /bits/ 16 <0>;
+ ti,x-max = /bits/ 16 <0x0FFF>;
+ ti,y-max = /bits/ 16 <0x0FFF>;
+ ti,pressure-min = /bits/ 16 <0>;
+ ti,pressure-max = /bits/ 16 <0xFFFF>;
+ ti,x-plate-ohms = /bits/ 16 <400>;
+ };
+ };
+ };
+ __overrides__ {
+ cs = <&ads7846>,"reg:0";
+ speed = <&ads7846>,"spi-max-frequency:0";
+ penirq = <&ads7846_pins>,"brcm,pins:0", /* REQUIRED */
+ <&ads7846>,"interrupts:0",
+ <&ads7846>,"pendown-gpio:4";
+ penirq_pull = <&ads7846_pins>,"brcm,pull:0";
+ swapxy = <&ads7846>,"ti,swap-xy?";
+ xmin = <&ads7846>,"ti,x-min;0";
+ ymin = <&ads7846>,"ti,y-min;0";
+ xmax = <&ads7846>,"ti,x-max;0";
+ ymax = <&ads7846>,"ti,y-max;0";
+ pmin = <&ads7846>,"ti,pressure-min;0";
+ pmax = <&ads7846>,"ti,pressure-max;0";
+ xohms = <&ads7846>,"ti,x-plate-ohms;0";
+ };
+};