byte DoEdidRead (struct i2c_client *client);\r
static int RK610_hdmi_soft_reset(struct i2c_client *client);\r
static int Rk610_hdmi_Display_switch(struct i2c_client *client);\r
-static void Rk610_hdmi_plug(struct i2c_client *client);\r
-static void Rk610_hdmi_unplug(struct i2c_client *client);\r
+static int Rk610_hdmi_sys_power_up(struct i2c_client *client);\r
+static int Rk610_hdmi_sys_power_down(struct i2c_client *client);\r
\r
static int Rk610_hdmi_i2c_read_p0_reg(struct i2c_client *client, char reg, char *val)\r
{\r
{\r
return i2c_master_reg8_send(client, reg, val, 1, 100*1000) > 0? 0: -EINVAL;\r
}\r
-\r
+static int RK610_hdmi_audio_mute(struct i2c_client *client,bool enable)\r
+{\r
+ char c;\r
+ int ret=0;\r
+ c = ((~enable)&1)<<1;\r
+ ret =Rk610_hdmi_i2c_write_p0_reg(client, 0x05, &c);\r
+}\r
static int Rk610_hdmi_pwr_mode(struct i2c_client *client, int mode)\r
{\r
char c;\r
int ret=0;\r
+ RK610_DBG(&client->dev,"%s \n",__FUNCTION__);\r
switch(mode){\r
case NORMAL:\r
+ Rk610_hdmi_sys_power_down(client);\r
+ c=0x82;\r
+ ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe3, &c);\r
+ c=0x00;\r
+ ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe5, &c);\r
c=0x00;\r
ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe4, &c);\r
c=0x00;\r
ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe7, &c);\r
c=0x8e;\r
- ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe1, &c);\r
- c=0x00;\r
- ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe5, &c);\r
- c=0x82;\r
- ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe3, &c); \r
- break;\r
+ ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe1, &c);\r
+ c=0x00;\r
+ ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xce, &c);\r
+ c=0x01;\r
+ ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xce, &c);\r
+ RK610_hdmi_audio_mute(client,1);\r
+ Rk610_hdmi_sys_power_up(client);\r
+ g_hw_inf.analog_sync = 1;\r
+ break;\r
case LOWER_PWR:\r
+ RK610_hdmi_audio_mute(client,0);\r
+ Rk610_hdmi_sys_power_down(client);\r
c=0x02;\r
ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe3, &c);\r
c=0x1c;\r
ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe7, &c);\r
c=0x03;\r
ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xe4, &c);\r
- break;\r
+ break;\r
default:\r
RK610_ERR(&client->dev,"unkown rk610 hdmi pwr mode %d\n",mode);\r
}\r
return ret;\r
}\r
#endif\r
-static int Rk610_hdmi_sys_power_down(struct i2c_client *client)\r
+static int Rk610_hdmi_sys_power_up(struct i2c_client *client)\r
{\r
char c = 0;\r
int ret = 0;\r
RK610_DBG(&client->dev,"%s \n",__FUNCTION__);\r
- c= RK610_SYS_CLK<<2 |RK610_SYS_PWR_OFF<<1 |RK610_INT_POL;\r
+ c= RK610_SYS_CLK<<2 |RK610_SYS_PWR_ON<<1 |RK610_INT_POL;\r
ret =Rk610_hdmi_i2c_write_p0_reg(client, 0x00, &c);\r
return ret;\r
}\r
-static int Rk610_hdmi_sys_power_up(struct i2c_client *client)\r
+static int Rk610_hdmi_sys_power_down(struct i2c_client *client)\r
{\r
char c = 0;\r
int ret = 0;\r
RK610_DBG(&client->dev,"%s \n",__FUNCTION__);\r
- c= RK610_SYS_CLK<<2 |RK610_SYS_PWR_ON<<1 |RK610_INT_POL;\r
+ c= RK610_SYS_CLK<<2 |RK610_SYS_PWR_OFF<<1 |RK610_INT_POL;\r
ret =Rk610_hdmi_i2c_write_p0_reg(client, 0x00, &c);\r
return ret;\r
}\r
ret = Rk610_hdmi_i2c_write_p0_reg(client, 0xe5, &c);\r
return 0;\r
}\r
-static void Rk610_hdmi_plug(struct i2c_client *client)\r
+void Rk610_hdmi_plug(struct i2c_client *client)\r
{\r
RK610_DBG(&client->dev,">>> hdmi plug \n");\r
DoEdidRead(client);\r
Rk610_hdmi_Display_switch(client);\r
- Rk610_hdmi_pwr_mode(client,LOWER_PWR);\r
Rk610_hdmi_pwr_mode(client,NORMAL);\r
}\r
-static void Rk610_hdmi_unplug(struct i2c_client *client)\r
+void Rk610_hdmi_unplug(struct i2c_client *client)\r
{\r
RK610_DBG(&client->dev,">>> hdmi unplug \n");\r
g_edid.edidDataValid = FALSE;\r
ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xc1, &c);\r
ret =Rk610_hdmi_i2c_read_p0_reg(client, 0xc8, &c);\r
if(c & RK610_HPD_PLUG ){\r
- Rk610_hdmi_plug(client);\r
+ // Rk610_hdmi_plug(client);\r
g_hw_inf.hpd=1;\r
}\r
else{\r
- Rk610_hdmi_unplug(client);\r
+ // Rk610_hdmi_unplug(client);\r
g_hw_inf.hpd=0;\r
}\r
\r
int ret=0;\r
RK610_DBG(&client->dev,"%s \n",__FUNCTION__);\r
\r
- ret =Rk610_hdmi_sys_power_up(client);\r
+ ret =Rk610_hdmi_sys_power_down(client);\r
\r
if(g_hw_inf.config_param != 0){\r
c=0x08;\r
g_hw_inf.config_param &= (~AUDIO_CHANGE); \r
}\r
}\r
- ret =Rk610_hdmi_sys_power_down(client);\r
ret =Rk610_hdmi_sys_power_up(client);\r
ret =Rk610_hdmi_sys_power_down(client);\r
+ ret =Rk610_hdmi_sys_power_up(client);\r
+ if(g_hw_inf.analog_sync){\r
+ c=0x00;\r
+ ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xce, &c);\r
+ c=0x01;\r
+ ret =Rk610_hdmi_i2c_write_p0_reg(client, 0xce, &c);\r
+ g_hw_inf.analog_sync = 0;\r
+ }\r
\r
return ret;\r
}\r
g_hw_inf.config_param = AUDIO_CHANGE | VIDEO_CHANGE;\r
g_hw_inf.hpd = 0;\r
g_hw_inf.suspend_flag = 0;\r
-\r
+ g_hw_inf.analog_sync = 0;\r
}\r
int Rk610_hdmi_init(struct i2c_client *client)\r
{\r
Rk610_hdmi_Set_Video(g_hw_inf.video_format);\r
Rk610_hdmi_Set_Audio(g_hw_inf.audio_fs);\r
Rk610_hdmi_Config_Done(client);\r
- \r
Rk610_hdmi_i2c_read_p0_reg(client, 0xc8, &c);\r
- if(c & RK610_HPD_PLUG ){\r
+ if(c & RK610_HPD_PLUG ){\r
Rk610_hdmi_plug(client);\r
- g_hw_inf.hpd=1;\r
+ g_hw_inf.hpd=1;\r
}else{\r
- Rk610_hdmi_unplug(client);\r
- g_hw_inf.hpd=0;\r
+ Rk610_hdmi_unplug(client);\r
+ g_hw_inf.hpd=0;\r
}\r
return 0;\r
}\r
enum{
SCALE_PLL(148500000, 66000000, 16, 9, 4),
- SCALE_PLL(148500000, 54000000, 16, 11, 4),
+ SCALE_PLL(148500000, 57375000, 17, 11, 4),
+ SCALE_PLL(148500000, 54000000, 16, 11, 4),
SCALE_PLL(148500000, 33000000, 16, 9, 8),
SCALE_PLL(148500000, 30375000, 18, 11, 8),
SCALE_PLL(148500000, 29700000, 16, 10, 8),
SCALE_PLL(148500000, 25312500, 15, 11, 8),
SCALE_PLL(74250000, 66000000, 32, 9, 4),
+ SCALE_PLL(74250000, 57375000, 34, 11, 4),
SCALE_PLL(74250000, 54000000, 32, 11, 4),
SCALE_PLL(74250000, 33000000, 32, 9, 8),
SCALE_PLL(74250000, 30375000, 36, 11, 8),
SCALE_PLL(74250000, 25312500, 30, 11, 8),
+ SCALE_PLL(27000000, 75000000, 100, 9, 4),
+ SCALE_PLL(27000000, 72000000, 32, 3, 4),
+ SCALE_PLL(27000000, 63281250, 75, 4, 8),
+ SCALE_PLL(27000000, 54375000, 145, 9, 8),
SCALE_PLL(27000000, 31500000, 28, 3, 8),
SCALE_PLL(27000000, 30000000, 80, 9, 8),
};
u16 s_vsync_len;
u16 s_hsync_st;
u16 s_vsync_st;
+ bool s_den_inv;
+ bool s_hv_sync_inv;
+ bool s_clk_inv;
#endif
u8 hdmi_resolution;
/* mcu need */