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>;
};
};
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);
\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
\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
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
#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)
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);
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) {
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);
/* 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;
hdmi->yscale = 100;
- hdmi_sys_init();
+ hdmi_sys_init(hdmi);
hdmi->workqueue = create_singlethread_workqueue("hdmi");
INIT_DELAYED_WORK(&(hdmi->delay_work), hdmi_work);
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) {
}
}
#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");
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);
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",
#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),
#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;
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);
}
-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;
}
-int rk616_hdmi_detect_hotplug(void)
+int rk616_hdmi_detect_hotplug(struct hdmi *hdmi)
{
int value = 0;
#if 0
}
-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;
}
-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;
}
if(hdmi->pwr_mode == LOWER_PWR) {
- rk616_hdmi_set_pwr_mode(NORMAL);
+ rk616_hdmi_set_pwr_mode(hdmi, NORMAL);
}
// 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));
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;
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));
}
}
-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;
#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
#endif
}
-static void rk616_hdmi_reset(void)
+static void rk616_hdmi_reset(struct hdmi *hdmi)
{
u32 val = 0;
u32 msk = 0;
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;
#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
#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)
{
}
#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
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;
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);
#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);
}\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
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
};
-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;
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 */
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;
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);
}
* NOTES:
*
*/
+extern struct hdmi *hdmi;
int hdmi_get_hotplug(void)
{
if(hdmi)
#include <linux/kernel.h>
#include <linux/delay.h>
+#include <linux/interrupt.h>
#include "rk_hdmi.h"
#ifdef CONFIG_RK_HDMI_CTL_CODEC
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");
}
}
-int hdmi_sys_init(void)
+int hdmi_sys_init(struct hdmi *hdmi)
{
hdmi->hotplug = HDMI_HPD_REMOVED;
hdmi->state = HDMI_SLEEP;
return 0;
}
-void hdmi_sys_remove(void)
+void hdmi_sys_remove(struct hdmi *hdmi)
{
int audio_need;
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);
#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;
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);
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);
}
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)
{
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);
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)
}
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();
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)
#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];
// 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;
#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)
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__);
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;
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:
}
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;
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);
}
}
#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;
struct rk610_lcd_info{
int disp_mode;
- struct rk29fb_screen *screen;
+ struct rk_screen *screen;
struct scl_info scl_inf;
struct i2c_client *client;
#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
#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;
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;
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);
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);