aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-24 15:36:56 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-24 15:36:56 -0400
commitb9f12a5d97f652c77ef6803dccd0d40d1290f5be (patch)
tree8f58c8620ffef0d350a5ec022feda492a96b179a /drivers/input/touchscreen
parent9d8dc3e529a19e427fd379118acd132520935c5d (diff)
parent9a3c4145af32125c5ee39c0272662b47307a8323 (diff)
Merge tag 'v3.16-rc6' into next
Merge with mainline to bring in changes to MFD to allow merging ipaq-micro-ts driver.
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/Kconfig14
-rw-r--r--drivers/input/touchscreen/Makefile1
-rw-r--r--drivers/input/touchscreen/atmel_tsadcc.c358
3 files changed, 1 insertions, 372 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 8e07fe8505fd..a23a94bb4bcb 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -555,18 +555,6 @@ config TOUCHSCREEN_TI_AM335X_TSC
555 To compile this driver as a module, choose M here: the 555 To compile this driver as a module, choose M here: the
556 module will be called ti_am335x_tsc. 556 module will be called ti_am335x_tsc.
557 557
558config TOUCHSCREEN_ATMEL_TSADCC
559 tristate "Atmel Touchscreen Interface"
560 depends on ARCH_AT91
561 help
562 Say Y here if you have a 4-wire touchscreen connected to the
563 ADC Controller on your Atmel SoC.
564
565 If unsure, say N.
566
567 To compile this driver as a module, choose M here: the
568 module will be called atmel_tsadcc.
569
570config TOUCHSCREEN_UCB1400 558config TOUCHSCREEN_UCB1400
571 tristate "Philips UCB1400 touchscreen" 559 tristate "Philips UCB1400 touchscreen"
572 depends on AC97_BUS 560 depends on AC97_BUS
@@ -645,7 +633,7 @@ config TOUCHSCREEN_WM9713
645 633
646config TOUCHSCREEN_WM97XX_ATMEL 634config TOUCHSCREEN_WM97XX_ATMEL
647 tristate "WM97xx Atmel accelerated touch" 635 tristate "WM97xx Atmel accelerated touch"
648 depends on TOUCHSCREEN_WM97XX && (AVR32 || ARCH_AT91) 636 depends on TOUCHSCREEN_WM97XX && AVR32
649 help 637 help
650 Say Y here for support for streaming mode with WM97xx touchscreens 638 Say Y here for support for streaming mode with WM97xx touchscreens
651 on Atmel AT91 or AVR32 systems with an AC97C module. 639 on Atmel AT91 or AVR32 systems with an AC97C module.
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 4d479fb0a768..126479d8c29a 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -14,7 +14,6 @@ obj-$(CONFIG_TOUCHSCREEN_AD7879_I2C) += ad7879-i2c.o
14obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI) += ad7879-spi.o 14obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI) += ad7879-spi.o
15obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o 15obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o
16obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o 16obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o
17obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o
18obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o 17obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o
19obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o 18obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o
20obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o 19obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o
diff --git a/drivers/input/touchscreen/atmel_tsadcc.c b/drivers/input/touchscreen/atmel_tsadcc.c
deleted file mode 100644
index a7c9d6967d1e..000000000000
--- a/drivers/input/touchscreen/atmel_tsadcc.c
+++ /dev/null
@@ -1,358 +0,0 @@
1/*
2 * Atmel Touch Screen Driver
3 *
4 * Copyright (c) 2008 ATMEL
5 * Copyright (c) 2008 Dan Liang
6 * Copyright (c) 2008 TimeSys Corporation
7 * Copyright (c) 2008 Justin Waters
8 *
9 * Based on touchscreen code from Atmel Corporation.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15#include <linux/err.h>
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/input.h>
19#include <linux/slab.h>
20#include <linux/interrupt.h>
21#include <linux/clk.h>
22#include <linux/platform_device.h>
23#include <linux/io.h>
24#include <linux/platform_data/atmel.h>
25#include <mach/cpu.h>
26
27/* Register definitions based on AT91SAM9RL64 preliminary draft datasheet */
28
29#define ATMEL_TSADCC_CR 0x00 /* Control register */
30#define ATMEL_TSADCC_SWRST (1 << 0) /* Software Reset*/
31#define ATMEL_TSADCC_START (1 << 1) /* Start conversion */
32
33#define ATMEL_TSADCC_MR 0x04 /* Mode register */
34#define ATMEL_TSADCC_TSAMOD (3 << 0) /* ADC mode */
35#define ATMEL_TSADCC_TSAMOD_ADC_ONLY_MODE (0x0) /* ADC Mode */
36#define ATMEL_TSADCC_TSAMOD_TS_ONLY_MODE (0x1) /* Touch Screen Only Mode */
37#define ATMEL_TSADCC_LOWRES (1 << 4) /* Resolution selection */
38#define ATMEL_TSADCC_SLEEP (1 << 5) /* Sleep mode */
39#define ATMEL_TSADCC_PENDET (1 << 6) /* Pen Detect selection */
40#define ATMEL_TSADCC_PRES (1 << 7) /* Pressure Measurement Selection */
41#define ATMEL_TSADCC_PRESCAL (0x3f << 8) /* Prescalar Rate Selection */
42#define ATMEL_TSADCC_EPRESCAL (0xff << 8) /* Prescalar Rate Selection (Extended) */
43#define ATMEL_TSADCC_STARTUP (0x7f << 16) /* Start Up time */
44#define ATMEL_TSADCC_SHTIM (0xf << 24) /* Sample & Hold time */
45#define ATMEL_TSADCC_PENDBC (0xf << 28) /* Pen Detect debouncing time */
46
47#define ATMEL_TSADCC_TRGR 0x08 /* Trigger register */
48#define ATMEL_TSADCC_TRGMOD (7 << 0) /* Trigger mode */
49#define ATMEL_TSADCC_TRGMOD_NONE (0 << 0)
50#define ATMEL_TSADCC_TRGMOD_EXT_RISING (1 << 0)
51#define ATMEL_TSADCC_TRGMOD_EXT_FALLING (2 << 0)
52#define ATMEL_TSADCC_TRGMOD_EXT_ANY (3 << 0)
53#define ATMEL_TSADCC_TRGMOD_PENDET (4 << 0)
54#define ATMEL_TSADCC_TRGMOD_PERIOD (5 << 0)
55#define ATMEL_TSADCC_TRGMOD_CONTINUOUS (6 << 0)
56#define ATMEL_TSADCC_TRGPER (0xffff << 16) /* Trigger period */
57
58#define ATMEL_TSADCC_TSR 0x0C /* Touch Screen register */
59#define ATMEL_TSADCC_TSFREQ (0xf << 0) /* TS Frequency in Interleaved mode */
60#define ATMEL_TSADCC_TSSHTIM (0xf << 24) /* Sample & Hold time */
61
62#define ATMEL_TSADCC_CHER 0x10 /* Channel Enable register */
63#define ATMEL_TSADCC_CHDR 0x14 /* Channel Disable register */
64#define ATMEL_TSADCC_CHSR 0x18 /* Channel Status register */
65#define ATMEL_TSADCC_CH(n) (1 << (n)) /* Channel number */
66
67#define ATMEL_TSADCC_SR 0x1C /* Status register */
68#define ATMEL_TSADCC_EOC(n) (1 << ((n)+0)) /* End of conversion for channel N */
69#define ATMEL_TSADCC_OVRE(n) (1 << ((n)+8)) /* Overrun error for channel N */
70#define ATMEL_TSADCC_DRDY (1 << 16) /* Data Ready */
71#define ATMEL_TSADCC_GOVRE (1 << 17) /* General Overrun Error */
72#define ATMEL_TSADCC_ENDRX (1 << 18) /* End of RX Buffer */
73#define ATMEL_TSADCC_RXBUFF (1 << 19) /* TX Buffer full */
74#define ATMEL_TSADCC_PENCNT (1 << 20) /* Pen contact */
75#define ATMEL_TSADCC_NOCNT (1 << 21) /* No contact */
76
77#define ATMEL_TSADCC_LCDR 0x20 /* Last Converted Data register */
78#define ATMEL_TSADCC_DATA (0x3ff << 0) /* Channel data */
79
80#define ATMEL_TSADCC_IER 0x24 /* Interrupt Enable register */
81#define ATMEL_TSADCC_IDR 0x28 /* Interrupt Disable register */
82#define ATMEL_TSADCC_IMR 0x2C /* Interrupt Mask register */
83#define ATMEL_TSADCC_CDR0 0x30 /* Channel Data 0 */
84#define ATMEL_TSADCC_CDR1 0x34 /* Channel Data 1 */
85#define ATMEL_TSADCC_CDR2 0x38 /* Channel Data 2 */
86#define ATMEL_TSADCC_CDR3 0x3C /* Channel Data 3 */
87#define ATMEL_TSADCC_CDR4 0x40 /* Channel Data 4 */
88#define ATMEL_TSADCC_CDR5 0x44 /* Channel Data 5 */
89
90#define ATMEL_TSADCC_XPOS 0x50
91#define ATMEL_TSADCC_Z1DAT 0x54
92#define ATMEL_TSADCC_Z2DAT 0x58
93
94#define PRESCALER_VAL(x) ((x) >> 8)
95
96#define ADC_DEFAULT_CLOCK 100000
97
98struct atmel_tsadcc {
99 struct input_dev *input;
100 char phys[32];
101 struct clk *clk;
102 int irq;
103 unsigned int prev_absx;
104 unsigned int prev_absy;
105 unsigned char bufferedmeasure;
106};
107
108static void __iomem *tsc_base;
109
110#define atmel_tsadcc_read(reg) __raw_readl(tsc_base + (reg))
111#define atmel_tsadcc_write(reg, val) __raw_writel((val), tsc_base + (reg))
112
113static irqreturn_t atmel_tsadcc_interrupt(int irq, void *dev)
114{
115 struct atmel_tsadcc *ts_dev = (struct atmel_tsadcc *)dev;
116 struct input_dev *input_dev = ts_dev->input;
117
118 unsigned int status;
119 unsigned int reg;
120
121 status = atmel_tsadcc_read(ATMEL_TSADCC_SR);
122 status &= atmel_tsadcc_read(ATMEL_TSADCC_IMR);
123
124 if (status & ATMEL_TSADCC_NOCNT) {
125 /* Contact lost */