ARM: rockchip: rk3228: add grf definition
[firefly-linux-kernel-4.4.55.git] / include / linux / bp-auto.h
old mode 100644 (file)
new mode 100755 (executable)
index a2b0a89..602592f
@@ -4,33 +4,45 @@
 #include <linux/wakelock.h>\r
 \r
 struct bp_private_data;\r
-\r
+#define BP_DEV_NAME    "voice_modem"\r
 #define BP_UNKNOW_DATA -1\r
 #define BP_OFF         0\r
 #define BP_ON          1\r
 #define BP_SUSPEND     2\r
 #define BP_WAKE                3\r
 \r
-#define BP_IOCTL_BASE 'm'\r
+#define BP_IOCTL_BASE 0x1a\r
 \r
-#define BP_IOCTL_RESET                 _IOW(BP_IOCTL_BASE, 0x00, int)\r
-#define BP_IOCTL_POWON                 _IOW(BP_IOCTL_BASE, 0x01, int)\r
+#define BP_IOCTL_RESET                 _IOW(BP_IOCTL_BASE, 0x01, int)\r
 #define BP_IOCTL_POWOFF        _IOW(BP_IOCTL_BASE, 0x02, int)\r
-#define BP_IOCTL_WRITE_STATUS  _IOW(BP_IOCTL_BASE, 0x03, int)\r
-#define BP_IOCTL_GET_STATUS    _IOR(BP_IOCTL_BASE, 0x04, int)\r
-#define BP_IOCTL_SET_PVID      _IOW(BP_IOCTL_BASE, 0x05, int)\r
-#define BP_IOCTL_GET_BPID      _IOR(BP_IOCTL_BASE, 0x06, int)\r
+#define BP_IOCTL_POWON                 _IOW(BP_IOCTL_BASE, 0x03, int)\r
+\r
+#define BP_IOCTL_WRITE_STATUS  _IOW(BP_IOCTL_BASE, 0x04, int)\r
+#define BP_IOCTL_GET_STATUS    _IOR(BP_IOCTL_BASE, 0x05, int)\r
+#define BP_IOCTL_SET_PVID      _IOW(BP_IOCTL_BASE, 0x06, int)\r
+#define BP_IOCTL_GET_BPID      _IOR(BP_IOCTL_BASE, 0x07, int)\r
+#define BP_IOCTL_GET_IMEI      _IOR(BP_IOCTL_BASE, 0x08, int)\r
 \r
 enum bp_id{\r
-       BP_ID_INVALID = 0,\r
+       BP_ID_INVALID = 0,//no bp\r
                \r
-       BP_ID_MT6229,\r
-       BP_ID_MU509,\r
-       BP_ID_MI700,\r
-       BP_ID_MW100,\r
-       BP_ID_TD8801,\r
-       \r
-       BP_ID_NUM,\r
+       BP_ID_MT6229,   //1 USI MT6229 WCDMA\r
+       BP_ID_MU509,    //2 huawei MU509 WCDMA\r
+       BP_ID_MI700,    //3 thinkwill MI700 WCDMA\r
+       BP_ID_MW100,    //4 thinkwill MW100 WCDMA\r
+       BP_ID_TD8801,   //5 spreadtrum SC8803 TD-SCDMA\r
+       BP_ID_SC6610,   //6 spreadtrum SC6610 GSM\r
+       BP_ID_M51,      //7 RDA GSM\r
+       BP_ID_MT6250,   //8 ZINN M50  EDGE\r
+       BP_ID_C66A,     //9 ZHIGUAN C66A GSM\r
+       BP_ID_SEW290,   //10 SCV SEW290 WCDMA\r
+       BP_ID_U5501,    //11 LONGSUNG U5501 WCDMA\r
+       BP_ID_U7501,    //12 LONGSUNG U7501 WCDMA/HSPA+\r
+       BP_ID_AW706,    //13 ANICARE AW706 EDGE\r
+       BP_ID_A85XX,    //14 LONGSUNG A8520/A8530 GSM
+    BP_ID_E1230S,    //15 huawei E1230S\r
+
+       BP_ID_NUM,  \r
 };\r
 \r
 \r
@@ -54,14 +66,15 @@ struct bp_platform_data {
        int bp_id;\r
        int (*init_platform_hw)(void);          \r
        int (*exit_platform_hw)(void);  \r
-\r
+       int (*get_bp_id)(void);\r
        int bp_power;\r
        int bp_en;\r
        int bp_reset;\r
        int ap_ready;\r
        int bp_ready;\r
        int ap_wakeup_bp;\r
-       int bp_wakeup_ap;       \r
+       int bp_wakeup_ap;\r
+       int bp_assert;\r
        int bp_usb_en;\r
        int bp_uart_en;\r
        \r
@@ -70,23 +83,25 @@ struct bp_platform_data {
 \r
 \r
 struct bp_operate {\r
-       char *name;\r
-       int bp_id;\r
-       int bp_bus;\r
-       \r
-       int bp_pid;     \r
-       int bp_vid;\r
-       int bp_power;\r
-       int bp_en;\r
-       int bp_reset;\r
-       int ap_ready;\r
-       int bp_ready;\r
-       int ap_wakeup_bp;\r
-       int bp_wakeup_ap;       \r
-       int bp_usb_en;\r
-       int bp_uart_en;\r
-       int trig;\r
+       char *name;     //bp name can be null\r
+       int bp_id;      //bp id the value must be one of enum bp_id\r
+       int bp_bus;     // bp bus the value must be one of enum bp_bus_type\r
        \r
+       int bp_pid;     // the pid of usb device if used usb else the value is BP_UNKNOW_DATA\r
+       int bp_vid;     // the vid of usb device if used usb else the value is BP_UNKNOW_DATA\r
+       int bp_power;//bp power if used GPIO value else the  is BP_UNKNOW_DATA\r
+       int bp_en;//bp power key if used GPIO value else the  is BP_UNKNOW_DATA\r
+       int bp_reset;//bo reset if used GPIO value else the  is BP_UNKNOW_DATA\r
+       int ap_ready;//bp ready  if used GPIO value else the  is BP_UNKNOW_DATA\r
+       int bp_ready;// bp ready  if used GPIO value else the  is BP_UNKNOW_DATA\r
+       int ap_wakeup_bp; //ap wakeup bp  if used GPIO value else the  is BP_UNKNOW_DATA\r
+       int bp_wakeup_ap;// bp wakeup ap  if used GPIO value else the  is BP_UNKNOW_DATA\r
+       int bp_assert;\r
+       int bp_usb_en;//not used\r
+       int bp_uart_en;//not used\r
+       int trig;//if 1:used board gpio define else used bp driver\r
+       int irq;\r
+\r
        int (*active)(struct bp_private_data *bp, int enable);\r
        int (*init)(struct bp_private_data *bp);\r
        int (*reset)(struct bp_private_data *bp);\r
@@ -96,8 +111,7 @@ struct bp_operate {
        int (*read_status)(struct bp_private_data *bp);\r
        int (*write_status)(struct bp_private_data *bp);\r
        int (*suspend)(struct bp_private_data *bp);\r
-       int (*resume)(struct bp_private_data *bp);      \r
-       \r
+       int (*resume)(struct bp_private_data *bp);              \r
        char *misc_name;\r
        struct miscdevice *private_miscdev;\r
        \r
@@ -116,9 +130,7 @@ struct bp_private_data {
        struct miscdevice miscdev;\r
        struct file_operations id_fops;\r
        struct miscdevice id_miscdev;\r
-#ifdef CONFIG_HAS_EARLYSUSPEND\r
-       struct  early_suspend early_suspend;\r
-#endif\r
+\r
 };\r
 \r
 extern int bp_register_slave(struct bp_private_data *bp,\r