From: chenli <chenli@rockchip.com>
Date: Tue, 9 Aug 2011 06:24:47 +0000 (+0800)
Subject: rk29-ipp: fix bugs of IPP's suspending
X-Git-Tag: firefly_0821_release~9772^2~18^2~23^2~9
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6fd2feafd90b271470dcaa6ff0e6e7db97c55096;p=firefly-linux-kernel-4.4.55.git

rk29-ipp: fix bugs of IPP's suspending
---

diff --git a/drivers/staging/rk29/ipp/rk29-ipp.c b/drivers/staging/rk29/ipp/rk29-ipp.c
index a9c12c2b0efd..f5bd523318ae 100755
--- a/drivers/staging/rk29/ipp/rk29-ipp.c
+++ b/drivers/staging/rk29/ipp/rk29-ipp.c
@@ -944,7 +944,8 @@ int ipp_blit_sync(const struct rk29_ipp_req *req)
    
 	if(drvdata->ipp_result == 0)
 	{
-		wait_ret = wait_event_interruptible_timeout(hw_wait_queue, wq_condition, msecs_to_jiffies(req->timeout));
+		//wait_ret = wait_event_interruptible_timeout(hw_wait_queue, wq_condition, msecs_to_jiffies(req->timeout));
+		wait_ret = wait_event_timeout(hw_wait_queue, wq_condition, msecs_to_jiffies(req->timeout));
 #ifdef IPP_TEST
 		irq_end = ktime_get(); 
 		irq_end = ktime_sub(irq_end,irq_start);
@@ -990,6 +991,7 @@ int ipp_blit_sync(const struct rk29_ipp_req *req)
 #endif
 			
 			ipp_soft_reset();
+			drvdata->ipp_result = -EAGAIN;
 		}
 
 		ipp_power_off(NULL);
@@ -1133,7 +1135,8 @@ static irqreturn_t rk29_ipp_irq(int irq,  void *dev_id)
 
 	if(drvdata->issync)//sync
 	{
-		wake_up_interruptible_sync(&hw_wait_queue);
+		//wake_up_interruptible_sync(&hw_wait_queue);
+		wake_up(&hw_wait_queue);
 	}
 	else//async
 	{
@@ -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)
 {
 	//printk("ipp_suspend\n");
-	//delay 20ms to wait hardware work completed
-	mdelay(20);
+	
+	if(drvdata->enable)
+	{
+		//delay 20ms to wait hardware work completed
+		mdelay(20);
 
-	//cancel the delay work, power off right now
-	cancel_delayed_work_sync(&drvdata->power_off_work);
-	ipp_power_off(NULL);
+		// power off right now
+	    ipp_power_off(NULL);
+	}
 
 	return 0;
 }