linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Igor Grinberg <grinberg@compulab.co.il>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Archit Taneja <archit@ti.com>,
	linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH 05/33] arm: omap: board-cm-t35: use generic dpi panel's gpio handling
Date: Thu, 04 Apr 2013 07:17:01 +0000	[thread overview]
Message-ID: <515D28ED.20807@compulab.co.il> (raw)
In-Reply-To: <515C1A3A.6050906@ti.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


[...]

>>> Can the LCD_BL_GPIO be handled by the omap panel driver? Otherwise the
>>> backlight will supposedly be always on. Is it just a simple switch for
>>> the BL power, which does not affect the SPI in any way?
>>
>> Yes, it can for now.
>> Also, I think we should also take into account the backlight framework,
>> including PMW.
> 
> I've updated this patch to set the LCD EN gpio once at boot time, and pass the
> LCD BL gpio to the panel driver. Updated patch below.
> 
> ---
> 
> commit a58a72363aa4359cdb75878de1517bd50faf9eb4
> Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Date:   Mon Dec 3 16:05:06 2012 +0530
> 
>     arm: omap: board-cm-t35: use generic dpi panel's gpio handling
>     
>     The cm-t35 board file currently requests gpios required to configure the tdo35s
>     panel, and provides platform_enable/disable callbacks to configure them.
>     
>     These tasks have been moved to the generic dpi panel driver itself and shouldn't
>     be done in the board files.
>     
>     Remove the gpio requests and the platform callbacks from the board file.
>     Add the gpio information to generic dpi panel's platform data so that it's
>     passed to the panel driver.
>     
>     Note: Only BL enable gpio is handled in the panel driver. The LCD enable
>     GPIO is handled in the board file at init time, as there's a 50 ms delay
>     required when using the GPIO, and the panel driver doesn't know about
>     that.
>     
>     Cc: Tony Lindgren <tony@atomide.com>
>     Cc: Igor Grinberg <grinberg@compulab.co.il>
>     Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Looks good, thanks!

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

> 
> diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
> index bccd3e5..cccbfea 100644
> --- a/arch/arm/mach-omap2/board-cm-t35.c
> +++ b/arch/arm/mach-omap2/board-cm-t35.c
> @@ -190,32 +190,6 @@ static inline void cm_t35_init_nand(void) {}
>  #define CM_T35_LCD_BL_GPIO 58
>  #define CM_T35_DVI_EN_GPIO 54
>  
> -static int lcd_enabled;
> -static int dvi_enabled;
> -
> -static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev)
> -{
> -	if (dvi_enabled) {
> -		printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
> -		return -EINVAL;
> -	}
> -
> -	gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
> -	gpio_set_value(CM_T35_LCD_BL_GPIO, 1);
> -
> -	lcd_enabled = 1;
> -
> -	return 0;
> -}
> -
> -static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
> -{
> -	lcd_enabled = 0;
> -
> -	gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
> -	gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
> -}
> -
>  static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
>  {
>  	return 0;
> @@ -227,8 +201,10 @@ static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)
>  
>  static struct panel_generic_dpi_data lcd_panel = {
>  	.name			= "toppoly_tdo35s",
> -	.platform_enable	= cm_t35_panel_enable_lcd,
> -	.platform_disable	= cm_t35_panel_disable_lcd,
> +	.num_gpios		= 1,
> +	.gpios			= {
> +		CM_T35_LCD_BL_GPIO,
> +	},
>  };
>  
>  static struct omap_dss_device cm_t35_lcd_device = {
> @@ -292,11 +268,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
>  	},
>  };
>  
> -static struct gpio cm_t35_dss_gpios[] __initdata = {
> -	{ CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,  "lcd enable"    },
> -	{ CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW,  "lcd bl enable" },
> -};
> -
>  static void __init cm_t35_init_display(void)
>  {
>  	int err;
> @@ -304,23 +275,21 @@ static void __init cm_t35_init_display(void)
>  	spi_register_board_info(cm_t35_lcd_spi_board_info,
>  				ARRAY_SIZE(cm_t35_lcd_spi_board_info));
>  
> -	err = gpio_request_array(cm_t35_dss_gpios,
> -				 ARRAY_SIZE(cm_t35_dss_gpios));
> +
> +	err = gpio_request_one(CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,
> +			"lcd bl enable");
>  	if (err) {
> -		pr_err("CM-T35: failed to request DSS control GPIOs\n");
> +		pr_err("CM-T35: failed to request LCD EN GPIO\n");
>  		return;
>  	}
>  
> -	gpio_export(CM_T35_LCD_EN_GPIO, 0);
> -	gpio_export(CM_T35_LCD_BL_GPIO, 0);
> -
>  	msleep(50);
>  	gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
>  
>  	err = omap_display_init(&cm_t35_dss_data);
>  	if (err) {
>  		pr_err("CM-T35: failed to register DSS device\n");
> -		gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios));
> +		gpio_free(CM_T35_LCD_EN_GPIO);
>  	}
>  }
>  
> 
> 

- -- 
Regards,
Igor.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRXSjtAAoJEBDE8YO64EfakqEP/RxTWET2KP1KRIs5VW6o6JXG
w4Mil7k62AmpClojEWMJTF6UfOc08Zmg4m5ZPly1mT2NAgwtwStP1hkTRuPuL34w
NMfbwro5uUf4Wp49ZxZyuLLEnlzVh8VPWPmHKc+pRl9XQOqS9fau+EBxmIXKSAgC
qdAjeT6ONIXhvIqVsgY+7oexeD0DG4GQiYl9/VPo7VWh1/Whv4X53WVMz6gdgfIm
ax0h/XYPAt743EoAyh7QHas4XkXsULmesJH4Pn7RE2BCtyuHYV1QB6Sut1gAmKMd
WUILWCHIdpOhH7JxcdIgSLbQVbHph2sPmtKoesO75LzgzcwA4YeX2ZOOHhgF5BDp
JnNzMtf/cxzkmzQm2FagIgr7vZAA1/eECit//20xEnHeVl9icKTiDBltunbYkphR
WUIGxCxIKlUhKG1OwDeSWRPbAY3ZvPQXSPpcSSGmvdxae9H0+xkwN1+l4MlPGVe0
G1cEclDxLiefueskIOVSs0nmlpxF7fBcCVq1dEL7Su5P1P1gdSsgEe/V5AAFAymf
RbLhqt4l9+5y6ow/tSRIPTUCUvGqJoYGwDWFhiD+Cyy2b2g5vOHQGQCZ2wqsSrxY
V5m6h5pKxdH9ibDFeQemNbAqz86nuk6sfUSk0dOX7vYt1zMSRwbZ8cdaB1zgrT23
d5A216IHqnW5iLhaJxbx
=GpgV
-----END PGP SIGNATURE-----

  reply	other threads:[~2013-04-04  7:17 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13 14:33 [PATCH 00/33] OMAPDSS: platform_enable/disable callback removal from panel drivers Archit Taneja
2013-02-13 14:33 ` [PATCH 01/33] OMAPDSS: panels: keep platform data of all panels in a single header Archit Taneja
2013-02-13 14:33 ` [PATCH 02/33] OMAPDSS: generic dpi panel: handle gpios in panel driver Archit Taneja
2013-02-13 14:33 ` [PATCH 03/33] arm: omap: board-2430: use generic dpi panel's gpio handling Archit Taneja
2013-02-13 14:33 ` [PATCH 04/33] arm: omap: board-devkit8000: " Archit Taneja
2013-02-13 14:33 ` [PATCH 05/33] arm: omap: board-cm-t35: " Archit Taneja
2013-02-13 15:16   ` Igor Grinberg
2013-02-13 15:28     ` Tomi Valkeinen
2013-02-13 15:59       ` Tomi Valkeinen
2013-02-14  6:56         ` Igor Grinberg
2013-02-14  7:09           ` Tomi Valkeinen
2013-02-14  8:37             ` Igor Grinberg
2013-02-14  9:09               ` Tomi Valkeinen
2013-02-14  9:43                 ` Igor Grinberg
2013-02-14 10:59                   ` Tomi Valkeinen
2013-02-14 12:37                     ` Igor Grinberg
2013-02-14 12:52                       ` Tomi Valkeinen
2013-02-14 13:51                         ` Igor Grinberg
2013-04-03 12:02                           ` Tomi Valkeinen
2013-04-04  7:17                             ` Igor Grinberg [this message]
2013-02-13 14:33 ` [PATCH 06/33] arm: omap: board-apollon: " Archit Taneja
2013-02-13 14:33 ` [PATCH 07/33] arm: omap: board-am3517: " Archit Taneja
2013-02-13 14:34 ` [PATCH 08/33] arm: omap: board-ldp: " Archit Taneja
2013-02-13 14:34 ` [PATCH 09/33] OMAPDSS: lb035q02: handle gpios in panel driver Archit Taneja
2013-02-13 14:34 ` [PATCH 10/33] arm: omap: board-overo: use lb035q02 dpi panel's gpio handling Archit Taneja
2013-02-13 14:34 ` [PATCH 11/33] OMAPDSS: lb035q02 panel: remove platform_enable/disable callbacks Archit Taneja
2013-02-13 14:34 ` [PATCH 12/33] OMAPDSS: generic dpi panel: remove platform_enable/disable ops from platform_data Archit Taneja
2013-02-13 14:34 ` [PATCH 13/33] arm: omap: board-omap3evm: use sharp panel's gpio handling Archit Taneja
2013-02-13 14:34 ` [PATCH 14/33] arm: omap: board-sdp3430: " Archit Taneja
2013-02-13 14:34 ` [PATCH 15/33] OMAPDSS: sharp-ls panel: remove platform_enable/disable callbacks Archit Taneja
2013-02-13 14:34 ` [PATCH 16/33] OMAPDSS: acx565akm panel: handle gpios in panel driver Archit Taneja
2013-02-13 17:29   ` Aaro Koskinen
2013-02-14  6:52     ` Archit Taneja
2013-02-14  6:58       ` Tomi Valkeinen
2013-02-14  7:20         ` Archit Taneja
2013-02-18  7:45         ` Archit Taneja
2013-02-18  8:11           ` Tomi Valkeinen
2013-02-18  8:35             ` Archit Taneja
2013-02-13 14:34 ` [PATCH 17/33] arm: omap: board-rx-51: use acx565akm panel's gpio handling Archit Taneja
2013-02-13 14:34 ` [PATCH 18/33] OMAPDSS: nec-nl8048 panel: handle gpios ins panel driver Archit Taneja
2013-02-13 14:34 ` [PATCH 19/33] arm: omap: board-zoom: use NEC panel's gpio handling Archit Taneja
2013-02-13 14:34 ` [PATCH 20/33] OMAPDSS: nec-nl8048 panel: remove platform_enable/disable callbacks Archit Taneja
2013-02-13 14:34 ` [PATCH 21/33] OMAPDSS: tpo-td043 panel: handle gpios in panel driver Archit Taneja
2013-02-13 14:34 ` [PATCH 22/33] arm: omap: board-omap3pandora: use tpo panel's gpio handling Archit Taneja
2013-02-13 14:34 ` [PATCH 23/33] OMAPDSS: tpo-td043: remove platform_enable/disable callbacks Archit Taneja
2013-02-13 14:34 ` [PATCH 24/33] OMAPDSS: picodlp panel: handle gpio data in panel driver Archit Taneja
2013-02-13 14:34 ` [PATCH 25/33] arm: omap: dss-common: use picodlp panel's gpio handling Archit Taneja
2013-02-13 14:34 ` [PATCH 26/33] OMAPDSS: picodlp panel: remove platform_enable/disable callbacks Archit Taneja
2013-02-13 14:34 ` [PATCH 27/33] OMAPDSS: n8x0 panel: handle gpio data in panel driver Archit Taneja
2013-02-13 17:35   ` Aaro Koskinen
2013-02-14  6:46     ` Archit Taneja
2013-02-14 12:45       ` Aaro Koskinen
2013-02-13 14:34 ` [PATCH 28/33] OMAPDSS: n8x0 panel: remove platform_enable/disable callbacks Archit Taneja
2013-02-13 14:34 ` [PATCH 29/33] arm: omap boards: Remove unnecessary platform_enable/disable callbacks for VENC device Archit Taneja
2013-02-13 14:34 ` [PATCH 30/33] OMAPDSS: VENC: remove platform_enable/disable calls Archit Taneja
2013-02-13 14:34 ` [PATCH 31/33] OMAPDSS: remove platform_enable/disable callbacks from omap_dss_device Archit Taneja
2013-02-13 14:34 ` [PATCH 32/33] arm: dss-common: don't use reset_gpio from omap4_panda_dvi_device Archit Taneja
2013-02-13 14:34 ` [PATCH 33/33] OMAPDSS: remove reset_gpio field from omap_dss_device Archit Taneja
2013-02-13 16:46 ` [PATCH 00/33] OMAPDSS: platform_enable/disable callback removal from panel drivers Tony Lindgren
2013-02-14  7:29   ` Archit Taneja
2013-04-03 12:28   ` Tomi Valkeinen
2013-04-03 15:46     ` Tony Lindgren
2013-04-15  9:29       ` Tomi Valkeinen
2013-04-15 21:20         ` Tony Lindgren
2013-04-16  4:20           ` Tomi Valkeinen
2013-04-18  0:34             ` Tony Lindgren
2013-04-18  3:40               ` 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=515D28ED.20807@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --cc=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).