3 * Cypress TrueTouch(TM) Standard Product (TTSP) touchscreen drivers.
4 * For use with Cypress Txx3xx parts.
5 * Supported parts include:
9 * Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc.
10 * Copyright (C) 2012 Javier Martinez Canillas <javier@dowhile0.org>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * version 2, and only version 2, as published by the
15 * Free Software Foundation.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 * Contact Cypress Semiconductor at www.cypress.com <kev@cypress.com>
31 #ifndef __CYTTSP_CORE_H__
32 #define __CYTTSP_CORE_H__
34 #include <linux/kernel.h>
35 #include <linux/err.h>
36 #include <linux/module.h>
37 #include <linux/types.h>
38 #include <linux/device.h>
39 #include <linux/input/cyttsp.h>
41 #define CY_NUM_RETRY 16 /* max number of retries for read ops */
48 /* TrueTouch Standard Product Gen3 interface definition */
49 struct cyttsp_xydata {
53 struct cyttsp_tch tch1;
55 struct cyttsp_tch tch2;
58 struct cyttsp_tch tch3;
60 struct cyttsp_tch tch4;
67 /* TTSP System Information interface definition */
68 struct cyttsp_sysinfo_data {
90 /* TTSP Bootloader Register Map interface definition */
91 #define CY_BL_CHKSUM_OK 0x01
92 struct cyttsp_bootloader_data {
113 struct cyttsp_bus_ops {
115 int (*write)(struct device *dev, u8 *xfer_buf, u16 addr, u8 length,
117 int (*read)(struct device *dev, u8 *xfer_buf, u16 addr, u8 length,
130 struct input_dev *input;
132 const struct cyttsp_bus_ops *bus_ops;
133 struct cyttsp_bootloader_data bl_data;
134 struct cyttsp_sysinfo_data sysinfo_data;
135 struct cyttsp_xydata xy_data;
136 struct completion bl_ready;
137 enum cyttsp_state state;
140 struct gpio_desc *reset_gpio;
148 u8 xfer_buf[] ____cacheline_aligned;
151 struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
152 struct device *dev, int irq, size_t xfer_buf_size);
154 int cyttsp_i2c_write_block_data(struct device *dev, u8 *xfer_buf, u16 addr,
155 u8 length, const void *values);
156 int cyttsp_i2c_read_block_data(struct device *dev, u8 *xfer_buf, u16 addr,
157 u8 length, void *values);
158 extern const struct dev_pm_ops cyttsp_pm_ops;
160 #endif /* __CYTTSP_CORE_H__ */