blob: 500ee6b73af25b806023fab0ac257e9e584bbb10 [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>
Mohan Pallaka382d3ce2012-01-02 20:24:28 +08006 * Copyright (c) 2011-2012, Code Aurora Forum. 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
Jing Lindc4413c2012-01-16 15:22:52 -080032/* Config data for a given maXTouch controller with a specific firmware */
33struct mxt_config_info {
Iiro Valkonen71749f52011-02-15 13:36:52 -080034 const u8 *config;
35 size_t config_length;
Jing Lindc4413c2012-01-16 15:22:52 -080036 u8 family_id;
37 u8 variant_id;
38 u8 version;
39 u8 build;
40};
41
42/* The platform data for the Atmel maXTouch touchscreen driver */
43struct mxt_platform_data {
44 const struct mxt_config_info *config_array;
45 size_t config_array_size;
Iiro Valkonen71749f52011-02-15 13:36:52 -080046
Joonyoung Shim4cf51c32010-07-14 21:55:30 -070047 unsigned int x_size;
48 unsigned int y_size;
Amy Maloche83c385a2012-02-01 10:32:03 +053049 unsigned int touch_x_size;
50 unsigned int touch_y_size;
Iiro Valkonen919ed892011-02-15 13:36:52 -080051 unsigned long irqflags;
Anirudh Ghayala498e4d2011-08-09 19:10:12 +053052 bool i2c_pull_up;
Amy Maloche21115eb2011-11-02 09:04:37 -070053 bool digital_pwr_regulator;
Amy Maloche08266db2011-11-04 11:07:16 -070054 int reset_gpio;
55 int irq_gpio;
Mohan Pallaka382d3ce2012-01-02 20:24:28 +080056 int *key_codes;
Anirudh Ghayala498e4d2011-08-09 19:10:12 +053057
Jing Lin2f863172011-10-17 10:56:58 -070058 u8(*read_chg) (void);
Anirudh Ghayala498e4d2011-08-09 19:10:12 +053059 int (*init_hw) (bool);
60 int (*power_on) (bool);
Joonyoung Shim4cf51c32010-07-14 21:55:30 -070061};
62
Iiro Valkonen7686b102011-02-02 23:21:58 -080063#endif /* __LINUX_ATMEL_MXT_TS_H */