1 #ifndef __LINUX_MFD_NVEC
2 #define __LINUX_MFD_NVEC
4 #include <linux/semaphore.h>
38 struct list_head node
;
47 struct nvec_platform_data
{
60 struct atomic_notifier_head notifier_list
;
61 struct list_head rx_data
, tx_data
;
62 struct notifier_block nvec_status_notifier
;
63 struct work_struct rx_work
, tx_work
;
64 struct nvec_msg
*rx
, *tx
;
66 /* sync write stuff */
67 struct semaphore sync_write_mutex
;
68 struct completion sync_write
;
69 u16 sync_write_pending
;
70 struct nvec_msg
*last_sync_msg
;
73 extern void nvec_write_async(struct nvec_chip
*nvec
, unsigned char *data
, short size
);
75 extern int nvec_register_notifier(struct nvec_chip
*nvec
,
76 struct notifier_block
*nb
, unsigned int events
);
78 extern int nvec_unregister_notifier(struct device
*dev
,
79 struct notifier_block
*nb
, unsigned int events
);
81 const char *nvec_send_msg(unsigned char *src
, unsigned char *dst_size
, how_care care_resp
, void (*rt_handler
)(unsigned char *data
));
84 #define I2C_CNFG_PACKET_MODE_EN (1<<10)
85 #define I2C_CNFG_NEW_MASTER_SFM (1<<11)
86 #define I2C_CNFG_DEBOUNCE_CNT_SHIFT 12
88 #define I2C_SL_CNFG 0x20
89 #define I2C_SL_NEWL (1<<2)
90 #define I2C_SL_NACK (1<<1)
91 #define I2C_SL_RESP (1<<0)
92 #define I2C_SL_IRQ (1<<3)
93 #define END_TRANS (1<<4)
97 #define I2C_SL_RCVD 0x24
98 #define I2C_SL_STATUS 0x28
99 #define I2C_SL_ADDR1 0x2c
100 #define I2C_SL_ADDR2 0x30
101 #define I2C_SL_DELAY_COUNT 0x3c