public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Igor Grinberg <grinberg@compulab.co.il>
Cc: "Janorkar, Mayuresh" <mayur@ti.com>,
	"tony@atomide.com" <tony@atomide.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Stanley Miao <stanley.miao@windriver.com>
Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2
Date: Tue, 17 May 2011 14:49:00 +0300	[thread overview]
Message-ID: <1305632940.1847.8.camel@deskari> (raw)
In-Reply-To: <4DD106BD.4070009@compulab.co.il>

On Mon, 2011-05-16 at 14:13 +0300, Igor Grinberg wrote:
> On 05/16/11 11:53, Tomi Valkeinen wrote:
> 
> > Here's an updated patch with the twl gpio code.
> 
> Looks good, though one minor issue below
> 
> > All the old omapfb porting patches, including new drivers for DSS2, can
> > be found from 
> >
> > git://gitorious.org/linux-omap-dss2/linux.git old-omapfb-port
> >
> >  Tomi
> >
> > diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> > index e2ba779..ed78b9a 100644
> > --- a/arch/arm/mach-omap2/board-ldp.c
> > +++ b/arch/arm/mach-omap2/board-ldp.c
> > @@ -44,6 +44,9 @@
> >  #include <asm/delay.h>
> >  #include <plat/usb.h>
> >  
> > +#include <video/omapdss.h>
> > +#include <video/omap-panel-generic-dpi.h>
> > +
> >  #include "board-flash.h"
> >  #include "mux.h"
> >  #include "hsmmc.h"
> > @@ -275,19 +278,70 @@ static inline void __init ldp_init_smsc911x(void)
> >  	gpio_direction_input(eth_gpio);
> >  }
> >  
> > -static struct platform_device ldp_lcd_device = {
> > -	.name		= "ldp_lcd",
> > -	.id		= -1,
> > +/* LCD */
> > +
> > +static int ldp_backlight_gpio;
> > +static int ldp_lcd_enable_gpio;
> > +
> > +#define LCD_PANEL_RESET_GPIO		55
> > +#define LCD_PANEL_QVGA_GPIO		56
> > +
> > +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
> > +{
> > +	gpio_direction_output(ldp_lcd_enable_gpio, 1);
> > +	gpio_direction_output(ldp_backlight_gpio, 1);
> > +
> > +	return 0;
> > +}
> > +
> > +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
> > +{
> > +	gpio_direction_output(ldp_lcd_enable_gpio, 0);
> > +	gpio_direction_output(ldp_backlight_gpio, 0);
> > +}
> > +
> > +static struct panel_generic_dpi_data ldp_panel_data = {
> > +	.name			= "2430sdp",
> > +	.platform_enable	= ldp_panel_enable_lcd,
> > +	.platform_disable	= ldp_panel_disable_lcd,
> > +};
> > +
> > +static struct omap_dss_device ldp_lcd_device = {
> > +	.name			= "lcd",
> > +	.driver_name		= "generic_dpi_panel",
> > +	.type			= OMAP_DISPLAY_TYPE_DPI,
> > +	.phy.dpi.data_lines	= 16,
> > +	.data			= &ldp_panel_data,
> >  };
> >  
> > -static struct omap_lcd_config ldp_lcd_config __initdata = {
> > -	.ctrl_name	= "internal",
> > +static struct omap_dss_device *ldp_dss_devices[] = {
> > +	&ldp_lcd_device,
> >  };
> >  
> > -static struct omap_board_config_kernel ldp_config[] __initdata = {
> > -	{ OMAP_TAG_LCD,		&ldp_lcd_config },
> > +static struct omap_dss_board_info ldp_dss_data = {
> > +	.num_devices	= ARRAY_SIZE(ldp_dss_devices),
> > +	.devices	= ldp_dss_devices,
> > +	.default_device	= &ldp_lcd_device,
> >  };
> >  
> > +static void __init ldp_display_init(void)
> > +{
> > +	int r;
> > +
> > +	static struct gpio gpios[] __initdata = {
> > +		{LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
> > +		{LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
> > +	};
> > +
> > +	r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> > +	if (r) {
> > +		pr_err("Cannot request LCD GPIOs, error %d\n", r);
> > +		return;
> > +	}
> > +
> > +	omap_display_init(&ldp_dss_data);
> > +}
> > +
> >  static void __init omap_ldp_init_early(void)
> >  {
> >  	omap2_init_common_infrastructure();
> > @@ -298,10 +352,30 @@ static struct twl4030_usb_data ldp_usb_data = {
> >  	.usb_mode	= T2_USB_MODE_ULPI,
> >  };
> >  
> > +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
> > +{
> > +	int r;
> > +
> > +	struct gpio gpios[] = {
> > +		{gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
> > +		{gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
> > +	};
> > +
> > +	r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> > +	if (r)
> > +		pr_err("Cannot request LCD GPIOs, error %d\n", r);
> > +
> > +	ldp_backlight_gpio = gpio + 15;
> > +	ldp_lcd_enable_gpio = gpio + 7;
> 
> If the gpio_request_array() fails (though it shouldn't),
> won't it be right to set both variables to -EINVAL?

Ah, yes. I'll fix that.

Do you know what will happen if twl_gpio_setup fails? Just an error
print, or will TWL driver fail?

> Thanks for bringing this all together.

We still don't know if it works or not =).

 Tomi



  reply	other threads:[~2011-05-17 11:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09  7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 1/6] OMAP: RX51: Remove unused old omapfb stuff Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 2/6] OMAP: omap3touchbook: Remove unused lcd stuff Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2 Tomi Valkeinen
2011-05-09  8:21   ` Igor Grinberg
2011-05-09 16:57     ` Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 4/6] OMAP: LDP: " Tomi Valkeinen
2011-05-09  8:08   ` stanley.miao
2011-05-11  4:58   ` Janorkar, Mayuresh
2011-05-11  6:32     ` Tomi Valkeinen
2011-05-12  6:40       ` Igor Grinberg
2011-05-12  7:16         ` Igor Grinberg
2011-05-12  8:38           ` Igor Grinberg
2011-05-12  8:47             ` Janorkar, Mayuresh
2011-05-12 11:20               ` Igor Grinberg
2011-05-12 11:47                 ` Tomi Valkeinen
2011-05-12 14:36                   ` Janorkar, Mayuresh
2011-05-12 14:47                     ` Tomi Valkeinen
2011-05-12 14:50                       ` Janorkar, Mayuresh
2011-05-12 14:59                         ` Tomi Valkeinen
2011-05-16  8:53         ` Tomi Valkeinen
2011-05-16 11:13           ` Igor Grinberg
2011-05-17 11:49             ` Tomi Valkeinen [this message]
2011-05-17 11:56               ` Tomi Valkeinen
2011-05-17 12:28                 ` Igor Grinberg
2011-05-17 13:16                   ` Tomi Valkeinen
2011-05-16 11:26           ` Janorkar, Mayuresh
2011-05-17 11:44             ` Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 5/6] OMAP: H4: " Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 6/6] OMAP: Apollon: " Tomi Valkeinen
2011-05-09 17:01 ` [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
2011-05-10 13:35   ` Tony Lindgren
2011-05-10 14:03     ` Tomi Valkeinen
2011-05-11  7:08       ` 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=1305632940.1847.8.camel@deskari \
    --to=tomi.valkeinen@ti.com \
    --cc=grinberg@compulab.co.il \
    --cc=linux-omap@vger.kernel.org \
    --cc=mayur@ti.com \
    --cc=stanley.miao@windriver.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