video: mxsfb: Add support for second lcd supply
Searches device tree for lcd2-supplypull/10/head
parent
95219396d6
commit
b255585a90
|
@ -252,6 +252,7 @@ struct mxsfb_info {
|
||||||
unsigned dotclk_delay;
|
unsigned dotclk_delay;
|
||||||
const struct mxsfb_devdata *devdata;
|
const struct mxsfb_devdata *devdata;
|
||||||
struct regulator *reg_lcd;
|
struct regulator *reg_lcd;
|
||||||
|
struct regulator *reg_lcd2;
|
||||||
bool wait4vsync;
|
bool wait4vsync;
|
||||||
struct completion vsync_complete;
|
struct completion vsync_complete;
|
||||||
struct completion flip_complete;
|
struct completion flip_complete;
|
||||||
|
@ -701,6 +702,15 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (host->reg_lcd2) {
|
||||||
|
ret = regulator_enable(host->reg_lcd2);
|
||||||
|
if (ret) {
|
||||||
|
dev_err(&host->pdev->dev,
|
||||||
|
"lcd2 regulator enable failed: %d\n", ret);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (host->dispdrv && host->dispdrv->drv->enable) {
|
if (host->dispdrv && host->dispdrv->drv->enable) {
|
||||||
ret = host->dispdrv->drv->enable(host->dispdrv, fb_info);
|
ret = host->dispdrv->drv->enable(host->dispdrv, fb_info);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -729,6 +739,13 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
|
||||||
"lcd regulator disable failed: %d\n",
|
"lcd regulator disable failed: %d\n",
|
||||||
ret);
|
ret);
|
||||||
}
|
}
|
||||||
|
if (host->reg_lcd2) {
|
||||||
|
ret = regulator_disable(host->reg_lcd2);
|
||||||
|
if (ret)
|
||||||
|
dev_err(&host->pdev->dev,
|
||||||
|
"lcd2 regulator disable failed: %d\n",
|
||||||
|
ret);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clk_enable_pix(host);
|
clk_enable_pix(host);
|
||||||
|
@ -799,6 +816,12 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
|
||||||
dev_err(&host->pdev->dev,
|
dev_err(&host->pdev->dev,
|
||||||
"lcd regulator disable failed: %d\n", ret);
|
"lcd regulator disable failed: %d\n", ret);
|
||||||
}
|
}
|
||||||
|
if (host->reg_lcd2) {
|
||||||
|
ret = regulator_disable(host->reg_lcd2);
|
||||||
|
if (ret)
|
||||||
|
dev_err(&host->pdev->dev,
|
||||||
|
"lcd2 regulator disable failed: %d\n", ret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2256,6 +2279,20 @@ static int mxsfb_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
host->reg_lcd2 = devm_regulator_get(&pdev->dev, "lcd2");
|
||||||
|
if (IS_ERR(host->reg_lcd2)) {
|
||||||
|
ret = PTR_ERR(host->reg_lcd2);
|
||||||
|
if (ret == -EPROBE_DEFER) {
|
||||||
|
dev_warn(&pdev->dev, "lcd2-supply not ready, deferring\n");
|
||||||
|
goto fb_release;
|
||||||
|
} else {
|
||||||
|
dev_err(&pdev->dev,
|
||||||
|
"Failed to get lcd2-supply (errno %d), ignoring\n",
|
||||||
|
ret);
|
||||||
|
host->reg_lcd2 = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = devm_request_irq(&pdev->dev, irq, mxsfb_irq_handler, 0,
|
ret = devm_request_irq(&pdev->dev, irq, mxsfb_irq_handler, 0,
|
||||||
dev_name(&pdev->dev), host);
|
dev_name(&pdev->dev), host);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
Loading…
Reference in New Issue