int dss_sdi_enable(void) { unsigned long timeout; dispc_pck_free_enable(1); /* Reset SDI PLL */ REG_FLD_MOD(DSS_PLL_CONTROL, 1, 18, 18); /* SDI_PLL_SYSRESET */ udelay(1); /* wait 2x PCLK */ /* Lock SDI PLL */ REG_FLD_MOD(DSS_PLL_CONTROL, 1, 28, 28); /* SDI_PLL_GOBIT */ /* Waiting for PLL lock request to complete */ timeout = jiffies + msecs_to_jiffies(500); while (dss_read_reg(DSS_SDI_STATUS) & (1 << 6)) { if (time_after_eq(jiffies, timeout)) { DSSERR("PLL lock request timed out\n"); goto err1; } } /* Clearing PLL_GO bit */ REG_FLD_MOD(DSS_PLL_CONTROL, 0, 28, 28); /* Waiting for PLL to lock */ timeout = jiffies + msecs_to_jiffies(500); while (!(dss_read_reg(DSS_SDI_STATUS) & (1 << 5))) { if (time_after_eq(jiffies, timeout)) { DSSERR("PLL lock timed out\n"); goto err1; } } dispc_lcd_enable_signal(1); /* Waiting for SDI reset to complete */ timeout = jiffies + msecs_to_jiffies(500); while (!(dss_read_reg(DSS_SDI_STATUS) & (1 << 2))) { if (time_after_eq(jiffies, timeout)) { DSSERR("SDI reset timed out\n"); goto err2; } } return 0; err2: dispc_lcd_enable_signal(0); err1: /* Reset SDI PLL */ REG_FLD_MOD(DSS_PLL_CONTROL, 0, 18, 18); /* SDI_PLL_SYSRESET */ dispc_pck_free_enable(0); return -ETIMEDOUT; }
void dss_sdi_enable(void) { dispc_pck_free_enable(1); /* Reset SDI PLL */ REG_FLD_MOD(DSS_PLL_CONTROL, 1, 18, 18); /* SDI_PLL_SYSRESET */ udelay(1); /* wait 2x PCLK */ /* Lock SDI PLL */ REG_FLD_MOD(DSS_PLL_CONTROL, 1, 28, 28); /* SDI_PLL_GOBIT */ /* Waiting for PLL lock request to complete */ while (dss_read_reg(DSS_SDI_STATUS) & (1 << 6)) ; /* Clearing PLL_GO bit */ REG_FLD_MOD(DSS_PLL_CONTROL, 0, 28, 28); /* Waiting for PLL to lock */ while (!(dss_read_reg(DSS_SDI_STATUS) & (1 << 5))) ; dispc_lcd_enable_signal(1); /* Waiting for SDI reset to complete */ while (!(dss_read_reg(DSS_SDI_STATUS) & (1 << 2))) ; }
void dss_sdi_disable(void) { dispc_lcd_enable_signal(0); dispc_pck_free_enable(0); /* Reset SDI PLL */ REG_FLD_MOD(DSS_PLL_CONTROL, 0, 18, 18); /* SDI_PLL_SYSRESET */ }