summaryrefslogtreecommitdiff
path: root/include/linux/i2c/focaltech_ex_fun.h
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
committerYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
commit8e4bff4cab0ddac6060645b0715210484d02ff40 (patch)
tree3a5c3024371a04692a3a6d9974d001cdff8ebf84 /include/linux/i2c/focaltech_ex_fun.h
Initial file dump from open source releaseHEADmaster
Diffstat (limited to 'include/linux/i2c/focaltech_ex_fun.h')
-rw-r--r--include/linux/i2c/focaltech_ex_fun.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/linux/i2c/focaltech_ex_fun.h b/include/linux/i2c/focaltech_ex_fun.h
new file mode 100644
index 00000000..21b0f54f
--- /dev/null
+++ b/include/linux/i2c/focaltech_ex_fun.h
@@ -0,0 +1,63 @@
+#ifndef __FOCALTECH_EX_FUN_H__
+#define __FOCALTECH_EX_FUN_H__
+
+#include <linux/i2c.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/kernel.h>
+#include <linux/semaphore.h>
+#include <linux/mutex.h>
+#include <linux/interrupt.h>
+#ifndef CONFIG_64BIT
+#include <mach/irqs.h>
+#endif
+#include <linux/syscalls.h>
+#include <asm/unistd.h>
+#include <asm/uaccess.h>
+#include <linux/fs.h>
+#include <linux/string.h>
+
+#define FT_UPGRADE_AA 0xAA
+#define FT_UPGRADE_55 0x55
+
+#define BL_VERSION_LZ4 0
+#define BL_VERSION_Z7 1
+#define BL_VERSION_GZF 2
+
+
+/*****************************************************************************/
+#define PAGE_SIZE 128
+#define FTS_PACKET_LENGTH 128
+#define FTS_SETTING_BUF_LEN 128
+#define FTS_DMA_BUF_SIZE 1024
+
+#define FTS_UPGRADE_LOOP 30
+
+#define FTS_FACTORYMODE_VALUE 0x40
+#define FTS_WORKMODE_VALUE 0x00
+
+/*create sysfs for debug*/
+int fts_create_sysfs(struct i2c_client * client);
+
+void fts_release_sysfs(struct i2c_client * client);
+int ft5x0x_create_apk_debug_channel(struct i2c_client *client);
+void ft5x0x_release_apk_debug_channel(void);
+int fts_ctpm_auto_upgrade(struct i2c_client *client);
+
+/*
+*fts_write_reg- write register
+*@client: handle of i2c
+*@regaddr: register address
+*@regvalue: register value
+*
+*/
+
+int fts_i2c_Read(struct i2c_client *client, char *writebuf,int writelen, char *readbuf, int readlen);
+
+int fts_i2c_Write(struct i2c_client *client, char *writebuf, int writelen);
+
+int fts_write_reg(struct i2c_client * client,u8 regaddr, u8 regvalue);
+
+int fts_read_reg(struct i2c_client * client,u8 regaddr, u8 *regvalue);
+
+#endif