3 #include <linux/miscdevice.h>
\r
4 #include <linux/wakelock.h>
\r
6 struct bp_private_data;
\r
7 #define BP_DEV_NAME "voice_modem"
\r
8 #define BP_UNKNOW_DATA -1
\r
11 #define BP_SUSPEND 2
\r
14 #define BP_IOCTL_BASE 0x1a
\r
16 #define BP_IOCTL_RESET _IOW(BP_IOCTL_BASE, 0x01, int)
\r
17 #define BP_IOCTL_POWOFF _IOW(BP_IOCTL_BASE, 0x02, int)
\r
18 #define BP_IOCTL_POWON _IOW(BP_IOCTL_BASE, 0x03, int)
\r
20 #define BP_IOCTL_WRITE_STATUS _IOW(BP_IOCTL_BASE, 0x04, int)
\r
21 #define BP_IOCTL_GET_STATUS _IOR(BP_IOCTL_BASE, 0x05, int)
\r
22 #define BP_IOCTL_SET_PVID _IOW(BP_IOCTL_BASE, 0x06, int)
\r
23 #define BP_IOCTL_GET_BPID _IOR(BP_IOCTL_BASE, 0x07, int)
\r
24 #define BP_IOCTL_GET_IMEI _IOR(BP_IOCTL_BASE, 0x08, int)
\r
27 BP_ID_INVALID = 0,//no bp
\r
29 BP_ID_MT6229, //USI MT6229 WCDMA
\r
30 BP_ID_MU509, //huawei MU509 WCDMA
\r
31 BP_ID_MI700, //thinkwill MI700 WCDMA
\r
32 BP_ID_MW100, //thinkwill MW100 WCDMA
\r
33 BP_ID_TD8801, //spreadtrum SC8803 TD-SCDMA
\r
34 BP_ID_SC6610, //spreadtrum SC6610 GSM
\r
35 BP_ID_M50, //spreadtrum RDA GSM
\r
36 BP_ID_MT6250, //ZINN M50 EDGE
\r
37 BP_ID_C66A, //zhongben
\r
44 BP_BUS_TYPE_INVALID = 0,
\r
50 BP_BUS_TYPE_USB_UART,
\r
51 BP_BUS_TYPE_SPI_UART,
\r
52 BP_BUS_TYPE_SDIO_UART,
\r
57 struct bp_platform_data {
\r
60 int (*init_platform_hw)(void);
\r
61 int (*exit_platform_hw)(void);
\r
62 int (*get_bp_id)(void);
\r
79 char *name; //bp name can be null
\r
80 int bp_id; //bp id the value must be one of enum bp_id
\r
81 int bp_bus; // bp bus the value must be one of enum bp_bus_type
\r
83 int bp_pid; // the pid of usb device if used usb else the value is BP_UNKNOW_DATA
\r
84 int bp_vid; // the vid of usb device if used usb else the value is BP_UNKNOW_DATA
\r
85 int bp_power;//bp power if used GPIO value else the is BP_UNKNOW_DATA
\r
86 int bp_en;//bp power key if used GPIO value else the is BP_UNKNOW_DATA
\r
87 int bp_reset;//bo reset if used GPIO value else the is BP_UNKNOW_DATA
\r
88 int ap_ready;//bp ready if used GPIO value else the is BP_UNKNOW_DATA
\r
89 int bp_ready;// bp ready if used GPIO value else the is BP_UNKNOW_DATA
\r
90 int ap_wakeup_bp; //ap wakeup bp if used GPIO value else the is BP_UNKNOW_DATA
\r
91 int bp_wakeup_ap;// bp wakeup ap if used GPIO value else the is BP_UNKNOW_DATA
\r
93 int bp_usb_en;//not used
\r
94 int bp_uart_en;//not used
\r
95 int trig;//if 1:used board gpio define else used bp driver
\r
98 int (*active)(struct bp_private_data *bp, int enable);
\r
99 int (*init)(struct bp_private_data *bp);
\r
100 int (*reset)(struct bp_private_data *bp);
\r
101 int (*ap_wake_bp)(struct bp_private_data *bp, int wake);
\r
102 int (*bp_wake_ap)(struct bp_private_data *bp);
\r
103 int (*shutdown)(struct bp_private_data *bp);
\r
104 int (*read_status)(struct bp_private_data *bp);
\r
105 int (*write_status)(struct bp_private_data *bp);
\r
106 int (*suspend)(struct bp_private_data *bp);
\r
107 int (*resume)(struct bp_private_data *bp);
\r
109 struct miscdevice *private_miscdev;
\r
114 struct bp_private_data {
\r
115 struct device *dev;
\r
117 int suspend_status;
\r
118 struct wake_lock bp_wakelock;
\r
119 struct delayed_work wakeup_work; /*report second event*/
\r
120 struct bp_platform_data *pdata;
\r
121 struct bp_operate *ops;
\r
122 struct file_operations fops;
\r
123 struct miscdevice miscdev;
\r
124 struct file_operations id_fops;
\r
125 struct miscdevice id_miscdev;
\r
129 extern int bp_register_slave(struct bp_private_data *bp,
\r
130 struct bp_platform_data *slave_pdata,
\r
131 struct bp_operate *(*get_bp_ops)(void));
\r
134 extern int bp_unregister_slave(struct bp_private_data *bp,
\r
135 struct bp_platform_data *slave_pdata,
\r
136 struct bp_operate *(*get_bp_ops)(void));
\r