All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 05/26] OMAPDSS: DPI: fix regulators
Date: Wed, 27 Mar 2013 09:57:57 +0000	[thread overview]
Message-ID: <5152C274.4070901@ti.com> (raw)
In-Reply-To: <1364304836-18134-6-git-send-email-tomi.valkeinen@ti.com>

On Tuesday 26 March 2013 07:03 PM, Tomi Valkeinen wrote:
> On some platforms DPI requires a regulator to be enabled to power up the
> output pins. This regulator is, for some reason, currently attached to
> the virtual omapdss device, instead of the DPI device. This does not
> work for DT, as the regulator mappings need to be described in the DT
> data, and the virtual omapdss device is not present there.
>
> Fix the issue by acquiring the regulator in the DPI device. To retain
> compatibility with the current board files, the old method of getting
> the regulator is kept. The old method can be removed when the board
> files have been changed to pass the regulator to DPI.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>   drivers/video/omap2/dss/dpi.c |   21 ++++++++++++++++++---
>   1 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
> index ad67a9c..08342d1 100644
> --- a/drivers/video/omap2/dss/dpi.c
> +++ b/drivers/video/omap2/dss/dpi.c
> @@ -37,7 +37,10 @@
>   #include "dss_features.h"
>
>   static struct {
> +	struct platform_device *pdev;

We can use dpi.output.pdev, we don't really need to have another pdev 
pointer. Same for SDI in the next patch.

Archit

> +
>   	struct regulator *vdds_dsi_reg;
> +	bool vdds_dsi_from_core;
>   	struct platform_device *dsidev;
>
>   	struct mutex lock;
> @@ -583,10 +586,15 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev)
>   		struct regulator *vdds_dsi;
>
>   		vdds_dsi = dss_get_vdds_dsi();
> -
>   		if (IS_ERR(vdds_dsi)) {
> -			DSSERR("can't get VDDS_DSI regulator\n");
> -			return PTR_ERR(vdds_dsi);
> +			vdds_dsi = regulator_get(&dpi.pdev->dev, "vdds_dsi");
> +			if (IS_ERR(vdds_dsi)) {
> +				DSSERR("can't get VDDS_DSI regulator\n");
> +				return PTR_ERR(vdds_dsi);
> +			}
> +			dpi.vdds_dsi_from_core = false;
> +		} else {
> +			dpi.vdds_dsi_from_core = true;
>   		}
>
>   		dpi.vdds_dsi_reg = vdds_dsi;
> @@ -698,6 +706,8 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
>
>   static int __init omap_dpi_probe(struct platform_device *pdev)
>   {
> +	dpi.pdev = pdev;
> +
>   	mutex_init(&dpi.lock);
>
>   	dpi_init_output(pdev);
> @@ -714,6 +724,11 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
>
>   	dpi_uninit_output(pdev);
>
> +	if (dpi.vdds_dsi_reg != NULL && dpi.vdds_dsi_from_core = false) {
> +		regulator_put(dpi.vdds_dsi_reg);
> +		dpi.vdds_dsi_reg = NULL;
> +	}
> +
>   	return 0;
>   }
>
>


WARNING: multiple messages have this Message-ID (diff)
From: Archit Taneja <archit@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 05/26] OMAPDSS: DPI: fix regulators
Date: Wed, 27 Mar 2013 15:27:08 +0530	[thread overview]
Message-ID: <5152C274.4070901@ti.com> (raw)
In-Reply-To: <1364304836-18134-6-git-send-email-tomi.valkeinen@ti.com>

On Tuesday 26 March 2013 07:03 PM, Tomi Valkeinen wrote:
> On some platforms DPI requires a regulator to be enabled to power up the
> output pins. This regulator is, for some reason, currently attached to
> the virtual omapdss device, instead of the DPI device. This does not
> work for DT, as the regulator mappings need to be described in the DT
> data, and the virtual omapdss device is not present there.
>
> Fix the issue by acquiring the regulator in the DPI device. To retain
> compatibility with the current board files, the old method of getting
> the regulator is kept. The old method can be removed when the board
> files have been changed to pass the regulator to DPI.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>   drivers/video/omap2/dss/dpi.c |   21 ++++++++++++++++++---
>   1 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
> index ad67a9c..08342d1 100644
> --- a/drivers/video/omap2/dss/dpi.c
> +++ b/drivers/video/omap2/dss/dpi.c
> @@ -37,7 +37,10 @@
>   #include "dss_features.h"
>
>   static struct {
> +	struct platform_device *pdev;

We can use dpi.output.pdev, we don't really need to have another pdev 
pointer. Same for SDI in the next patch.

Archit

> +
>   	struct regulator *vdds_dsi_reg;
> +	bool vdds_dsi_from_core;
>   	struct platform_device *dsidev;
>
>   	struct mutex lock;
> @@ -583,10 +586,15 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev)
>   		struct regulator *vdds_dsi;
>
>   		vdds_dsi = dss_get_vdds_dsi();
> -
>   		if (IS_ERR(vdds_dsi)) {
> -			DSSERR("can't get VDDS_DSI regulator\n");
> -			return PTR_ERR(vdds_dsi);
> +			vdds_dsi = regulator_get(&dpi.pdev->dev, "vdds_dsi");
> +			if (IS_ERR(vdds_dsi)) {
> +				DSSERR("can't get VDDS_DSI regulator\n");
> +				return PTR_ERR(vdds_dsi);
> +			}
> +			dpi.vdds_dsi_from_core = false;
> +		} else {
> +			dpi.vdds_dsi_from_core = true;
>   		}
>
>   		dpi.vdds_dsi_reg = vdds_dsi;
> @@ -698,6 +706,8 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
>
>   static int __init omap_dpi_probe(struct platform_device *pdev)
>   {
> +	dpi.pdev = pdev;
> +
>   	mutex_init(&dpi.lock);
>
>   	dpi_init_output(pdev);
> @@ -714,6 +724,11 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
>
>   	dpi_uninit_output(pdev);
>
> +	if (dpi.vdds_dsi_reg != NULL && dpi.vdds_dsi_from_core == false) {
> +		regulator_put(dpi.vdds_dsi_reg);
> +		dpi.vdds_dsi_reg = NULL;
> +	}
> +
>   	return 0;
>   }
>
>


  reply	other threads:[~2013-03-27  9:57 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 13:33 [PATCH 00/26] DSS device model change Tomi Valkeinen
2013-03-26 13:33 ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 01/26] OMAPDSS: only probe pdata if there's one Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 02/26] OMAPDSS: add omap_dss_find_output() Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 03/26] OMAPDSS: add omap_dss_find_output_by_node() Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 04/26] OMAPDSS: fix dss_get_ctx_loss_count for DT Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 05/26] OMAPDSS: DPI: fix regulators Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-27  9:57   ` Archit Taneja [this message]
2013-03-27  9:57     ` Archit Taneja
2013-03-26 13:33 ` [PATCH 06/26] OMAPDSS: SDI: " Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 07/26] OMAPDSS: add panel list Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 08/26] OMAPDSS: use the panel list in omap_dss_get_next_device Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 09/26] OMAPDSS: don't use dss bus in suspend/resume Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 10/26] OMAPDSS: implement display sysfs without dss bus Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 11/26] OMAPDSS: Add panel_dev pointer to dssdev Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 12/26] OMAPDSS: DPI: new panel registration Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 13/26] OMAPDSS: DSI: " Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 14/26] OMAPDSS: HDMI: " Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 15/26] OMAPDSS: TFP410 platform_data changes Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 16/26] OMAPDSS: TFP410: convert to platform device Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-27 11:11   ` Archit Taneja
2013-03-27 11:23     ` Archit Taneja
2013-03-27 11:14     ` Tomi Valkeinen
2013-03-27 11:14       ` Tomi Valkeinen
2013-03-27 11:17       ` Archit Taneja
2013-03-27 11:29         ` Archit Taneja
2013-03-26 13:33 ` [PATCH 17/26] OMAPDSS: generic-dpi-panel platform_data changes Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 18/26] OMAPDSS: panel-generic-dpi: convert to platform device Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 19/26] OMAPDSS: HDMI: " Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 20/26] OMAPDSS: Taal platform_data changes Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 21/26] OMAPDSS: Taal: convert to platform device Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 22/26] ARM: OMAP: Panda: use new TFP410 platform driver Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 23/26] ARM: OMAP: Panda & SDP: use new HDMI driver Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 24/26] ARM: OMAP: 4430SDP: use new Taal driver Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 25/26] ARM: OMAP: Overo: use new TFP410 platform driver Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 13:33 ` [PATCH 26/26] ARM: OMAP: Overo: use new generic-dpi-panel " Tomi Valkeinen
2013-03-26 13:33   ` Tomi Valkeinen
2013-03-26 17:10 ` [PATCH 00/26] DSS device model change Tony Lindgren
2013-03-26 17:10   ` Tony Lindgren
2013-03-27  6:13   ` Tomi Valkeinen
2013-03-27  6:13     ` Tomi Valkeinen
2013-03-27 20:25     ` Tony Lindgren
2013-03-27 20:25       ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5152C274.4070901@ti.com \
    --to=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.