1.optimize the 'hdmi' global variables 2.fix some compile error
authorzwl <zwl@rock-chips.com>
Mon, 10 Feb 2014 14:11:43 +0000 (22:11 +0800)
committerzwl <zwl@rock-chips.com>
Mon, 10 Feb 2014 14:12:11 +0000 (22:12 +0800)
21 files changed:
arch/arm/boot/dts/rk616.dtsi
drivers/video/rockchip/hdmi/chips/cat66121/cat66121_hdmi.c
drivers/video/rockchip/hdmi/chips/rk2928/rk2928_hdmi.c
drivers/video/rockchip/hdmi/chips/rk30/rk30_hdmi.c
drivers/video/rockchip/hdmi/chips/rk610/rk610_hdmi.c
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi.c
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi.h
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.h
drivers/video/rockchip/hdmi/rk_hdmi.h
drivers/video/rockchip/hdmi/rk_hdmi_edid.c
drivers/video/rockchip/hdmi/rk_hdmi_lcdc.c
drivers/video/rockchip/hdmi/rk_hdmi_task.c
drivers/video/rockchip/rk_fb.c
drivers/video/rockchip/screen/rk_screen.c
drivers/video/rockchip/transmitter/rk610_lcd.c
drivers/video/rockchip/transmitter/rk610_lcd.h
drivers/video/rockchip/transmitter/rk616_mipi_dsi.c
drivers/video/rockchip/tve/rk610_tv.c
drivers/video/rockchip/tve/rk610_tv.h
include/linux/mfd/rk616.h

index 220e3640f625c66b9e775c8dddc778b43486f5a7..87c06c33026411c9145ad0249d8a6c14957c8dfb 100644 (file)
@@ -4,30 +4,30 @@
        compatible = "rockchip,rk616";
                
        #address-cells = <1>;
-       #size-cells = <1>;      
+       #size-cells = <1>;
 
        rk616,scl_rate = <100000>;
        rk616,lcd0_func = <INPUT>;
        rk616,lcd1_func = <UNUSED>;
        rk616,lvds_ch_nr = <1>;
-       
+
        hdmi: hdmi{
-               compatible = "rk616,rk616-hdmi";
+               compatible = "rockchip,rk616-hdmi";
                reg = <0x0400,0x0400>;
        };
-       
+
        codec: codec{
-               compatible = "rk616,rk616-code";
+               compatible = "rockchip,rk616-code";
                reg = <0x0800,0x0400>;
        };
-       
+
        mipi: mipi-pyh{
-               compatible = "rk616,mipi-phy";
+               compatible = "rockchip,rk616-mipi-phy";
                reg = <0x0c00,0x0400>;
        };
-       
+
        mipi: mipi-ctrl{
-               compatible = "rk616,mipi-ctrl";
+               compatible = "rockchip,rk616-mipi-ctrl";
                reg = <0x1000,0x0400>;
        };
 };
index 2322a8d058a7b9eaf531ea75b89192fa352835af..0ff54a0956f35aa4e3b051b9ad8d1d1226e46350 100755 (executable)
@@ -20,7 +20,7 @@
 struct cat66121_hdmi_pdata *cat66121_hdmi = NULL;
 struct hdmi *hdmi=NULL;
 
-extern struct rk_lcdc_device_driver * rk_get_lcdc_drv(char *name);
+extern struct rk_lcdc_driver * rk_get_lcdc_drv(char *name);
 extern void hdmi_register_display_sysfs(struct hdmi *hdmi, struct device *parent);
 extern void hdmi_unregister_display_sysfs(struct hdmi *hdmi);
 static void cat66121_irq_work_func(struct work_struct *work);
index 9c698e7b9ada2f7fde3e3239d6a211d917adf49f..ac8e70b3fb7442e8631859637ff9a1401592a127 100755 (executable)
@@ -23,7 +23,7 @@ struct hdmi *hdmi = NULL;
 \r
 extern irqreturn_t hdmi_irq(int irq, void *priv);\r
 extern void hdmi_work(struct work_struct *work);\r
-extern struct rk_lcdc_device_driver * rk_get_lcdc_drv(char *name);\r
+extern struct rk_lcdc_driver * rk_get_lcdc_drv(char *name);
 extern void hdmi_register_display_sysfs(struct hdmi *hdmi, struct device *parent);\r
 extern void hdmi_unregister_display_sysfs(struct hdmi *hdmi);\r
 \r
index a33f7e65468ec978e893c3e624f31d0b66994413..85d68db2034639d1fd3186937680dddb752f1313 100755 (executable)
@@ -23,7 +23,7 @@ struct hdmi *hdmi = NULL;
 \r
 extern irqreturn_t hdmi_irq(int irq, void *priv);\r
 extern void hdmi_work(struct work_struct *work);\r
-extern struct rk_lcdc_device_driver * rk_get_lcdc_drv(char *name);\r
+extern struct rk_lcdc_driver * rk_get_lcdc_drv(char *name);
 extern void hdmi_register_display_sysfs(struct hdmi *hdmi, struct device *parent);\r
 extern void hdmi_unregister_display_sysfs(struct hdmi *hdmi);\r
 \r
index d012adc54c533571a160e80720bd10114978a553..8952b399216bee858894eabd6a61caeae6e4d235 100755 (executable)
@@ -11,7 +11,7 @@
 struct rk610_hdmi_pdata *rk610_hdmi = NULL;\r
 struct hdmi *hdmi=NULL;\r
 \r
-extern struct rk_lcdc_device_driver * rk_get_lcdc_drv(char *name);\r
+extern struct rk_lcdc_driver * rk_get_lcdc_drv(char *name);
 extern void hdmi_register_display_sysfs(struct hdmi *hdmi, struct device *parent);\r
 extern void hdmi_unregister_display_sysfs(struct hdmi *hdmi);\r
 \r
index 5f7bda57d0d9bd98f9bb55cbf3070427f5d6e65a..0ba6661d69e8dcc6c76c443bf47ce8b6fead3730 100755 (executable)
 #include <linux/clk.h>
 #include <linux/uaccess.h>
 
-#include <mach/board.h>
-#include <mach/io.h>
-#include <mach/gpio.h>
-#include <mach/iomux.h>
+//#include <mach/board.h>
+//#include <mach/io.h>
+#include <linux/of_gpio.h>
+//#include <mach/iomux.h>
 #include <linux/rk_fb.h> 
 
 #if defined(CONFIG_DEBUG_FS)
@@ -145,11 +145,11 @@ static void hdmi_early_resume(struct early_suspend *h)
        mutex_lock(&hdmi->enable_mutex);
 
        hdmi->suspend = 0;
-       rk616_hdmi_initial();
+       rk616_hdmi_initial(hdmi);
        if(hdmi->enable && hdmi->irq) {
                enable_irq(hdmi->irq);
                // hdmi_irq();
-                rk616_hdmi_work();
+                rk616_hdmi_work(hdmi);
        }
         if (rk616_hdmi->rk616_drv && rk616_hdmi->rk616_drv->pdata->hdmi_irq == INVALID_GPIO) 
                 queue_delayed_work(hdmi->workqueue, &rk616_hdmi->rk616_delay_work, 100);
@@ -167,7 +167,7 @@ static void rk616_delay_work_func(struct work_struct *work)
        if(hdmi->suspend == 0) {
                if(hdmi->enable == 1) {
                        //hdmi_irq();
-                        rk616_hdmi_work();
+                        rk616_hdmi_work(hdmi);
                }
 
                 if (rk616_hdmi->rk616_drv && rk616_hdmi->rk616_drv->pdata->hdmi_irq == INVALID_GPIO) {
@@ -179,7 +179,7 @@ static void rk616_delay_work_func(struct work_struct *work)
 static void __maybe_unused rk616_irq_work_func(struct work_struct *work)
 {
        if((hdmi->suspend == 0) && (hdmi->enable == 1)) {
-                rk616_hdmi_work();
+                rk616_hdmi_work(hdmi);
        }
        dev_info(hdmi->dev, "func: %s, enable_irq\n", __func__);
         enable_irq(hdmi->irq);
@@ -199,13 +199,13 @@ static irqreturn_t rk616_hdmi_irq(int irq, void *dev_id)
                 /* 3028a hdmi */
                 if((hdmi->suspend == 0) && (hdmi->enable == 1)) {
                         printk(KERN_INFO "line = %d, rk616_hdmi_irq irq triggered.\n", __LINE__);
-                        rk616_hdmi_work();
+                        rk616_hdmi_work(hdmi);
                 }
         }
         return IRQ_HANDLED;
 }
 
-static int __devinit rk616_hdmi_probe (struct platform_device *pdev)
+static int rk616_hdmi_probe(struct platform_device *pdev)
 {
        int ret;
         struct rk616_hdmi *rk616_hdmi;
@@ -250,7 +250,7 @@ static int __devinit rk616_hdmi_probe (struct platform_device *pdev)
        hdmi->yscale = 100;
 
 
-       hdmi_sys_init();
+       hdmi_sys_init(hdmi);
 
        hdmi->workqueue = create_singlethread_workqueue("hdmi");
        INIT_DELAYED_WORK(&(hdmi->delay_work), hdmi_work);
@@ -314,7 +314,7 @@ static int __devinit rk616_hdmi_probe (struct platform_device *pdev)
         iomux_set(HDMI_DDCSCL);
         iomux_set(HDMI_HOTPLUGIN);
         
-        ret = rk616_hdmi_initial();
+        ret = rk616_hdmi_initial(hdmi);
         /* get the IRQ */
         hdmi->irq = platform_get_irq(pdev, 0);
         if(hdmi->irq <= 0) {
@@ -329,7 +329,7 @@ static int __devinit rk616_hdmi_probe (struct platform_device *pdev)
                 }
         }
 #else
-        ret = rk616_hdmi_initial();
+        ret = rk616_hdmi_initial(hdmi);
         if(rk616_hdmi->rk616_drv->pdata->hdmi_irq != INVALID_GPIO) {               
                 INIT_WORK(&rk616_hdmi->rk616_irq_work_struct, rk616_irq_work_func);
                 ret = gpio_request(rk616_hdmi->rk616_drv->pdata->hdmi_irq,"rk616_hdmi_irq");
@@ -389,7 +389,7 @@ err0:
        return ret;
 }
 
-static int __devexit rk616_hdmi_remove(struct platform_device *pdev)
+static int rk616_hdmi_remove(struct platform_device *pdev)
 {
        if(hdmi) {
                mutex_lock(&hdmi->enable_mutex);
@@ -455,7 +455,7 @@ MODULE_DEVICE_TABLE(of, rk616_hdmi_of_match);
 
 static struct platform_driver rk616_hdmi_driver = {
        .probe          = rk616_hdmi_probe,
-       .remove         = __devexit_p(rk616_hdmi_remove),
+       .remove         = rk616_hdmi_remove,
        .driver         = {
 #ifdef CONFIG_ARCH_RK3026
                .name   = "rk3026-hdmi",
index 2d033fa6f33019f4c76bb62230737a7a40c53de0..8c4702d2ffc7b460c19dd546567cd3f3ef5bddc4 100755 (executable)
@@ -20,7 +20,7 @@ enum{
 #define HDMI_CODEC_SOURCE_SELECT INPUT_IIS
 #endif
 
-extern void rk616_hdmi_control_output(int enable);
+extern void rk616_hdmi_control_output(struct hdmi *hdmi, int enable);
 extern int rk616_hdmi_register_hdcp_callbacks(void (*hdcp_cb)(void),
                                         void (*hdcp_irq_cb)(int status),
                                         int  (*hdcp_power_on_cb)(void),
index 31329551f0ef24ada2c9649235984e91d8c9b4a5..13b973223748afbda014060be059628c70ee10ae 100755 (executable)
@@ -1,9 +1,10 @@
 #include <linux/delay.h>
 #include <asm/io.h>
-#include <mach/io.h>
+//#include <mach/io.h>
+#include <linux/of_irq.h>
 #include "rk616_hdmi.h"
 #include "rk616_hdmi_hw.h"
-#include <mach/gpio.h>
+//#include <mach/gpio.h>
 
 // static char edid_result = 0;
 
@@ -42,7 +43,7 @@ static int rk616_set_polarity(struct mfd_rk616 * rk616, int vic)
         return ret;
 }
 
-static int rk616_hdmi_set_vif(rk_screen * screen,bool connect)
+static int rk616_hdmi_set_vif(struct hdmi *hdmi, struct rk_screen *screen, bool connect)
 {
         struct rk616_hdmi *rk616_hdmi;
         rk616_hdmi = container_of(hdmi, struct rk616_hdmi, g_hdmi);
@@ -91,7 +92,7 @@ static void rk616_hdmi_sys_power_down(void)
 }
 
 
-static void rk616_hdmi_set_pwr_mode(int mode)
+static void rk616_hdmi_set_pwr_mode(struct hdmi *hdmi, int mode)
 {
        if(hdmi->pwr_mode == mode)
                return; 
@@ -134,7 +135,7 @@ static void rk616_hdmi_set_pwr_mode(int mode)
 }
 
 
-int rk616_hdmi_detect_hotplug(void)
+int rk616_hdmi_detect_hotplug(struct hdmi *hdmi)
 {
        int value = 0;
 #if 0
@@ -156,7 +157,7 @@ int rk616_hdmi_detect_hotplug(void)
 }
 
 
-int rk616_hdmi_read_edid(int block, u8 * buf)
+int rk616_hdmi_read_edid(struct hdmi *hdmi, int block, u8 * buf)
 {
         u32 c = 0;
        u8 Segment = 0;
@@ -274,7 +275,7 @@ static void rk616_hdmi_config_avi(unsigned char vic, unsigned char output_color)
 }
 
 
-static int rk616_hdmi_config_video(struct hdmi_video_para *vpara)
+static int rk616_hdmi_config_video(struct hdmi *hdmi, struct hdmi_video_para *vpara)
 {
        int value;
        struct fb_videomode *mode;
@@ -289,7 +290,7 @@ static int rk616_hdmi_config_video(struct hdmi_video_para *vpara)
        }
 
         if(hdmi->pwr_mode == LOWER_PWR) {
-                rk616_hdmi_set_pwr_mode(NORMAL);
+                rk616_hdmi_set_pwr_mode(hdmi, NORMAL);
         }
 
 
@@ -301,7 +302,7 @@ static int rk616_hdmi_config_video(struct hdmi_video_para *vpara)
        
        // Input video mode is SDR RGB24bit, Data enable signal from external
        hdmi_writel(VIDEO_CONTRL1, v_VIDEO_INPUT_FORMAT(VIDEO_INPUT_SDR_RGB444) | v_DE_EXTERNAL);
-       hdmi_writel(VIDEO_CONTRL2, v_VIDEO_INPUT_BITS(VIDEO_INPUT_8BITS) | (vpara->output_color & 0xFF));
+       hdmi_writel(VIDEO_CONTRL2, v_VIDEO_INPUT_BITS(VIDEO_INPUT_8BITS) | v_VIDEO_OUTPUT_FORMAT(vpara->output_color & 0xFF));
 
        // Set HDMI Mode
        hdmi_writel(HDCP_CTRL, v_HDMI_DVI(vpara->output_mode));
@@ -408,7 +409,7 @@ static void rk616_hdmi_config_aai(void)
                hdmi_writel(CONTROL_PACKET_ADDR + i, info[i]);
 }
 
-static int rk616_hdmi_config_audio(struct hdmi_audio *audio)
+static int rk616_hdmi_config_audio(struct hdmi *hdmi, struct hdmi_audio *audio)
 {
        int rate, N, channel, mclk_fs;
        
@@ -484,13 +485,13 @@ static int rk616_hdmi_config_audio(struct hdmi_audio *audio)
         return 0;
 }
 
-void rk616_hdmi_control_output(int enable)
+void rk616_hdmi_control_output(struct hdmi *hdmi, int enable)
 {
        int mutestatus = 0;
        
        if(enable) {
                if(hdmi->pwr_mode == LOWER_PWR)
-                       rk616_hdmi_set_pwr_mode(NORMAL);
+                       rk616_hdmi_set_pwr_mode(hdmi, NORMAL);
                hdmi_readl(AV_MUTE,&mutestatus);
                if(mutestatus && (m_AUDIO_MUTE | m_VIDEO_BLACK)) {
                        hdmi_writel(AV_MUTE, v_AUDIO_MUTE(0) | v_VIDEO_MUTE(0));
@@ -507,17 +508,17 @@ void rk616_hdmi_control_output(int enable)
        }
 }
 
-int rk616_hdmi_removed(void)
+int rk616_hdmi_removed(struct hdmi *hdmi)
 {
 
        dev_printk(KERN_INFO , hdmi->dev , "Removed.\n");
-       rk616_hdmi_set_pwr_mode(LOWER_PWR);
+       rk616_hdmi_set_pwr_mode(hdmi, LOWER_PWR);
 
        return HDMI_ERROR_SUCESS;
 }
 
 
-void rk616_hdmi_work(void)
+void rk616_hdmi_work(struct hdmi *hdmi)
 {              
        u32 interrupt = 0;
         // int value = 0;
@@ -541,7 +542,7 @@ void rk616_hdmi_work(void)
 #if 0  
        if(hdmi->state == HDMI_SLEEP) {
 //             hdmi_dbg(hdmi->dev, "hdmi return to sleep mode\n");
-               rk616_hdmi_set_pwr_mode(LOWER_PWR);
+               rk616_hdmi_set_pwr_mode(hdmi, LOWER_PWR);
        }
 #endif
 #if 0
@@ -550,7 +551,7 @@ void rk616_hdmi_work(void)
 #endif
 }
 
-static void rk616_hdmi_reset(void)
+static void rk616_hdmi_reset(struct hdmi *hdmi)
 {
        u32 val = 0;
        u32 msk = 0;
@@ -563,10 +564,10 @@ static void rk616_hdmi_reset(void)
        val = v_REG_CLK_INV | v_REG_CLK_SOURCE_SYS | v_PWR_ON |v_INT_POL_HIGH;
        hdmi_msk_reg(SYS_CTRL,msk,val);
        hdmi_writel(INTERRUPT_MASK1,m_INT_HOTPLUG);
-       rk616_hdmi_set_pwr_mode(LOWER_PWR);
+       rk616_hdmi_set_pwr_mode(hdmi, LOWER_PWR);
 }
 
-int rk616_hdmi_initial(void)
+int rk616_hdmi_initial(struct hdmi *hdmi)
 {
        int rc = HDMI_ERROR_SUCESS;
         struct rk616_hdmi *rk616_hdmi;
@@ -582,10 +583,10 @@ int rk616_hdmi_initial(void)
 
 #ifdef CONFIG_ARCH_RK3026
         rk3028_hdmi_reset_pclk();
-        rk616_hdmi_reset();
+        rk616_hdmi_reset(hdmi);
 #else
         hdmi->set_vif = rk616_hdmi_set_vif;
-        rk616_hdmi_reset();
+        rk616_hdmi_reset(hdmi);
        rk616_hdmi_init_pol_set(rk616_hdmi->rk616_drv, 0);
 #endif
         
index c998933c0bb3ff8f53f33970a3fe8a24d62bc246..082f92243db19acf589146c3724d4cab0e218e7f 100755 (executable)
@@ -285,6 +285,7 @@ enum {
 #define PHY_PRE_DIV_RATIO              0xed
        #define v_PRE_DIV_RATIO(n)      (n&1f)
 
+extern struct hdmi *hdmi;
 #ifndef CONFIG_ARCH_RK3026
 static inline int hdmi_readl(u16 offset, u32 *val)
 {
@@ -347,8 +348,8 @@ static inline void rk3028_hdmi_reset_pclk(void)
 }
 #endif
 
-extern int rk616_hdmi_initial(void);
-extern void rk616_hdmi_work(void);
+extern int rk616_hdmi_initial(struct hdmi *hdmi);
+extern void rk616_hdmi_work(struct hdmi *hdmi);
 
 
 #endif
index 5f50cdf9d3fa2c3a5e8a2d49c55356101221c65e..6a41e550d19de586b642cbcace1af6ea08678a9a 100755 (executable)
@@ -259,7 +259,7 @@ struct hdmi {
        int                             irq;
        int                             regbase_phy;
        int                             regsize_phy;
-       struct rk_lcdc_device_driver *lcdc;
+       struct rk_lcdc_driver *lcdc;
        
        #ifdef CONFIG_SWITCH
        struct switch_dev       switch_hdmi;
@@ -294,15 +294,15 @@ struct hdmi {
        int yscale;                                     // y directoon scale value
        int tmdsclk;                            // TDMS Clock frequency
        
-       int (*insert)(void);
-       int (*remove)(void);
-       void (*control_output)(int enable);
-       int (*config_video)(struct hdmi_video_para *vpara);
-       int (*config_audio)(struct hdmi_audio *audio);
-       int (*detect_hotplug)(void);
+       int (*insert)(struct hdmi  *hdmi);
+       int (*remove)(struct hdmi  *hdmi);
+       void (*control_output)(struct hdmi  *hdmi, int enable);
+       int (*config_video)(struct hdmi  *hdmi, struct hdmi_video_para *vpara);
+       int (*config_audio)(struct hdmi  *hdmi, struct hdmi_audio *audio);
+       int (*detect_hotplug)(struct hdmi  *hdmi);
        // call back for edid
-       int (*read_edid)(int block, unsigned char *buff);
-       int (*set_vif)(rk_screen * screen,bool connect);
+       int (*read_edid)(struct hdmi  *hdmi, int block, unsigned char *buff);
+       int (*set_vif)(struct hdmi *hdmi, struct rk_screen *screen, bool connect);
 
        // call back for hdcp operatoion
        void (*hdcp_cb)(void);
@@ -321,11 +321,11 @@ struct hdmi {
 #define hdmi_dbg(dev, format, arg...)  
 #endif
 
-extern struct hdmi *hdmi;
+//extern struct hdmi *hdmi;
 extern int hdmi_get_hotplug(void);
-extern int hdmi_set_info(struct rk29fb_screen *screen, unsigned int vic);
-extern void hdmi_init_lcdc(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info);
-extern int hdmi_sys_init(void);
+extern int hdmi_set_info(struct rk_screen *screen, unsigned int vic);
+extern void hdmi_init_lcdc(struct rk_screen *screen, struct rk29lcd_info *lcd_info);
+extern int hdmi_sys_init(struct hdmi *hdmi);
 extern int hdmi_sys_parse_edid(struct hdmi* hdmi);
 extern const char *hdmi_get_video_mode_name(unsigned char vic);
 extern int hdmi_videomode_to_vic(struct fb_videomode *vmode);
index 2ffc745aefbd28fc710981ad80cc052cdbd4cf93..31ca48b7bbab93d34ba4ac3705e82464467b6439 100755 (executable)
@@ -374,7 +374,7 @@ int hdmi_sys_parse_edid(struct hdmi* hdmi)
        }\r
        // Read base block edid.\r
        memset(buff, 0 , HDMI_EDID_BLOCK_SIZE);\r
-       rc = hdmi->read_edid(0, buff);\r
+       rc = hdmi->read_edid(hdmi, 0, buff);\r
        if(rc)\r
        {\r
                dev_err(hdmi->dev, "[HDMI] read edid base block error\n");\r
@@ -389,7 +389,7 @@ int hdmi_sys_parse_edid(struct hdmi* hdmi)
        for(i = 1; i < extendblock + 1; i++)\r
        {\r
                memset(buff, 0 , HDMI_EDID_BLOCK_SIZE);\r
-               rc = hdmi->read_edid(i, buff);\r
+               rc = hdmi->read_edid(hdmi, i, buff);\r
                if(rc)\r
                {\r
                        printk("[HDMI] read edid block %d error\n", i); \r
index a9c09bcdf664fdc150215121a12230e41b2b046f..7fe7787bccb03e997432f6bd289ef92a6b5fb38a 100755 (executable)
@@ -61,12 +61,12 @@ static const struct fb_videomode hdmi_mode [] = {
 
 };
 
-void hdmi_init_lcdc(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info)
+void hdmi_init_lcdc(struct rk_screen *screen, struct rk29lcd_info *lcd_info)
 {
        hdmi_set_info(screen, HDMI_VIDEO_DEFAULT_MODE);
 }
 
-int hdmi_set_info(struct rk29fb_screen *screen, unsigned int vic)
+int hdmi_set_info(struct rk_screen *screen, unsigned int vic)
 {
     int i;
     
@@ -84,26 +84,26 @@ int hdmi_set_info(struct rk29fb_screen *screen, unsigned int vic)
     if(i == ARRAY_SIZE(hdmi_mode))
        return -1;
     
-    memset(screen, 0, sizeof(struct rk29fb_screen));
+    memset(screen, 0, sizeof(struct rk_screen));
     
     /* screen type & face */
     screen->type = OUT_TYPE;
     screen->face = OUT_FACE;
 
     /* Screen size */
-    screen->x_res = hdmi_mode[i].xres;
-    screen->y_res = hdmi_mode[i].yres;
+    screen->mode.xres = hdmi_mode[i].xres;
+    screen->mode.yres = hdmi_mode[i].yres;
     
     /* Timing */
-    screen->pixclock = hdmi_mode[i].pixclock;
-    screen->fps = hdmi_mode[i].refresh;
-       screen->lcdc_aclk = LCD_ACLK;
-       screen->left_margin = hdmi_mode[i].left_margin;
-       screen->right_margin = hdmi_mode[i].right_margin;
-       screen->hsync_len = hdmi_mode[i].hsync_len;
-       screen->upper_margin = hdmi_mode[i].upper_margin;
-       screen->lower_margin = hdmi_mode[i].lower_margin;
-       screen->vsync_len = hdmi_mode[i].vsync_len;
+    screen->mode.pixclock = hdmi_mode[i].pixclock;
+    screen->mode.refresh = hdmi_mode[i].refresh;
+       //screen->lcdc_aclk = LCD_ACLK;
+       screen->mode.left_margin = hdmi_mode[i].left_margin;
+       screen->mode.right_margin = hdmi_mode[i].right_margin;
+       screen->mode.hsync_len = hdmi_mode[i].hsync_len;
+       screen->mode.upper_margin = hdmi_mode[i].upper_margin;
+       screen->mode.lower_margin = hdmi_mode[i].lower_margin;
+       screen->mode.vsync_len = hdmi_mode[i].vsync_len;
        screen->hdmi_resolution = hdmi_mode[i].flag;
 
        /* Pin polarity */
@@ -503,10 +503,10 @@ const char *hdmi_get_video_mode_name(unsigned char vic)
 int hdmi_switch_fb(struct hdmi *hdmi, int vic)
 {
        int rc = 0;
-       rk_screen *screen;
+       struct rk_screen *screen;
        
        
-       screen =  kzalloc(sizeof(struct rk29fb_screen), GFP_KERNEL);
+       screen =  kzalloc(sizeof(struct rk_screen), GFP_KERNEL);
        if(screen == NULL)
                return -1;
        
@@ -518,11 +518,11 @@ int hdmi_switch_fb(struct hdmi *hdmi, int vic)
 
        if(rc == 0) {
                 if(hdmi->set_vif)
-                        hdmi->set_vif(screen,0); //turn off vif for jettab
+                        hdmi->set_vif(hdmi,screen,0); //turn off vif for jettab
                rk_fb_switch_screen(screen, 1, hdmi->lcdc->id);
                rk_fb_disp_scale(hdmi->xscale, hdmi->yscale, hdmi->lcdc->id);
                if(hdmi->set_vif)
-                       hdmi->set_vif(screen,1);
+                       hdmi->set_vif(hdmi,screen,1);
 
        }
        
@@ -537,6 +537,7 @@ int hdmi_switch_fb(struct hdmi *hdmi, int vic)
  * NOTES:
  * 
  */
+extern struct hdmi *hdmi;
 int hdmi_get_hotplug(void)
 {
        if(hdmi)
index 34b0f1179202159844de054ccbfdb467e895bba1..6b4bb599146e17bf8cea7fb81f803f841f5b96a0 100755 (executable)
@@ -1,5 +1,6 @@
 #include <linux/kernel.h>
 #include <linux/delay.h>
+#include <linux/interrupt.h>
 #include "rk_hdmi.h"
 
 #ifdef CONFIG_RK_HDMI_CTL_CODEC
@@ -23,9 +24,9 @@
 
 static char *envp[] = {"INTERFACE=HDMI", NULL};
 
-static void hdmi_sys_show_state(int state)
+static void hdmi_sys_show_state(struct hdmi *hdmi)
 {
-       switch(state)
+       switch(hdmi->state)
        {
                case HDMI_SLEEP:
                        hdmi_dbg(hdmi->dev, "HDMI_SLEEP\n");
@@ -60,7 +61,7 @@ static void hdmi_sys_show_state(int state)
        }
 }
 
-int hdmi_sys_init(void)
+int hdmi_sys_init(struct hdmi *hdmi)
 {
        hdmi->hotplug                   = HDMI_HPD_REMOVED;
        hdmi->state                             = HDMI_SLEEP;
@@ -78,7 +79,7 @@ int hdmi_sys_init(void)
        return 0;
 }
 
-void hdmi_sys_remove(void)
+void hdmi_sys_remove(struct hdmi *hdmi)
 {
        int audio_need;
 
@@ -97,7 +98,7 @@ void hdmi_sys_remove(void)
        INIT_LIST_HEAD(&hdmi->edid.modelist);
        hdmi->display   = HDMI_DISABLE;
        if(hdmi->set_vif)
-               hdmi->set_vif(hdmi->lcdc->screen1,0);
+               hdmi->set_vif(hdmi,hdmi->lcdc->screen1,0);
        rk_fb_switch_screen(hdmi->lcdc->screen1, 0, hdmi->lcdc->id);
        kobject_uevent_env(&hdmi->dev->kobj, KOBJ_REMOVE, envp);
 
@@ -122,19 +123,19 @@ void hdmi_sys_remove(void)
        #endif
 }
 
-static void hdmi_sys_sleep(void)
+static void hdmi_sys_sleep(struct hdmi *hdmi)
 {
        mutex_lock(&hdmi->enable_mutex);
        if(hdmi->enable && hdmi->irq)
                disable_irq(hdmi->irq);                         
        hdmi->state = HDMI_SLEEP;
-       hdmi->remove();
+       hdmi->remove(hdmi);
        if(hdmi->enable && hdmi->irq)
                enable_irq(hdmi->irq);
        mutex_unlock(&hdmi->enable_mutex);
 }
 
-static int hdmi_process_command(void)
+static int hdmi_process_command(struct hdmi *hdmi)
 {
        int change, state = hdmi->state;
        
@@ -150,10 +151,10 @@ static int hdmi_process_command(void)
                                if(!hdmi->enable || hdmi->suspend)
                                {
                                        if(hdmi->hotplug == HDMI_HPD_ACTIVED)
-                                               hdmi_sys_remove();
+                                               hdmi_sys_remove(hdmi);
                                        hdmi->state = HDMI_SLEEP;
                                        hdmi->hotplug = HDMI_HPD_REMOVED;
-                                       hdmi->remove();
+                                       hdmi->remove(hdmi);
                                        state = HDMI_SLEEP;
                                }
                                mutex_unlock(&hdmi->enable_mutex);
@@ -200,33 +201,35 @@ void hdmi_work(struct work_struct *work)
        int hotplug, state_last;
        int rc = HDMI_ERROR_SUCESS, trytimes = 0;
        struct hdmi_video_para video;
+       struct delayed_work *delay_work = container_of(work, struct delayed_work, work);
+       struct hdmi *hdmi = container_of(delay_work, struct hdmi, delay_work);
 
        mutex_lock(&work_mutex);
        /* Process hdmi command */
-       hdmi->state = hdmi_process_command();
+       hdmi->state = hdmi_process_command(hdmi);
        
        if(!hdmi->enable || hdmi->suspend) {
                mutex_unlock(&work_mutex);
                return;
        }
-       hotplug = hdmi->detect_hotplug();
+       hotplug = hdmi->detect_hotplug(hdmi);
        hdmi_dbg(hdmi->dev, "[%s] hotplug %02x curvalue %d\n", __FUNCTION__, hotplug, hdmi->hotplug);
        
        if(hotplug != hdmi->hotplug)
        {
                if(hotplug  == HDMI_HPD_ACTIVED){
                        if(hdmi->insert)
-                               hdmi->insert();
+                               hdmi->insert(hdmi);
                        hdmi->state = READ_PARSE_EDID;
                }
                else if(hdmi->hotplug == HDMI_HPD_ACTIVED) {
-                       hdmi_sys_remove();
+                       hdmi_sys_remove(hdmi);
                        hdmi->hotplug = hotplug;
                        if(hotplug == HDMI_HPD_REMOVED)
-                               hdmi_sys_sleep();
+                               hdmi_sys_sleep(hdmi);
                        else {
                                hdmi->state = WAIT_HOTPLUG;
-                               hdmi->remove();
+                               hdmi->remove(hdmi);
                        }
                        if(hdmi->wait == 1) {
                                complete(&hdmi->complete);
@@ -237,15 +240,15 @@ void hdmi_work(struct work_struct *work)
                }
                else if(hotplug == HDMI_HPD_REMOVED) {
                        hdmi->state = HDMI_SLEEP;
-                       hdmi->remove();
+                       hdmi->remove(hdmi);
                }
                hdmi->hotplug  = hotplug;
        }
        else if(hotplug == HDMI_HPD_REMOVED)
-               hdmi_sys_sleep();
+               hdmi_sys_sleep(hdmi);
        
        do {
-               hdmi_sys_show_state(hdmi->state);
+               hdmi_sys_show_state(hdmi);
                state_last = hdmi->state;
                switch(hdmi->state)
                {
@@ -279,7 +282,7 @@ void hdmi_work(struct work_struct *work)
                                break;
                        case SYSTEM_CONFIG:
                                 #ifdef CONFIG_HDMI_RK616
-                                hdmi->remove();
+                                hdmi->remove(hdmi);
                                 #endif
                                if(hdmi->autoconfig)    
                                        hdmi->vic = hdmi_find_best_mode(hdmi, 0);
@@ -306,7 +309,7 @@ void hdmi_work(struct work_struct *work)
                                if(hdmi->edid.sink_hdmi == 0)
                                        video.output_color = VIDEO_OUTPUT_RGB444;
                                
-                               rc = hdmi->config_video(&video);
+                               rc = hdmi->config_video(hdmi, &video);
                                if(rc == HDMI_ERROR_SUCESS)
                                {
                                        if(hdmi->edid.sink_hdmi)
@@ -316,14 +319,14 @@ void hdmi_work(struct work_struct *work)
                                }
                                break;
                        case CONFIG_AUDIO:
-                               rc = hdmi->config_audio(&(hdmi->audio));
+                               rc = hdmi->config_audio(hdmi, &(hdmi->audio));
                                                        
                                if(rc == HDMI_ERROR_SUCESS)
                                        hdmi->state = PLAY_BACK;
                                break;
                        case PLAY_BACK:
                                if(hdmi->display != HDMI_ENABLE) {
-                                       hdmi->control_output(HDMI_ENABLE);
+                                       hdmi->control_output(hdmi, HDMI_ENABLE);
                                        hdmi->display = HDMI_ENABLE;
                                        if(hdmi->hdcp_cb) {
                                                hdmi->hdcp_cb();
index 08743b8ff2c425e2fbe065ac4d82b6e9de4bef88..b80e6a376e5432fce60e1c227f6e3ea3abf2edc8 100755 (executable)
@@ -764,6 +764,7 @@ static int rk_fb_blank(int blank_mode, struct fb_info *info)
        struct rk_lcdc_driver *dev_drv = (struct rk_lcdc_driver *)info->par;
        struct fb_fix_screeninfo *fix = &info->fix;
        int win_id;
+       struct rk_fb *rk_fb = dev_get_drvdata(info->device);
 
        win_id = dev_drv->ops->fb_get_win_id(dev_drv, fix->id);
        if (win_id < 0)
index c92339c5e5d9dd172041778faede4ce4e5fd8eca..277af32403b77edf7c0a2cb2ce63cbfe3f1c08fd 100644 (file)
@@ -1,9 +1,6 @@
 
 #include <linux/rk_fb.h>
 #include "lcd.h"
-#if defined(CONFIG_RK_HDMI)
-#include "../hdmi/rk_hdmi.h"
-#endif
 #if defined(CONFIG_MACH_RK_FAC)
 #include <plat/config.h>
 extern uint lcd_param[LCD_PARAM_MAX];
@@ -14,7 +11,7 @@ extern uint lcd_param[LCD_PARAM_MAX];
 
 // if we use one lcdc with jetta for dual display,we need these configration
 #if defined(CONFIG_ONE_LCDC_DUAL_OUTPUT_INF) && defined(CONFIG_RK_HDMI)
-static int set_scaler_info(struct rk29fb_screen *screen, u8 hdmi_resolution)
+static int set_scaler_info(struct rk_screen *screen, u8 hdmi_resolution)
 {
        #if defined(CONFIG_RK610_LVDS)
        screen->s_clk_inv = S_DCLK_POL;
@@ -190,7 +187,7 @@ static int set_scaler_info(struct rk29fb_screen *screen, u8 hdmi_resolution)
 #define set_scaler_info  NULL
 #endif
 
-void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info )
+void set_lcd_info(struct rk_screen *screen, struct rk29lcd_info *lcd_info )
 {
 
 #if defined(RK_USE_SCREEN_ID)
index 97df3ffcf0d05632bb2d51a2caa18910a7b85d55..3b842915ccea3e94b90fcad3ceb921661ef9b22c 100644 (file)
@@ -72,7 +72,7 @@ static void rk610_scaler_disable(struct i2c_client *client)
     rk610_scaler_write_p0_reg(client, SCL_CON0, &c);
 }
 
-static int rk610_output_config(struct i2c_client *client,struct rk29fb_screen *screen,int mode)
+static int rk610_output_config(struct i2c_client *client,struct rk_screen *screen,int mode)
 {
     char c=0;
     RK610_DBG(&client->dev,"%s \n",__FUNCTION__);
@@ -121,7 +121,7 @@ static int rk610_output_config(struct i2c_client *client,struct rk29fb_screen *s
        return 0;
 }
 #if defined(CONFIG_HDMI_DUAL_DISP) || defined(CONFIG_ONE_LCDC_DUAL_OUTPUT_INF)
-static int rk610_scaler_pll_set(struct i2c_client *client,struct rk29fb_screen *screen,u32 clkin )
+static int rk610_scaler_pll_set(struct i2c_client *client,struct rk_screen *screen,u32 clkin )
 {
     char c=0;
     char M=0,N=0,OD=0;
@@ -188,7 +188,7 @@ static int  scale_hv_factor(struct i2c_client *client ,u32 Hin_act, u32 Hout_act
        return 0;
    }
 
-static int rk610_scaler_fator_config(struct i2c_client *client ,struct rk29fb_screen *screen)
+static int rk610_scaler_fator_config(struct i2c_client *client ,struct rk_screen *screen)
 {
     switch(screen->hdmi_resolution){
         case HDMI_1920x1080p_60Hz:
@@ -222,7 +222,7 @@ static int rk610_scaler_fator_config(struct i2c_client *client ,struct rk29fb_sc
     }
     return 0;
 }
-static int rk610_scaler_output_timing_config(struct i2c_client *client,struct rk29fb_screen *screen)
+static int rk610_scaler_output_timing_config(struct i2c_client *client,struct rk_screen *screen)
 {
     char c;
     int h_st = screen->s_hsync_st;
@@ -304,7 +304,7 @@ static int rk610_scaler_output_timing_config(struct i2c_client *client,struct rk
        
        return 0;
 }
-static int rk610_scaler_chg(struct i2c_client *client ,struct rk29fb_screen *screen)
+static int rk610_scaler_chg(struct i2c_client *client ,struct rk_screen *screen)
 {
 
     RK610_DBG(&client->dev,"%s screen->hdmi_resolution=%d\n",__FUNCTION__,screen->hdmi_resolution);
@@ -365,7 +365,7 @@ static void rk610_lcd_early_resume(struct early_suspend *h)
     }
 }
 #endif
-int rk610_lcd_scaler_set_param(struct rk29fb_screen *screen,bool enable )//enable:0 bypass 1: scale
+int rk610_lcd_scaler_set_param(struct rk_screen *screen,bool enable )//enable:0 bypass 1: scale
 {
     int ret=0;
     struct i2c_client *client = g_lcd_inf->client;
index 7b3376c699556ba21e2c207beb69ffc93089d524..33a4957b72cf3ed4c76746cdcd8f8246c3ea15fc 100644 (file)
@@ -217,7 +217,7 @@ struct scl_info{
 struct rk610_lcd_info{
     int disp_mode;
     
-    struct rk29fb_screen *screen;
+    struct rk_screen *screen;
     struct scl_info scl_inf;
     struct i2c_client *client;
 
@@ -226,5 +226,5 @@ struct rk610_lcd_info{
 #endif
 };
 extern int rk610_lcd_init(struct rk610_core_info *rk610_core_info);
-extern int rk610_lcd_scaler_set_param(struct rk29fb_screen *screen,bool enable );
+extern int rk610_lcd_scaler_set_param(struct rk_screen *screen,bool enable );
 #endif
index db2542c712d39a8679fe0f55d0b9487d4120fbcb..cad95cec1439740b8f55f2e4f07968127f636b8f 100644 (file)
@@ -90,7 +90,7 @@
 
 #ifdef CONFIG_MFD_RK616
 static struct mfd_rk616 *dsi_rk616;
-static struct rk29fb_screen *g_rk29fd_screen = NULL;
+static struct rk_screen *g_rk29fd_screen = NULL;
 #endif
 static struct dsi gDsi;
 static struct mipi_dsi_ops rk_mipi_dsi_ops;
index 03237ce4a410642a01b9bec97a52399973c1c8d1..83a6cec9766552c1fcc36eff1a219fee1e2b1092 100644 (file)
@@ -42,15 +42,15 @@ int rk610_tv_wirte_reg(u8 reg, u8 data)
 
 int rk610_switch_fb(const struct fb_videomode *modedb, int tv_mode)
 {      
-       struct rk29fb_screen *screen;
+       struct rk_screen *screen;
        
        if(modedb == NULL)
                return -1;
-       screen =  kzalloc(sizeof(struct rk29fb_screen), GFP_KERNEL);
+       screen =  kzalloc(sizeof(struct rk_screen), GFP_KERNEL);
        if(screen == NULL)
                return -1;
        
-       memset(screen, 0, sizeof(struct rk29fb_screen));        
+       memset(screen, 0, sizeof(struct rk_screen));    
        /* screen type & face */
     screen->type = SCREEN_HDMI;
        screen->mode = modedb->vmode;
index 422e8f25c83ac86d90821ee3c5686f8e5abba585..ead23a8a06a1e6f5de51bd06c02bf284fde987eb 100644 (file)
@@ -108,7 +108,7 @@ enum {
 extern volatile int rk610_tv_output_status;
 extern struct rk_display_ops rk610_display_ops;
 
-extern int FB_Switch_Screen( struct rk29fb_screen *screen, u32 enable );
+extern int FB_Switch_Screen( struct rk_screen *screen, u32 enable );
 
 extern int rk610_tv_wirte_reg(u8 reg, u8 data);
 extern int rk610_tv_standby(int type);
index 03b2d6e2e54ec4b2b26f7f06346043b219121864..1f05fef8853df7295314356ef2c9b0a594eab27c 100755 (executable)
@@ -290,8 +290,8 @@ struct mfd_rk616 {
        int (*write_bulk)(struct mfd_rk616 *rk616,u16 reg,int count,u32 *pval);
 };
 
-extern int rk616_set_vif(struct mfd_rk616 * rk616,rk_screen * screen,bool connect);
-extern int rk616_display_router_cfg(struct mfd_rk616 *rk616,rk_screen *screen,bool enable);
+extern int rk616_set_vif(struct mfd_rk616 * rk616,struct rk_screen * screen,bool connect);
+extern int rk616_display_router_cfg(struct mfd_rk616 *rk616,struct rk_screen *screen,bool enable);
 extern void rk616_mclk_set_rate(struct clk *mclk,unsigned long rate);