blob: b96ba84de7d658534d48a3ed65a911f7c85b3cac [file] [log] [blame]
Joonyoung Shim4cf51c32010-07-14 21:55:30 -07001/*
Iiro Valkonen7686b102011-02-02 23:21:58 -08002 * Atmel maXTouch Touchscreen driver
Joonyoung Shim4cf51c32010-07-14 21:55:30 -07003 *
4 * Copyright (C) 2010 Samsung Electronics Co.Ltd
5 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
Duy Truong60ffff42013-02-16 12:21:03 -08006 * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
Joonyoung Shim4cf51c32010-07-14 21:55:30 -07007 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
Iiro Valkonen7686b102011-02-02 23:21:58 -080014#ifndef __LINUX_ATMEL_MXT_TS_H
15#define __LINUX_ATMEL_MXT_TS_H
Joonyoung Shim4cf51c32010-07-14 21:55:30 -070016
Iiro Valkonen71749f52011-02-15 13:36:52 -080017#include <linux/types.h>
18
Joonyoung Shim4cf51c32010-07-14 21:55:30 -070019/* Orient */
Iiro Valkonen7686b102011-02-02 23:21:58 -080020#define MXT_NORMAL 0x0
21#define MXT_DIAGONAL 0x1
22#define MXT_HORIZONTAL_FLIP 0x2
23#define MXT_ROTATED_90_COUNTER 0x3
24#define MXT_VERTICAL_FLIP 0x4
25#define MXT_ROTATED_90 0x5
26#define MXT_ROTATED_180 0x6
27#define MXT_DIAGONAL_COUNTER 0x7
Joonyoung Shim4cf51c32010-07-14 21:55:30 -070028
Mohan Pallaka382d3ce2012-01-02 20:24:28 +080029/* MXT_TOUCH_KEYARRAY_T15 */
30#define MXT_KEYARRAY_MAX_KEYS 32
31
Anirudh Ghayal6c3b37b2012-02-23 18:39:42 -080032/* Bootoader IDs */
33#define MXT_BOOTLOADER_ID_224 0x0A
34#define MXT_BOOTLOADER_ID_224E 0x06
35#define MXT_BOOTLOADER_ID_1386 0x01
36#define MXT_BOOTLOADER_ID_1386E 0x10
37
Jing Lindc4413c2012-01-16 15:22:52 -080038/* Config data for a given maXTouch controller with a specific firmware */
39struct mxt_config_info {
Iiro Valkonen71749f52011-02-15 13:36:52 -080040 const u8 *config;
41 size_t config_length;
Jing Lindc4413c2012-01-16 15:22:52 -080042 u8 family_id;
43 u8 variant_id;
44 u8 version;
45 u8 build;
Anirudh Ghayal6c3b37b2012-02-23 18:39:42 -080046 u8 bootldr_id;
Anirudh Ghayal0bcb5b52012-02-17 14:58:25 -080047 /* Points to the firmware name to be upgraded to */
48 const char *fw_name;
Jing Lindc4413c2012-01-16 15:22:52 -080049};
50
51/* The platform data for the Atmel maXTouch touchscreen driver */
52struct mxt_platform_data {
53 const struct mxt_config_info *config_array;
54 size_t config_array_size;
Iiro Valkonen71749f52011-02-15 13:36:52 -080055
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -080056 /* touch panel's minimum and maximum coordinates */
57 u32 panel_minx;
58 u32 panel_maxx;
59 u32 panel_miny;
60 u32 panel_maxy;
61
62 /* display's minimum and maximum coordinates */
63 u32 disp_minx;
64 u32 disp_maxx;
65 u32 disp_miny;
66 u32 disp_maxy;
67
Iiro Valkonen919ed892011-02-15 13:36:52 -080068 unsigned long irqflags;
Anirudh Ghayala498e4d2011-08-09 19:10:12 +053069 bool i2c_pull_up;
Amy Maloche21115eb2011-11-02 09:04:37 -070070 bool digital_pwr_regulator;
Amy Maloche08266db2011-11-04 11:07:16 -070071 int reset_gpio;
Mohan Pallakad96f5032012-06-18 22:49:10 +053072 u32 reset_gpio_flags;
Amy Maloche08266db2011-11-04 11:07:16 -070073 int irq_gpio;
Mohan Pallakad96f5032012-06-18 22:49:10 +053074 u32 irq_gpio_flags;
Mohan Pallaka382d3ce2012-01-02 20:24:28 +080075 int *key_codes;
Mohan Pallaka63a5f652012-09-21 16:51:44 +053076 bool need_calibration;
Sreenivasulu Chalam Charlaa339ef72012-09-20 08:25:04 +053077 bool no_force_update;
Anirudh Ghayala498e4d2011-08-09 19:10:12 +053078
Jing Lin2f863172011-10-17 10:56:58 -070079 u8(*read_chg) (void);
Anirudh Ghayala498e4d2011-08-09 19:10:12 +053080 int (*init_hw) (bool);
81 int (*power_on) (bool);
Joonyoung Shim4cf51c32010-07-14 21:55:30 -070082};
83
Iiro Valkonen7686b102011-02-02 23:21:58 -080084#endif /* __LINUX_ATMEL_MXT_TS_H */