}
#ifdef HDMI_INT_USE_POLL
+#define HDMI_POLL_MDELAY 100
static void rk3288_poll_delay_work(struct work_struct *work)
{
struct hdmi *hdmi_drv = &hdmi_dev->driver;
hdmi_irq(0, hdmi_drv);
}
if(hdmi_dev->irq == 0) {
- queue_delayed_work(hdmi_drv->workqueue, &hdmi_dev->delay_work, 100);
+ queue_delayed_work(hdmi_drv->workqueue, &hdmi_dev->delay_work, msecs_to_jiffies(HDMI_POLL_MDELAY));
}
}
}
return ret;
}
-static void rk3288_hdmi_early_suspend()
+static void rk3288_hdmi_early_suspend(void)
{
struct hdmi *hdmi_drv = &hdmi_dev->driver;
+ if(hdmi_drv->suspend)
+ return;
+
hdmi_dbg(hdmi_drv->dev, "hdmi enter early suspend pwr %d state %d\n", hdmi_drv->pwr_mode, hdmi_drv->state);
flush_delayed_work(&hdmi_drv->delay_work);
mutex_lock(&hdmi_drv->enable_mutex);
return;
}
-static void rk3288_hdmi_early_resume()
+static void rk3288_hdmi_early_resume(void)
{
struct hdmi *hdmi_drv = &hdmi_dev->driver;
+ if(!hdmi_drv->suspend)
+ return;
+
hdmi_dbg(hdmi_drv->dev, "hdmi enter early resume\n");
mutex_lock(&hdmi_drv->enable_mutex);
hdmi_drv->suspend = 0;
rk3288_hdmi_initial(hdmi_drv);
- if(hdmi_drv->enable) {
+ if(hdmi_dev->irq == 0){
+ queue_delayed_work(hdmi_drv->workqueue, &hdmi_dev->delay_work, msecs_to_jiffies(HDMI_POLL_MDELAY / 2));
+ }
+ else if(hdmi_drv->enable){
enable_irq(hdmi_drv->irq);
}
+ queue_delayed_work(hdmi_drv->workqueue, &hdmi_drv->delay_work, msecs_to_jiffies(10));
mutex_unlock(&hdmi_drv->enable_mutex);
return;
}
static const struct phy_mpll_config_tab PHY_MPLL_TABLE[] = { //opmode: 0:HDMI1.4 1:HDMI2.0
// |pixclock|pixrepet|colordepth|prepdiv|tmdsmhl|opmode|fbdiv2|fbdiv1|ref_cntrl|nctrl|propctrl|intctrl|gmpctrl|
- {27000000, 0, 8, 0, 0, 0, 2, 3, 0, 3, 3, 0, 0},
- {74250000, 0, 8, 0, 0, 0, 2, 3, 0, 3, 7, 0, 3},
- {148500000, 0, 8, 0, 0, 0, 1, 3, 0, 2, 7, 0, 3},
+ {27000000, 0, 8, 0, 0, 0, 2, 3, 0, 3, 7, 0, 3},
+ {74250000, 0, 8, 0, 0, 0, 4, 3, 3, 2, 7, 0, 3},
+ {148500000, 0, 8, 0, 0, 0, 4, 3, 3, 2, 7, 0, 3},
{297000000, 0, 8, 0, 0, 0, 1, 3, 0, 2, 7, 0, 3},
{297000000, 0, 16, 3, 3, 1, 1, 1, 0, 0, 5, 0, 3},
{594000000, 0, 8, 0, 3, 1, 1, 0, 0, 0, 3, 0, 3},
}
msleep(100);
#else
- msleep(300);
+ msleep(50);
return 0;
#endif
}
rk3288_hdmi_write_phy(hdmi_dev, PHYTX_PLLCURRCTRL, v_MPLL_PROP_CNTRL(phy_mpll->prop_cntrl) | v_MPLL_INT_CNTRL(phy_mpll->int_cntrl));
rk3288_hdmi_write_phy(hdmi_dev, PHYTX_PLLGMPCTRL, v_MPLL_GMP_CNTRL(phy_mpll->gmp_cntrl));
}
- if(hdmi_drv->tmdsclk == 74250000) {
+ if(hdmi_drv->tmdsclk <= 74250000) {
rk3288_hdmi_write_phy(hdmi_dev, PHYTX_CLKSYMCTRL, v_OVERRIDE(1) | v_SLOPEBOOST(0)
| v_TX_SYMON(1) | v_TX_TRAON(0) | v_TX_TRBON(0) | v_CLK_SYMON(1));
rk3288_hdmi_write_phy(hdmi_dev, PHYTX_TERM_RESIS, v_TX_TERM(R100_Ohms));
}
if((stat & m_PHY_LOCK) == 0) {
stat = hdmi_readl(hdmi_dev, MC_LOCKONCLOCK);
- hdmi_err(hdmi_dev->dev, "PHY PLL not locked: PCLK_ON=%d,TMDSCLK_ON=%d\n", stat & m_PCLK_ON, stat & m_TMDSCLK_ON);
+ hdmi_err(hdmi_dev->dev, "PHY PLL not locked: PCLK_ON=%d,TMDSCLK_ON=%d\n", (stat & m_PCLK_ON) >> 6, (stat & m_TMDSCLK_ON) >> 5);
return -1;
}