| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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 |
|---|
| 17 | 4 | * |
|---|
| 18 | 5 | * Copyright 2004 Arnaud Patard <arnaud.patard@rtp-net.org> |
|---|
| 19 | 6 | * Copyright 2008 Ben Dooks <ben-linux@fluff.org> |
|---|
| .. | .. |
|---|
| 26 | 13 | #include <linux/errno.h> |
|---|
| 27 | 14 | #include <linux/kernel.h> |
|---|
| 28 | 15 | #include <linux/module.h> |
|---|
| 29 | | -#include <linux/gpio.h> |
|---|
| 30 | 16 | #include <linux/input.h> |
|---|
| 31 | 17 | #include <linux/delay.h> |
|---|
| 32 | 18 | #include <linux/interrupt.h> |
|---|
| .. | .. |
|---|
| 34 | 20 | #include <linux/clk.h> |
|---|
| 35 | 21 | #include <linux/io.h> |
|---|
| 36 | 22 | |
|---|
| 37 | | -#include <plat/adc.h> |
|---|
| 38 | | -#include <plat/regs-adc.h> |
|---|
| 23 | +#include <linux/soc/samsung/s3c-adc.h> |
|---|
| 39 | 24 | #include <linux/platform_data/touchscreen-s3c2410.h> |
|---|
| 40 | 25 | |
|---|
| 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 | + |
|---|
| 41 | 60 | #define TSC_SLEEP (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0)) |
|---|
| 42 | 61 | |
|---|
| 43 | 62 | #define INT_DOWN (0) |
|---|