Cc: Rob Herring <rob.herring@xxxxxxxxxxx> Cc: Pawel Moll <pawel.moll@xxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Stephen Warren <swarren@xxxxxxxxxxxxx> Cc: Ian Campbell <ijc+devicetree@xxxxxxxxxxxxxx> Cc: devicetree@xxxxxxxxxxxxxxx Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: driverdev-devel@xxxxxxxxxxxxxxxxxxxxxx Cc: David Airlie <airlied@xxxxxxxx> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx Cc: Sascha Hauer <kernel@xxxxxxxxxxxxxx> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx Cc: Eric Bénard <eric@xxxxxxxxxx> Signed-off-by: Denis Carikli <denis@xxxxxxxxxx> --- drivers/staging/imx-drm/parallel-display.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/staging/imx-drm/parallel-display.c b/drivers/staging/imx-drm/parallel-display.c index 1c8f63f..dfab7b5 100644 --- a/drivers/staging/imx-drm/parallel-display.c +++ b/drivers/staging/imx-drm/parallel-display.c @@ -22,6 +22,7 @@ #include <drm/drmP.h> #include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h> +#include <linux/regulator/consumer.h> #include <linux/videodev2.h> #include <video/videomode.h> #include <video/of_display_timing.h> @@ -37,6 +38,7 @@ struct imx_parallel_display { struct drm_encoder encoder; struct imx_drm_encoder *imx_drm_encoder; struct device *dev; + struct regulator *lcd_reg; void *edid; int edid_len; u32 interface_pix_fmt; @@ -129,6 +131,10 @@ static void imx_pd_encoder_prepare(struct drm_encoder *encoder) { struct imx_parallel_display *imxpd = enc_to_imxpd(encoder); + if (imxpd->lcd_reg) + if (regulator_enable(imxpd->lcd_reg)) + dev_err(imxpd->dev, "Failed to enable lcd regulator.\n"); + imx_drm_crtc_panel_format(encoder->crtc, DRM_MODE_ENCODER_NONE, imxpd->interface_pix_fmt); } @@ -145,6 +151,11 @@ static void imx_pd_encoder_mode_set(struct drm_encoder *encoder, static void imx_pd_encoder_disable(struct drm_encoder *encoder) { + struct imx_parallel_display *imxpd = enc_to_imxpd(encoder); + + if (imxpd->lcd_reg) + if (regulator_disable(imxpd->lcd_reg)) + dev_err(imxpd->dev, "Failed to disable lcd regulator.\n"); } static void imx_pd_encoder_destroy(struct drm_encoder *encoder) @@ -248,6 +259,14 @@ static int imx_pd_probe(struct platform_device *pdev) if (ret) return ret; + imxpd->lcd_reg = devm_regulator_get(&pdev->dev, "lcd"); + if (IS_ERR(imxpd->lcd_reg)) { + dev_dbg(&pdev->dev, "no lcd-supply given.\n"); + imxpd->lcd_reg = NULL; + } else { + dev_info(&pdev->dev, "lcd-supply found.\n"); + } + ret = imx_drm_encoder_add_possible_crtcs(imxpd->imx_drm_encoder, np); platform_set_drvdata(pdev, imxpd); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html