rk30 rk3188 lcdc:remov report sync code
authoryxj <yxj@rock-chips.com>
Wed, 30 Jan 2013 12:32:27 +0000 (20:32 +0800)
committeryxj <yxj@rock-chips.com>
Wed, 30 Jan 2013 12:34:23 +0000 (20:34 +0800)
drivers/video/rockchip/lcdc/rk30_lcdc.c
drivers/video/rockchip/lcdc/rk30_lcdc.h
drivers/video/rockchip/lcdc/rk3188_lcdc.c
drivers/video/rockchip/lcdc/rk3188_lcdc.h

index 9b69bc60a0f15371239a442534479b92c02ce777..7f0f38300f0ad8b676169ee8fb523d0e959738c3 100644 (file)
@@ -30,8 +30,6 @@
 #include <linux/earlysuspend.h>
 #include <asm/div64.h>
 #include <asm/uaccess.h>
-#include <linux/kthread.h>
-
 #include "rk30_lcdc.h"
 
 
@@ -917,11 +915,6 @@ int rk30_lcdc_ioctl(struct rk_lcdc_device_driver * dev_drv,unsigned int cmd, uns
                        if(copy_to_user(argp, panel_size, 8)) 
                                return -EFAULT;
                        break;
-               case RK_FBIOSET_VSYNC_ENABLE:
-                       if (copy_from_user(&enable, argp, sizeof(enable)))
-                               return -EFAULT;
-                       lcdc_dev->vsync_info.active = enable;
-                       break;
                default:
                        break;
        }
@@ -1396,33 +1389,6 @@ int rk30_lcdc_early_resume(struct rk_lcdc_device_driver *dev_drv)
        return 0;
 }
 
-static int lcdc_wait_for_vsync_thread(void *data)
-{
-       struct rk30_lcdc_device  *lcdc_dev = data;
-
-       while (!kthread_should_stop()) {
-               ktime_t timestamp = lcdc_dev->vsync_info.timestamp;
-               int ret = wait_event_interruptible(lcdc_dev->vsync_info.wait,
-                       !ktime_equal(timestamp, lcdc_dev->vsync_info.timestamp) &&
-                       lcdc_dev->vsync_info.active);
-
-               if (!ret) {
-                       sysfs_notify(&lcdc_dev->driver.dev->kobj, NULL, "vsync");
-               }
-       }
-
-       return 0;
-}
-
-static ssize_t rk30_lcdc_vsync_show(struct device *dev,
-               struct device_attribute *attr, char *buf)
-{
-       struct rk30_lcdc_device *lcdc_dev = dev_get_drvdata(dev);
-       return scnprintf(buf, PAGE_SIZE, "%llu\n",
-                       ktime_to_ns(lcdc_dev->vsync_info.timestamp));
-}
-
-static DEVICE_ATTR(vsync, S_IRUGO, rk30_lcdc_vsync_show, NULL);
 
 static irqreturn_t rk30_lcdc_isr(int irq, void *dev_id)
 {
@@ -1440,8 +1406,8 @@ static irqreturn_t rk30_lcdc_isr(int irq, void *dev_id)
                spin_unlock(&(lcdc_dev->driver.cpl_lock));
        }
 
-       lcdc_dev->vsync_info.timestamp = timestamp;
-       wake_up_interruptible_all(&lcdc_dev->vsync_info.wait);
+       lcdc_dev->driver.vsync_info.timestamp = timestamp;
+       wake_up_interruptible_all(&lcdc_dev->driver.vsync_info.wait);
        
        return IRQ_HANDLED;
 }
@@ -1599,21 +1565,6 @@ static int __devinit rk30_lcdc_probe (struct platform_device *pdev)
                ret =  -ENODEV;
                goto err4;
        }
-
-       init_waitqueue_head(&lcdc_dev->vsync_info.wait);
-       ret = device_create_file(&pdev->dev, &dev_attr_vsync);
-       if (ret) {
-               dev_err(&pdev->dev, "failed to create vsync file\n");
-       }
-       lcdc_dev->vsync_info.thread = kthread_run(lcdc_wait_for_vsync_thread,
-               lcdc_dev, "lcdc-vsync");
-
-       
-       if (lcdc_dev->vsync_info.thread == ERR_PTR(-ENOMEM)) {
-               dev_err(&pdev->dev, "failed to run vsync thread\n");
-               lcdc_dev->vsync_info.thread = NULL;
-       }
-       lcdc_dev->vsync_info.active = 1;
        
        ret = rk_fb_register(&(lcdc_dev->driver),&lcdc_driver,lcdc_dev->id);
        if(ret < 0)
index e2b467e99ac88b65ed9e54b973d08dc22f3a0987..c99bd042d19f5dc3979329f44e4e6309ecb96dc8 100644 (file)
@@ -589,8 +589,6 @@ struct rk30_lcdc_device{
        spinlock_t  reg_lock;           //one time only one process allowed to config the register
        bool clk_on;                    //if aclk or hclk is closed ,acess to register is not allowed
        u8 atv_layer_cnt;               //active layer counter,when  atv_layer_cnt = 0,disable lcdc
-
-       struct rk_fb_vsync       vsync_info;
        
        unsigned int            irq;
 
index 7f37d55294abed5bc68a85ce6b378f7ad1675cd0..eca913e6ee7e17dfb611084998879ed96ec61b4e 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/device.h>
-#include <linux/kthread.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -788,11 +787,6 @@ static int rk3188_lcdc_ioctl(struct rk_lcdc_device_driver *dev_drv, unsigned int
                case RK_FBIOSET_CONFIG_DONE:
                        lcdc_cfg_done(lcdc_dev);
                        break;
-               case RK_FBIOSET_VSYNC_ENABLE:
-                       if (copy_from_user(&enable, argp, sizeof(enable)))
-                               return -EFAULT;
-                       lcdc_dev->vsync_info.active = enable;
-                       break;
                default:
                        break;
        }
@@ -1140,34 +1134,6 @@ static int rk3188_set_dsp_lut(struct rk_lcdc_device_driver *dev_drv,int *lut)
 }
 
 
-static int lcdc_wait_for_vsync_thread(void *data)
-{
-       struct rk3188_lcdc_device  *lcdc_dev = data;
-
-       while (!kthread_should_stop()) {
-               ktime_t timestamp = lcdc_dev->vsync_info.timestamp;
-               int ret = wait_event_interruptible(lcdc_dev->vsync_info.wait,
-                       !ktime_equal(timestamp, lcdc_dev->vsync_info.timestamp) &&
-                       lcdc_dev->vsync_info.active);
-
-               if (!ret) {
-                       sysfs_notify(&lcdc_dev->driver.dev->kobj, NULL, "vsync");
-               }
-       }
-
-       return 0;
-}
-
-static ssize_t rk3188_lcdc_vsync_show(struct device *dev,
-               struct device_attribute *attr, char *buf)
-{
-       struct rk3188_lcdc_device *lcdc_dev = dev_get_drvdata(dev);
-       return scnprintf(buf, PAGE_SIZE, "%llu\n",
-                       ktime_to_ns(lcdc_dev->vsync_info.timestamp));
-}
-
-static DEVICE_ATTR(vsync, S_IRUGO, rk3188_lcdc_vsync_show, NULL);
-
 static struct layer_par lcdc_layer[] = {
        [0] = {
                .name           = "win0",
@@ -1219,8 +1185,8 @@ static irqreturn_t rk3188_lcdc_isr(int irq, void *dev_id)
                spin_unlock(&(lcdc_dev->driver.cpl_lock));
        }
 #endif
-       lcdc_dev->vsync_info.timestamp = timestamp;
-       wake_up_interruptible_all(&lcdc_dev->vsync_info.wait);
+       lcdc_dev->driver.vsync_info.timestamp = timestamp;
+       wake_up_interruptible_all(&lcdc_dev->driver.vsync_info.wait);
        
        return IRQ_HANDLED;
 }
@@ -1369,21 +1335,6 @@ static int __devinit rk3188_lcdc_probe(struct platform_device *pdev)
                ret = -ENODEV;
                goto err3;
        }
-
-       init_waitqueue_head(&lcdc_dev->vsync_info.wait);
-       ret = device_create_file(&pdev->dev, &dev_attr_vsync);
-       if (ret) {
-               dev_err(&pdev->dev, "failed to create vsync file\n");
-       }
-       lcdc_dev->vsync_info.thread = kthread_run(lcdc_wait_for_vsync_thread,
-               lcdc_dev, "lcdc-vsync");
-
-       
-       if (lcdc_dev->vsync_info.thread == ERR_PTR(-ENOMEM)) {
-               dev_err(&pdev->dev, "failed to run vsync thread\n");
-               lcdc_dev->vsync_info.thread = NULL;
-       }
-       lcdc_dev->vsync_info.active = 1;
        
        ret = rk_fb_register(&(lcdc_dev->driver),&lcdc_driver,lcdc_dev->id);
        if(ret < 0)
@@ -1397,7 +1348,6 @@ static int __devinit rk3188_lcdc_probe(struct platform_device *pdev)
        return 0;
 
 err4:
-       device_remove_file(&pdev->dev, &dev_attr_vsync);
 err3:
        iounmap(lcdc_dev->regs);
 err2:
index 1451f15f2eac8e9c36453b0bc8369b27061cbf41..bcb071751fb2367a37d6e94710aef5dd9bf93f74 100644 (file)
@@ -306,7 +306,6 @@ struct rk3188_lcdc_device{
        bool clk_on;                    //if aclk or hclk is closed ,acess to register is not allowed
        u8 atv_layer_cnt;               //active layer counter,when  atv_layer_cnt = 0,disable lcdc
        
-       struct rk_fb_vsync       vsync_info;
 
        unsigned int            irq;