1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Cypress TrueTouch(TM) Standard Product (TTSP) touchscreen drivers.
5 * For use with Cypress Txx3xx parts.
6 * Supported parts include:
10 * Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc.
17 #ifndef __CYTTSP_CORE_H__
18 #define __CYTTSP_CORE_H__
20 #include <linux/kernel.h>
21 #include <linux/err.h>
22 #include <linux/module.h>
23 #include <linux/types.h>
24 #include <linux/device.h>
25 #include <linux/regulator/consumer.h>
27 #define CY_NUM_RETRY 16 /* max number of retries for read ops */
34 /* TrueTouch Standard Product Gen3 interface definition */
35 struct cyttsp_xydata {
39 struct cyttsp_tch tch1;
41 struct cyttsp_tch tch2;
44 struct cyttsp_tch tch3;
46 struct cyttsp_tch tch4;
53 /* TTSP System Information interface definition */
54 struct cyttsp_sysinfo_data {
76 /* TTSP Bootloader Register Map interface definition */
77 #define CY_BL_CHKSUM_OK 0x01
78 struct cyttsp_bootloader_data {
99 struct cyttsp_bus_ops {
101 int (*write)(struct device *dev, u8 *xfer_buf, u16 addr, u8 length,
103 int (*read)(struct device *dev, u8 *xfer_buf, u16 addr, u8 length,
116 struct input_dev *input;
117 const struct cyttsp_bus_ops *bus_ops;
118 struct cyttsp_bootloader_data bl_data;
119 struct cyttsp_sysinfo_data sysinfo_data;
120 struct cyttsp_xydata xy_data;
121 struct completion bl_ready;
122 enum cyttsp_state state;
125 struct regulator_bulk_data regulators[2];
126 struct gpio_desc *reset_gpio;
134 u8 xfer_buf[] ____cacheline_aligned;
137 struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
138 struct device *dev, int irq, size_t xfer_buf_size);
140 int cyttsp_i2c_write_block_data(struct device *dev, u8 *xfer_buf, u16 addr,
141 u8 length, const void *values);
142 int cyttsp_i2c_read_block_data(struct device *dev, u8 *xfer_buf, u16 addr,
143 u8 length, void *values);
144 extern const struct dev_pm_ops cyttsp_pm_ops;
146 #endif /* __CYTTSP_CORE_H__ */