hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/input/touchscreen/s3c2410_ts.c
....@@ -1,19 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Samsung S3C24XX touchscreen driver
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the term of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, write to the Free Software
16
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
174 *
185 * Copyright 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
196 * Copyright 2008 Ben Dooks <ben-linux@fluff.org>
....@@ -26,7 +13,6 @@
2613 #include <linux/errno.h>
2714 #include <linux/kernel.h>
2815 #include <linux/module.h>
29
-#include <linux/gpio.h>
3016 #include <linux/input.h>
3117 #include <linux/delay.h>
3218 #include <linux/interrupt.h>
....@@ -34,10 +20,43 @@
3420 #include <linux/clk.h>
3521 #include <linux/io.h>
3622
37
-#include <plat/adc.h>
38
-#include <plat/regs-adc.h>
23
+#include <linux/soc/samsung/s3c-adc.h>
3924 #include <linux/platform_data/touchscreen-s3c2410.h>
4025
26
+#define S3C2410_ADCCON (0x00)
27
+#define S3C2410_ADCTSC (0x04)
28
+#define S3C2410_ADCDLY (0x08)
29
+#define S3C2410_ADCDAT0 (0x0C)
30
+#define S3C2410_ADCDAT1 (0x10)
31
+#define S3C64XX_ADCUPDN (0x14)
32
+#define S3C2443_ADCMUX (0x18)
33
+#define S3C64XX_ADCCLRINT (0x18)
34
+#define S5P_ADCMUX (0x1C)
35
+#define S3C64XX_ADCCLRINTPNDNUP (0x20)
36
+
37
+/* ADCTSC Register Bits */
38
+#define S3C2443_ADCTSC_UD_SEN (1 << 8)
39
+#define S3C2410_ADCTSC_YM_SEN (1<<7)
40
+#define S3C2410_ADCTSC_YP_SEN (1<<6)
41
+#define S3C2410_ADCTSC_XM_SEN (1<<5)
42
+#define S3C2410_ADCTSC_XP_SEN (1<<4)
43
+#define S3C2410_ADCTSC_PULL_UP_DISABLE (1<<3)
44
+#define S3C2410_ADCTSC_AUTO_PST (1<<2)
45
+#define S3C2410_ADCTSC_XY_PST(x) (((x)&0x3)<<0)
46
+
47
+/* ADCDAT0 Bits */
48
+#define S3C2410_ADCDAT0_UPDOWN (1<<15)
49
+#define S3C2410_ADCDAT0_AUTO_PST (1<<14)
50
+#define S3C2410_ADCDAT0_XY_PST (0x3<<12)
51
+#define S3C2410_ADCDAT0_XPDATA_MASK (0x03FF)
52
+
53
+/* ADCDAT1 Bits */
54
+#define S3C2410_ADCDAT1_UPDOWN (1<<15)
55
+#define S3C2410_ADCDAT1_AUTO_PST (1<<14)
56
+#define S3C2410_ADCDAT1_XY_PST (0x3<<12)
57
+#define S3C2410_ADCDAT1_YPDATA_MASK (0x03FF)
58
+
59
+
4160 #define TSC_SLEEP (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0))
4261
4362 #define INT_DOWN (0)