update u7501
author赵子初 <zzc@rock-chips.com>
Fri, 7 Jun 2013 03:22:52 +0000 (11:22 +0800)
committer赵子初 <zzc@rock-chips.com>
Fri, 7 Jun 2013 03:24:57 +0000 (11:24 +0800)
drivers/misc/bp/chips/u7501.c

index 2fa88afbfa54073d66227231858dd61a1ad4ad82..1936affb0208524a32c146a7e160fbc05cbc4d61 100644 (file)
 /****************operate according to bp chip:start************/\r
 static int bp_active(struct bp_private_data *bp, int enable)\r
 {              \r
-       printk("<-----U7501 bp_active-------->\n");\r
        if(enable)\r
        {\r
-       printk("<-----U7501 bp_active---enable---HIGH-->\n");\r
-               gpio_set_value(bp->ops->bp_power, GPIO_LOW);\r
+       printk("<-----U7501 bp_on-->\n");\r
+               gpio_set_value(bp->ops->bp_reset, GPIO_HIGH);\r
+               msleep(100);\r
+               gpio_set_value(bp->ops->bp_reset, GPIO_LOW);\r
+               gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
                 msleep(1000);\r
-                gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
-                msleep(2500);\r
-                gpio_set_value(bp->ops->bp_power, GPIO_LOW);\r
-                gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_HIGH);\r
+                gpio_set_value(bp->ops->bp_en, GPIO_HIGH);\r
+                msleep(5000);\r
+                gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
+                gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_LOW);\r
        }\r
        else\r
        {\r
-       printk("<-----U7501 bp_active---disenable----->\n");\r
+       printk("<-----U7501 bp_off----->\n");\r
                 gpio_set_value(bp->ops->bp_en, GPIO_HIGH);\r
                 msleep(4000);\r
                 gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
@@ -113,9 +115,10 @@ static int bp_init(struct bp_private_data *bp)
        //if(bp->ops->active)\r
        //      bp->ops->active(bp, 1);\r
        gpio_direction_input(bp->ops->bp_wakeup_ap);\r
+       gpio_pull_updown(bp->ops->bp_wakeup_ap, 1);     \r
        gpio_direction_output(bp->ops->bp_reset, GPIO_LOW);\r
        gpio_direction_output(bp->ops->bp_en, GPIO_LOW);\r
-       gpio_direction_output(bp->ops->ap_wakeup_bp, GPIO_HIGH);\r
+       gpio_direction_output(bp->ops->ap_wakeup_bp, GPIO_LOW);\r
        INIT_DELAYED_WORK(&bp->wakeup_work, ap_wake_bp_work);\r
        return 0;\r
 }\r
@@ -165,10 +168,10 @@ static int bp_shutdown(struct bp_private_data *bp)
 static int bp_suspend(struct bp_private_data *bp)\r
 {      \r
 \r
-       printk("<-----U7501 bp_suspend---000000----->\n");\r
+       printk("<-----U7501 bp_suspend------->\n");\r
        \r
        bp->suspend_status = 1;\r
-       gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_LOW);                \r
+               gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_HIGH);       \r
        \r
        return 0;\r
 }\r
@@ -178,9 +181,9 @@ static int bp_suspend(struct bp_private_data *bp)
 \r
 static int bp_resume(struct bp_private_data *bp)\r
 {      \r
-       printk("<-----U7501 bp_resume-----hhhh--->\n");\r
+       printk("<-----U7501 bp_resume------>\n");\r
        bp->suspend_status = 0; \r
-       gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_HIGH);       \r
+       gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_LOW);        \r
        \r
        \r
        return 0;\r
@@ -203,7 +206,7 @@ struct bp_operate bp_U7501_ops = {
        .bp_wakeup_ap           = RK2928_PIN3_PC3,      //\r
        .bp_uart_en             = BP_UNKNOW_DATA,       //EINT9\r
        .bp_usb_en              = BP_UNKNOW_DATA,       //W_disable\r
-       .trig                   = IRQF_TRIGGER_FALLING,\r
+       .trig                   = IRQF_TRIGGER_RISING,\r
 \r
        .active                 = bp_active,\r
        .init                   = bp_init,\r
@@ -223,13 +226,13 @@ struct bp_operate bp_U7501_ops = {
        .bp_bus                 = BP_BUS_TYPE_USB_UART,         \r
        .bp_pid                 = 0,    \r
        .bp_vid                 = 0,    \r
-       .bp_power               = BP_UNKNOW_DATA,       // 3g_power\r
-       .bp_en                  = BP_UNKNOW_DATA,       // 3g_en\r
-       .bp_reset                       = BP_UNKNOW_DATA,\r
+       .bp_power               = RK30_PIN0_PC6,// 3g_power\r
+       .bp_en                  = RK30_PIN2_PD5,// 3g_en\r
+       .bp_reset                       = RK30_PIN2_PD4,//BP_UNKNOW_DATA,\r
        .ap_ready               = BP_UNKNOW_DATA,       //\r
        .bp_ready               = BP_UNKNOW_DATA,\r
-       .ap_wakeup_bp           = RK30_PIN2_PC4,\r
-       .bp_wakeup_ap           = RK30_PIN2_PC5,        //\r
+       .ap_wakeup_bp           = RK30_PIN0_PC4,\r
+       .bp_wakeup_ap           = RK30_PIN0_PC5,        //\r
        .bp_uart_en             = BP_UNKNOW_DATA,       //EINT9\r
        .bp_usb_en              = BP_UNKNOW_DATA,       //W_disable\r
        .trig                   = IRQF_TRIGGER_RISING,\r
@@ -261,7 +264,7 @@ struct bp_operate bp_U7501_ops = {
        .bp_wakeup_ap           = BP_UNKNOW_DATA,//RK2928_PIN3_PC3,     //\r
        .bp_uart_en             = BP_UNKNOW_DATA,       //EINT9\r
        .bp_usb_en              = BP_UNKNOW_DATA,       //W_disable\r
-       .trig                   = IRQF_TRIGGER_FALLING,\r
+       .trig                   = IRQF_TRIGGER_RISING,\r
 \r
        .active                 = bp_active,\r
        .init                   = bp_init,\r