rk29-ipp: fix bugs of IPP's suspending
authorchenli <chenli@rockchip.com>
Tue, 9 Aug 2011 06:24:47 +0000 (14:24 +0800)
committerchenli <chenli@rockchip.com>
Tue, 9 Aug 2011 06:24:47 +0000 (14:24 +0800)
drivers/staging/rk29/ipp/rk29-ipp.c

index a9c12c2b0efd08c0d1f7985804980f9aa03aa5f1..f5bd523318aec1db20edf7a7c7a025d8e23dffbe 100755 (executable)
@@ -944,7 +944,8 @@ int ipp_blit_sync(const struct rk29_ipp_req *req)
    \r
        if(drvdata->ipp_result == 0)\r
        {\r
-               wait_ret = wait_event_interruptible_timeout(hw_wait_queue, wq_condition, msecs_to_jiffies(req->timeout));\r
+               //wait_ret = wait_event_interruptible_timeout(hw_wait_queue, wq_condition, msecs_to_jiffies(req->timeout));\r
+               wait_ret = wait_event_timeout(hw_wait_queue, wq_condition, msecs_to_jiffies(req->timeout));\r
 #ifdef IPP_TEST\r
                irq_end = ktime_get(); \r
                irq_end = ktime_sub(irq_end,irq_start);\r
@@ -990,6 +991,7 @@ int ipp_blit_sync(const struct rk29_ipp_req *req)
 #endif\r
                        \r
                        ipp_soft_reset();\r
+                       drvdata->ipp_result = -EAGAIN;\r
                }\r
 \r
                ipp_power_off(NULL);\r
@@ -1133,7 +1135,8 @@ static irqreturn_t rk29_ipp_irq(int irq,  void *dev_id)
 \r
        if(drvdata->issync)//sync\r
        {\r
-               wake_up_interruptible_sync(&hw_wait_queue);\r
+               //wake_up_interruptible_sync(&hw_wait_queue);\r
+               wake_up(&hw_wait_queue);\r
        }\r
        else//async\r
        {\r
@@ -1161,12 +1164,15 @@ static irqreturn_t rk29_ipp_irq(int irq,  void *dev_id)
 static int ipp_suspend(struct platform_device *pdev, pm_message_t state)\r
 {\r
        //printk("ipp_suspend\n");\r
-       //delay 20ms to wait hardware work completed\r
-       mdelay(20);\r
+       \r
+       if(drvdata->enable)\r
+       {\r
+               //delay 20ms to wait hardware work completed\r
+               mdelay(20);\r
 \r
-       //cancel the delay work, power off right now\r
-       cancel_delayed_work_sync(&drvdata->power_off_work);\r
-       ipp_power_off(NULL);\r
+               // power off right now\r
+           ipp_power_off(NULL);\r
+       }\r
 \r
        return 0;\r
 }\r