Re: [PATCHv4][ 4/7] staging: imx-drm: parallel display: add regulator support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello.

Среда, 13 ноября 2013, 10:23 +01:00 от Denis Carikli <denis@xxxxxxxxxx>:
...
> --- a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
...
> @@ -139,6 +141,12 @@ static void imx_pd_encoder_prepare(struct drm_encoder *encoder)
>  {
>  	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
>  
> +	if (imxpd->disp_reg && !regulator_is_enabled(imxpd->disp_reg)) {

if (!IS_ERR(imxpd->disp_reg) && ...

> +		if (regulator_enable(imxpd->disp_reg))
> +			dev_err(imxpd->dev,
> +				"Failed to enable regulator.\n");
> +	}
> +
>  	imx_drm_crtc_panel_format(encoder->crtc, DRM_MODE_ENCODER_NONE,
>  			imxpd->interface_pix_fmt);
>  }
> @@ -155,6 +163,12 @@ 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->disp_reg && regulator_is_enabled(imxpd->disp_reg)) {

if (!IS_ERR(imxpd->disp_reg) && ...

> +		if (regulator_disable(imxpd->disp_reg))
> +			dev_err(imxpd->dev, "Failed to disable regulator.\n");
> +	}
>  }
>  
>  static void imx_pd_encoder_destroy(struct drm_encoder *encoder)
> @@ -258,6 +272,14 @@ static int imx_pd_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> +	imxpd->disp_reg = devm_regulator_get(&pdev->dev, "display");
> +	if (IS_ERR(imxpd->disp_reg)) {

if (PTR_ERR(imxpd->disp_reg) == -EPROBE_DEFER)
return -EPROBE_DEFER;

> +		dev_warn(&pdev->dev, "Operating without display regulator.\n");

dev_dbg

> +		imxpd->disp_reg = NULL;

No need set this to NULL;

> +	} else {
> +		dev_info(&pdev->dev, "Using display regulator.\n");

Useless.

...

---
��.n��������+%������w��{.n����z�{��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux