//#define EDP_BIST_MODE
static struct rk32_edp *rk32_edp;
-
-
+static int lcdc_probed = 0;
static int rk32_edp_clk_enable(struct rk32_edp *edp)
{
if (!edp->clk_on) {
val = 0x80000000;
writel_relaxed(val, RK_CRU_VIRT + 0x01d0);
udelay(1);
-
return 0;
}
struct rk32_edp *edp = arg;
enum dp_irq_type irq_type;
- irq_type = rk32_edp_get_irq_type(edp);
+ if (!lcdc_probed) {
+ disable_irq_nosync(edp->irq);
+ return 0;
+ }
+ irq_type = rk32_edp_get_irq_type(edp);
+ switch (irq_type) {
+ case DP_IRQ_TYPE_HP_CABLE_IN:
+ dev_info(edp->dev, "Received irq - cable in\n");
+ rk32_edp_clear_hotplug_interrupts(edp);
+ break;
+ case DP_IRQ_TYPE_HP_CABLE_OUT:
+ dev_info(edp->dev, "Received irq - cable out\n");
+ rk32_edp_clear_hotplug_interrupts(edp);
+ break;
+ case DP_IRQ_TYPE_HP_CHANGE:
+ /*
+ * We get these change notifications once in a while, but there
+ * is nothing we can do with them. Just ignore it for now and
+ * only handle cable changes.
+ */
+ dev_info(edp->dev, "Received irq - hotplug change; ignoring.\n");
+ rk32_edp_clear_hotplug_interrupts(edp);
+ break;
+ default:
+ dev_err(edp->dev, "Received irq - unknown type!\n");
+ break;
+ }
return IRQ_HANDLED;
}
rk32_edp_clk_enable(edp);
rk32_edp_pre_init();
+ lcdc_probed = 1;
rk32_edp_init_edp(edp);
-
+ enable_irq(edp->irq);
/*ret = rk32_edp_handle_edid(edp);
if (ret) {
dev_err(edp->dev, "unable to handle edid\n");
{
struct rk32_edp *edp = rk32_edp;
+ disable_irq(edp->irq);
rk32_edp_reset(edp);
rk32_edp_analog_power_ctr(edp, 0);
rk32_edp_clk_disable(edp);
edp->video_info.color_space = CS_RGB;
edp->video_info.dynamic_range = VESA;
edp->video_info.ycbcr_coeff = COLOR_YCBCR601;
- edp->video_info.color_depth = COLOR_8;
+ edp->video_info.color_depth = COLOR_6;
edp->video_info.link_rate = LINK_RATE_1_62GBPS;
edp->video_info.lane_count = LANE_CNT4;
clk_prepare(edp->pclk);
clk_prepare(edp->clk_edp);
clk_prepare(edp->clk_24m);
- rk32_edp_clk_enable(edp);
- rk32_edp_pre_init();
edp->irq = platform_get_irq(pdev, 0);
if (edp->irq < 0) {
dev_err(&pdev->dev, "cannot find IRQ\n");
dev_err(&pdev->dev, "cannot claim IRQ %d\n", edp->irq);
return ret;
}
- disable_irq(edp->irq);
- rk32_edp_clk_disable(edp);
+ disable_irq_nosync(edp->irq);
rk32_edp = edp;
rk_fb_trsm_ops_register(&trsm_edp_ops, SCREEN_EDP);
dev_info(&pdev->dev, "rk32 edp driver probe success\n");