public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <a0393947@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 01/21] OMAPDSS: panel-dvi: add PD gpio handling
Date: Wed, 7 Mar 2012 23:17:07 +0530	[thread overview]
Message-ID: <4F579F1B.7040503@ti.com> (raw)
In-Reply-To: <1331124290-6285-2-git-send-email-tomi.valkeinen@ti.com>

Hi,

On Wednesday 07 March 2012 06:14 PM, Tomi Valkeinen wrote:
> The driver for the DVI framer should handle the power-down signal of the
> framer, instead of the current way of handling it in the board files.

What does framer mean?

>
> This patch adds power_down_gpio into the device's platform data, and
> adds the necessary code in the driver to request and handle the GPIO.
>
> Signed-off-by: Tomi Valkeinen<tomi.valkeinen@ti.com>
> ---
>   drivers/video/omap2/displays/panel-dvi.c |   31 ++++++++++++++++++++++++++++++
>   include/video/omap-panel-dvi.h           |    2 +
>   2 files changed, 33 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/omap2/displays/panel-dvi.c b/drivers/video/omap2/displays/panel-dvi.c
> index 03eb14a..876b798 100644
> --- a/drivers/video/omap2/displays/panel-dvi.c
> +++ b/drivers/video/omap2/displays/panel-dvi.c
> @@ -21,6 +21,7 @@
>   #include<linux/slab.h>
>   #include<video/omapdss.h>
>   #include<linux/i2c.h>
> +#include<linux/gpio.h>
>   #include<drm/drm_edid.h>
>
>   #include<video/omap-panel-dvi.h>
> @@ -44,6 +45,8 @@ struct panel_drv_data {
>   	struct omap_dss_device *dssdev;
>
>   	struct mutex lock;
> +
> +	int pd_gpio;
>   };
>
>   static inline struct panel_dvi_platform_data
> @@ -54,6 +57,7 @@ static inline struct panel_dvi_platform_data
>
>   static int panel_dvi_power_on(struct omap_dss_device *dssdev)
>   {
> +	struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev);
>   	struct panel_dvi_platform_data *pdata = get_pdata(dssdev);
>   	int r;
>
> @@ -70,6 +74,9 @@ static int panel_dvi_power_on(struct omap_dss_device *dssdev)
>   			goto err1;
>   	}
>
> +	if (gpio_is_valid(ddata->pd_gpio))
> +		gpio_set_value(ddata->pd_gpio, 1);
> +
>   	return 0;
>   err1:
>   	omapdss_dpi_display_disable(dssdev);
> @@ -79,11 +86,15 @@ err0:
>
>   static void panel_dvi_power_off(struct omap_dss_device *dssdev)
>   {
> +	struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev);
>   	struct panel_dvi_platform_data *pdata = get_pdata(dssdev);
>
>   	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
>   		return;
>
> +	if (gpio_is_valid(ddata->pd_gpio))
> +		gpio_set_value(ddata->pd_gpio, 0);
> +
>   	if (pdata->platform_disable)
>   		pdata->platform_disable(dssdev);
>
> @@ -92,7 +103,9 @@ static void panel_dvi_power_off(struct omap_dss_device *dssdev)
>
>   static int panel_dvi_probe(struct omap_dss_device *dssdev)
>   {
> +	struct panel_dvi_platform_data *pdata = get_pdata(dssdev);
>   	struct panel_drv_data *ddata;
> +	int r;
>
>   	ddata = kzalloc(sizeof(*ddata), GFP_KERNEL);
>   	if (!ddata)
> @@ -104,6 +117,21 @@ static int panel_dvi_probe(struct omap_dss_device *dssdev)
>   	ddata->dssdev = dssdev;
>   	mutex_init(&ddata->lock);
>
> +	if (pdata)
> +		ddata->pd_gpio = pdata->power_down_gpio;
> +	else
> +		ddata->pd_gpio = -1;
> +
> +	if (gpio_is_valid(ddata->pd_gpio)) {
> +		r = gpio_request_one(ddata->pd_gpio, GPIOF_OUT_INIT_LOW,
> +				"tfp410 pd");
> +		if (r) {
> +			dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n",
> +					ddata->pd_gpio);
> +			ddata->pd_gpio = -1;

Is the power down gpio not a necessary thing? If it is, we should quit 
here itself, shouldn't we?

Archit

> +		}
> +	}
> +
>   	dev_set_drvdata(&dssdev->dev, ddata);
>
>   	return 0;
> @@ -115,6 +143,9 @@ static void __exit panel_dvi_remove(struct omap_dss_device *dssdev)
>
>   	mutex_lock(&ddata->lock);
>
> +	if (gpio_is_valid(ddata->pd_gpio))
> +		gpio_free(ddata->pd_gpio);
> +
>   	dev_set_drvdata(&dssdev->dev, NULL);
>
>   	mutex_unlock(&ddata->lock);
> diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h
> index 87ad567b..4ad41fc 100644
> --- a/include/video/omap-panel-dvi.h
> +++ b/include/video/omap-panel-dvi.h
> @@ -27,11 +27,13 @@ struct omap_dss_device;
>    * @platform_enable: platform specific panel enable function
>    * @platform_disable: platform specific panel disable function
>    * @i2c_bus_num: i2c bus id for the panel
> + * @power_down_gpio: gpio number for PD pin (or -1 if not available)
>    */
>   struct panel_dvi_platform_data {
>   	int (*platform_enable)(struct omap_dss_device *dssdev);
>   	void (*platform_disable)(struct omap_dss_device *dssdev);
>   	u16 i2c_bus_num;
> +	int power_down_gpio;
>   };
>
>   #endif /* __OMAP_PANEL_DVI_H */


  reply	other threads:[~2012-03-07 17:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 12:44 [PATCH 00/21] OMAPDSS: DT preparation patches Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 01/21] OMAPDSS: panel-dvi: add PD gpio handling Tomi Valkeinen
2012-03-07 17:47   ` Archit Taneja [this message]
2012-03-08  7:54     ` Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 02/21] OMAP: board-files: remove custom PD GPIO handling for DVI output Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 03/21] OMAPDSS: TFP410: rename dvi -> tfp410 Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 04/21] OMAPDSS: TFP410: rename dvi files to tfp410 Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 05/21] OMAPDSS: TFP410: pdata rewrite Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 06/21] OMAPDSS: DSI: use dsi_get_dsidev_id(dsidev) instead of dsidev->id Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 07/21] OMAPDSS: Taal: move reset gpio handling to taal driver Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 08/21] OMAPDSS: clean up the omapdss platform data mess Tomi Valkeinen
2012-03-07 18:11   ` Archit Taneja
2012-03-08  8:02     ` Tomi Valkeinen
2012-03-08  8:17       ` Archit Taneja
2012-03-08  8:33         ` Tomi Valkeinen
2012-03-08  8:54           ` Archit Taneja
2012-03-07 12:44 ` [PATCH 09/21] OMAPDSS: remove return from platform_driver_unreg Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 10/21] OMAPDSS: use platform_driver_probe for core/dispc/dss Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 11/21] OMAPDSS: register dss drivers in module init Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 12/21] OMAPDSS: create custom pdevs for DSS omap_devices Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 13/21] OMAPDSS: create DPI & SDI devices Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 14/21] OMAPDSS: create DPI & SDI drivers Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 15/21] OMAPDSS: remove uses of dss_runtime_get/put Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 16/21] OMAPDSS: handle output-driver reg/unreg more dynamically Tomi Valkeinen
2012-03-08  8:34   ` Archit Taneja
2012-03-08  8:46     ` Tomi Valkeinen
2012-03-08  9:22       ` Archit Taneja
2012-03-08  9:34         ` Tomi Valkeinen
2012-03-08  9:50           ` Archit Taneja
2012-03-07 12:44 ` [PATCH 17/21] OMAPDSS: move the creation of debugfs files Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 18/21] OMAPDSS: use platform_driver_probe for dsi/hdmi/rfbi/venc/dpi/sdi Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 19/21] OMAPDSS: add __init & __exit Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 20/21] OMAPFB: " Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 21/21] OMAPDSS: change default_device handling Tomi Valkeinen

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=4F579F1B.7040503@ti.com \
    --to=a0393947@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox