diff options
Diffstat (limited to 'drivers/input/touchscreen')
| -rw-r--r-- | drivers/input/touchscreen/h3600_ts_input.c | 494 | ||||
| -rw-r--r-- | drivers/input/touchscreen/panjit_i2c.c | 361 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rm31080a_ts.c | 1370 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/Makefile | 18 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_bus.c | 315 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_dev.c | 428 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_driver.c | 1354 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_driver.h | 109 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_f01.c | 775 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_f09.c | 298 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_f11.c | 1513 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_f19.c | 1419 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_f34.c | 821 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_f54.c | 1347 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_i2c.c | 421 | ||||
| -rw-r--r-- | drivers/input/touchscreen/rmi4/rmi_spi.c | 869 | ||||
| -rw-r--r-- | drivers/input/touchscreen/synaptics_i2c_rmi.c | 699 |
17 files changed, 12611 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c new file mode 100644 index 00000000000..211811ae552 --- /dev/null +++ b/drivers/input/touchscreen/h3600_ts_input.c | |||
| @@ -0,0 +1,494 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com | ||
| 3 | * | ||
| 4 | * Sponsored by Transvirtual Technology. | ||
| 5 | * | ||
| 6 | * Derived from the code in h3600_ts.[ch] by Charles Flynn | ||
| 7 | */ | ||
| 8 | |||
| 9 | /* | ||
| 10 | * Driver for the h3600 Touch Screen and other Atmel controlled devices. | ||
| 11 | */ | ||
| 12 | |||
| 13 | /* | ||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License as published by | ||
| 16 | * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | * (at your option) any later version. | ||
| 18 | * | ||
| 19 | * This program is distributed in the hope that it will be useful, | ||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | * GNU General Public License for more details. | ||
| 23 | * | ||
| 24 | * You should have received a copy of the GNU General Public License | ||
| 25 | * along with this program; if not, write to the Free Software | ||
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 27 | * | ||
| 28 | * Should you need to contact me, the author, you can do so by | ||
| 29 | * e-mail - mail your message to <jsimmons@transvirtual.com>. | ||
| 30 | */ | ||
| 31 | |||
| 32 | #include <linux/errno.h> | ||
| 33 | #include <linux/kernel.h> | ||
| 34 | #include <linux/module.h> | ||
| 35 | #include <linux/slab.h> | ||
| 36 | #include <linux/input.h> | ||
| 37 | #include <linux/serio.h> | ||
| 38 | #include <linux/init.h> | ||
| 39 | #include <linux/delay.h> | ||
| 40 | |||
| 41 | /* SA1100 serial defines */ | ||
| 42 | #include <mach/hardware.h> | ||
| 43 | #include <mach/irqs.h> | ||
| 44 | |||
| 45 | #define DRIVER_DESC "H3600 touchscreen driver" | ||
| 46 | |||
| 47 | MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>"); | ||
| 48 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
| 49 | MODULE_LICENSE("GPL"); | ||
| 50 | |||
| 51 | /* | ||
| 52 | * Definitions & global arrays. | ||
| 53 | */ | ||
| 54 | |||
| 55 | /* The start and end of frame characters SOF and EOF */ | ||
| 56 | #define CHAR_SOF 0x02 | ||
| 57 | #define CHAR_EOF 0x03 | ||
| 58 | #define FRAME_OVERHEAD 3 /* CHAR_SOF,CHAR_EOF,LENGTH = 3 */ | ||
| 59 | |||
| 60 | /* | ||
| 61 | Atmel events and response IDs contained in frame. | ||
| 62 | Programmer has no control over these numbers. | ||
| 63 | TODO there are holes - specifically 1,7,0x0a | ||
| 64 | */ | ||
| 65 | #define VERSION_ID 0 /* Get Version (request/response) */ | ||
| 66 | #define KEYBD_ID 2 /* Keyboard (event) */ | ||
| 67 | #define TOUCHS_ID 3 /* Touch Screen (event)*/ | ||
| 68 | #define EEPROM_READ_ID 4 /* (request/response) */ | ||
| 69 | #define EEPROM_WRITE_ID 5 /* (request/response) */ | ||
| 70 | #define THERMAL_ID 6 /* (request/response) */ | ||
| 71 | #define NOTIFY_LED_ID 8 /* (request/response) */ | ||
| 72 | #define BATTERY_ID 9 /* (request/response) */ | ||
| 73 | #define SPI_READ_ID 0x0b /* ( request/response) */ | ||
| 74 | #define SPI_WRITE_ID 0x0c /* ( request/response) */ | ||
| 75 | #define FLITE_ID 0x0d /* backlight ( request/response) */ | ||
| 76 | #define STX_ID 0xa1 /* extension pack status (req/resp) */ | ||
| 77 | |||
| 78 | #define MAX_ID 14 | ||
| 79 | |||
| 80 | #define H3600_MAX_LENGTH 16 | ||
| 81 | #define H3600_KEY 0xf | ||
| 82 | |||
| 83 | #define H3600_SCANCODE_RECORD 1 /* 1 -> record button */ | ||
| 84 | #define H3600_SCANCODE_CALENDAR 2 /* 2 -> calendar */ | ||
| 85 | #define H3600_SCANCODE_CONTACTS 3 /* 3 -> contact */ | ||
| 86 | #define H3600_SCANCODE_Q 4 /* 4 -> Q button */ | ||
| 87 | #define H3600_SCANCODE_START 5 /* 5 -> start menu */ | ||
| 88 | #define H3600_SCANCODE_UP 6 /* 6 -> up */ | ||
| 89 | #define H3600_SCANCODE_RIGHT 7 /* 7 -> right */ | ||
| 90 | #define H3600_SCANCODE_LEFT 8 /* 8 -> left */ | ||
| 91 | #define H3600_SCANCODE_DOWN 9 /* 9 -> down */ | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Per-touchscreen data. | ||
| 95 | */ | ||
| 96 | struct h3600_dev { | ||
| 97 | struct input_dev *dev; | ||
| 98 | struct serio *serio; | ||
| 99 | unsigned char event; /* event ID from packet */ | ||
| 100 | unsigned char chksum; | ||
| 101 | unsigned char len; | ||
| 102 | unsigned char idx; | ||
| 103 | unsigned char buf[H3600_MAX_LENGTH]; | ||
| 104 | char phys[32]; | ||
| 105 | }; | ||
| 106 | |||
| 107 | static irqreturn_t action_button_handler(int irq, void *dev_id) | ||
| 108 | { | ||
| 109 | int down = (GPLR & GPIO_BITSY_ACTION_BUTTON) ? 0 : 1; | ||
| 110 | struct input_dev *dev = dev_id; | ||
| 111 | |||
| 112 | input_report_key(dev, KEY_ENTER, down); | ||
| 113 | input_sync(dev); | ||
| 114 | |||
| 115 | return IRQ_HANDLED; | ||
| 116 | } | ||
| 117 | |||
| 118 | static irqreturn_t npower_button_handler(int irq, void *dev_id) | ||
| 119 | { | ||
| 120 | int down = (GPLR & GPIO_BITSY_NPOWER_BUTTON) ? 0 : 1; | ||
| 121 | struct input_dev *dev = dev_id; | ||
| 122 | |||
| 123 | /* | ||
| 124 | * This interrupt is only called when we release the key. So we have | ||
| 125 | * to fake a key press. | ||
| 126 | */ | ||
| 127 | input_report_key(dev, KEY_SUSPEND, 1); | ||
| 128 | input_report_key(dev, KEY_SUSPEND, down); | ||
| 129 | input_sync(dev); | ||
| 130 | |||
| 131 | return IRQ_HANDLED; | ||
| 132 | } | ||
| 133 | |||
| 134 | #ifdef CONFIG_PM | ||
| 135 | |||
| 136 | static int flite_brightness = 25; | ||
| 137 | |||
| 138 | enum flite_pwr { | ||
| 139 | FLITE_PWR_OFF = 0, | ||
| 140 | FLITE_PWR_ON = 1 | ||
| 141 | }; | ||
| 142 | |||
| 143 | /* | ||
| 144 | * h3600_flite_power: enables or disables power to frontlight, using last bright */ | ||
| 145 | unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr) | ||
| 146 | { | ||
| 147 | unsigned char brightness = (pwr == FLITE_PWR_OFF) ? 0 : flite_brightness; | ||
| 148 | struct h3600_dev *ts = input_get_drvdata(dev); | ||
| 149 | |||
| 150 | /* Must be in this order */ | ||
| 151 | serio_write(ts->serio, 1); | ||
| 152 | serio_write(ts->serio, pwr); | ||
| 153 | serio_write(ts->serio, brightness); | ||
| 154 | |||
| 155 | return 0; | ||
| 156 | } | ||
| 157 | |||
| 158 | #endif | ||
| 159 | |||
| 160 | /* | ||
| 161 | * This function translates the native event packets to linux input event | ||
| 162 | * packets. Some packets coming from serial are not touchscreen related. In | ||
| 163 | * this case we send them off to be processed elsewhere. | ||
| 164 | */ | ||
| 165 | static void h3600ts_process_packet(struct h3600_dev *ts) | ||
| 166 | { | ||
| 167 | struct input_dev *dev = ts->dev; | ||
| 168 | static int touched = 0; | ||
| 169 | int key, down = 0; | ||
| 170 | |||
| 171 | switch (ts->event) { | ||
| 172 | /* | ||
| 173 | Buttons - returned as a single byte | ||
| 174 | 7 6 5 4 3 2 1 0 | ||
| 175 | S x x x N N N N | ||
| 176 | |||
| 177 | S switch state ( 0=pressed 1=released) | ||
| 178 | x Unused. | ||
| 179 | NNNN switch number 0-15 | ||
| 180 | |||
| 181 | Note: This is true for non interrupt generated key events. | ||
| 182 | */ | ||
| 183 | case KEYBD_ID: | ||
| 184 | down = (ts->buf[0] & 0x80) ? 0 : 1; | ||
| 185 | |||
