Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cyttsp_core.h
Go to the documentation of this file.
1 /*
2  * Header file for:
3  * Cypress TrueTouch(TM) Standard Product (TTSP) touchscreen drivers.
4  * For use with Cypress Txx3xx parts.
5  * Supported parts include:
6  * CY8CTST341
7  * CY8CTMA340
8  *
9  * Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc.
10  * Copyright (C) 2012 Javier Martinez Canillas <[email protected]>
11  *
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.
16  *
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.
21  *
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.
25  *
26  * Contact Cypress Semiconductor at www.cypress.com <[email protected]>
27  *
28  */
29 
30 
31 #ifndef __CYTTSP_CORE_H__
32 #define __CYTTSP_CORE_H__
33 
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>
40 
41 #define CY_NUM_RETRY 16 /* max number of retries for read ops */
42 
43 struct cyttsp_tch {
45  u8 z;
46 } __packed;
47 
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;
64 } __packed;
65 
66 
67 /* TTSP System Information interface definition */
72  u8 cid[3];
74  u8 uid[8];
88 };
89 
90 /* TTSP Bootloader Register Map interface definition */
91 #define CY_BL_CHKSUM_OK 0x01
109 };
110 
111 struct cyttsp;
112 
115  int (*write)(struct cyttsp *ts,
116  u8 addr, u8 length, const void *values);
117  int (*read)(struct cyttsp *ts, u8 addr, u8 length, void *values);
118 };
119 
124 };
125 
126 struct cyttsp {
127  struct device *dev;
128  int irq;
129  struct input_dev *input;
130  char phys[32];
132  const struct cyttsp_bus_ops *bus_ops;
138  bool suspended;
139 
141 };
142 
143 struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
144  struct device *dev, int irq, size_t xfer_buf_size);
145 void cyttsp_remove(struct cyttsp *ts);
146 
147 extern const struct dev_pm_ops cyttsp_pm_ops;
148 
149 #endif /* __CYTTSP_CORE_H__ */