blob: 8a4558bd0eb8afe77bcb387dcc3837f149e9e3ef [file] [log] [blame]
Flemmardd3990082013-04-25 20:53:01 -07001#ifndef CY8C_CS_I2C_H
2#define CY8C_CS_I2C_H
3
4
5#include <linux/types.h>
6
7#define CYPRESS_CS_NAME "CY8C20224"
8#define CYPRESS_SS_NAME "CY8C21x34B"
9
10#if defined(CONFIG_TOUCH_KEY_FILTER)
11#include <linux/notifier.h>
12#endif
13
14#define CS_STATUS (uint8_t) 0x00
15
16#define CS_FW_VERSION (uint8_t) 0x01
17#define CS_FW_CONFIG (uint8_t) 0xAA
18
19#define CS_IDAC_BTN_BASE (uint8_t) 0x02
20#define CS_IDAC_BTN_PAD1 (uint8_t) 0x02
21#define CS_IDAC_BTN_PAD2 (uint8_t) 0x03
22#define CS_IDAC_BTN_PAD3 (uint8_t) 0x04
23#define CS_IDAC_BTN_PAD4 (uint8_t) 0x05
24
25#define CS_MODE (uint8_t) 0x06
26#define CS_DTIME (uint8_t) 0x07
27#define CS_SLEEPTIME (uint8_t) 0x08
28#define CS_FW_CHIPID (uint8_t) 0x0A
29#define CS_FW_KEYCFG (uint8_t) 0x0B
30
31#define CS_SELECT (uint8_t) 0x0C
32#define CS_BL_HB (uint8_t) 0x0D
33#define CS_BL_LB (uint8_t) 0x0E
34#define CS_RC_HB (uint8_t) 0x0F
35#define CS_RC_LB (uint8_t) 0x10
36#define CS_DF_HB (uint8_t) 0x11
37#define CS_DF_LB (uint8_t) 0x12
38#define CS_INT_STATUS (uint8_t) 0x13
39
40
41#define CS_CMD_BASELINE (0x55)
42#define CS_CMD_DSLEEP (0x02)
43#define CS_CMD_BTN1 (0xA0)
44#define CS_CMD_BTN2 (0xA1)
45#define CS_CMD_BTN3 (0xA2)
46#define CS_CMD_BTN4 (0xA3)
47
48#define CS_CHIPID (0x36)
49#define CS_KEY_4 (0x04)
50#define CS_KEY_3 (0x03)
51
52#define CS_FUNC_PRINTRAW (0x01)
53
54#define ENABLE_CAP_ONLY_3KEY 1
55
56struct infor {
57 uint8_t config;
58 uint16_t chipid;
59 uint16_t version;
60};
61
62struct cy8c_i2c_cs_platform_data {
63 struct infor id;
64 uint16_t gpio_rst;
65 uint16_t gpio_irq;
66 int (*power)(int on);
67 int (*reset)(void);
68 int keycode[4];
69 void (*gpio_init)(void);
70 int func_support;
71 int prj_info;
72};
73
74
75#if defined(CONFIG_TOUCH_KEY_FILTER)
76extern struct blocking_notifier_head touchkey_notifier_list;
77
78extern int register_notifier_by_touchkey(struct notifier_block *nb);
79extern int unregister_notifier_by_touchkey(struct notifier_block *nb);
80#endif
81
82#endif