public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP.
@ 2008-11-20 14:01 Stanley.Miao
  2008-11-20 19:11 ` David Brownell
  0 siblings, 1 reply; 5+ messages in thread
From: Stanley.Miao @ 2008-11-20 14:01 UTC (permalink / raw)
  To: linux-omap

stop using omap_set_gpio_direction() and switch to gpio_direction_output(),
make omap_ldp can build sucessfully.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-ldp.c |    2 +-
 drivers/video/omap/lcd_ldp.c    |    8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index bc66b28..a59e4eb 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -341,7 +341,7 @@ static inline void __init ldp_init_smc911x(void)
 				eth_gpio);
 		return;
 	}
-	omap_set_gpio_direction(eth_gpio, 1);
+	gpio_direction_input(eth_gpio);
 }
 
 
diff --git a/drivers/video/omap/lcd_ldp.c b/drivers/video/omap/lcd_ldp.c
index e944166..5892765 100644
--- a/drivers/video/omap/lcd_ldp.c
+++ b/drivers/video/omap/lcd_ldp.c
@@ -69,17 +69,15 @@ static int ldp_panel_init(struct lcd_panel *panel,
 	gpio_request(LCD_PANEL_ENABLE_GPIO, "lcd panel");
 	gpio_request(LCD_PANEL_BACKLIGHT_GPIO, "lcd backlight");
 
-	omap_set_gpio_direction(LCD_PANEL_QVGA_GPIO, 0);
-	omap_set_gpio_direction(LCD_PANEL_RESET_GPIO, 0);
 	gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
 	gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
 
 #ifdef CONFIG_FB_OMAP_LCD_VGA
-	omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 0);
+	gpio_direction_output(LCD_PANEL_QVGA_GPIO, 0);
 #else
-	omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 1);
+	gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1);
 #endif
-	omap_set_gpio_dataout(LCD_PANEL_RESET_GPIO, 1);
+	gpio_direction_output(LCD_PANEL_RESET_GPIO, 1);
 
 	return 0;
 }
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP.
  2008-11-20 14:01 [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP Stanley.Miao
@ 2008-11-20 19:11 ` David Brownell
  2008-11-21  7:50   ` stanley.miao
  0 siblings, 1 reply; 5+ messages in thread
From: David Brownell @ 2008-11-20 19:11 UTC (permalink / raw)
  To: Stanley.Miao; +Cc: linux-omap

On Thursday 20 November 2008, Stanley.Miao wrote:
> -       omap_set_gpio_direction(LCD_PANEL_QVGA_GPIO, 0);
> -       omap_set_gpio_direction(LCD_PANEL_RESET_GPIO, 0);
>         gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
>         gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);

Nothing does

	gpio_request(LCD_PANEL_QVGA_GPIO, "qvga something");
	gpio_request(LCD_PANEL_RESET_GPIO, "lcd reset");

And by removing the initial direction setting call (above),
behavior of at least the reset line changes:  it's no longer
pullsed low.

It'd be better to change the direction setting calls above
(setting an initial low value), and then make the calls
below use gpio_set_value().

  
>  #ifdef CONFIG_FB_OMAP_LCD_VGA
> -       omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 0);
> +       gpio_direction_output(LCD_PANEL_QVGA_GPIO, 0);
>  #else
> -       omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 1);
> +       gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1);
>  #endif
> -       omap_set_gpio_dataout(LCD_PANEL_RESET_GPIO, 1);
> +       gpio_direction_output(LCD_PANEL_RESET_GPIO, 1);

Use gpio_set_value() to replace omap_set_gpio_dataout(), except
when initializing.  The reset pin *was* being toggled...

- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP.
  2008-11-20 19:11 ` David Brownell
@ 2008-11-21  7:50   ` stanley.miao
  2008-11-21  7:52     ` David Brownell
  0 siblings, 1 reply; 5+ messages in thread
From: stanley.miao @ 2008-11-21  7:50 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-omap

On Thu, 2008-11-20 at 11:11 -0800, David Brownell wrote:
> On Thursday 20 November 2008, Stanley.Miao wrote:
> > -       omap_set_gpio_direction(LCD_PANEL_QVGA_GPIO, 0);
> > -       omap_set_gpio_direction(LCD_PANEL_RESET_GPIO, 0);
> >         gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
> >         gpio_direction_output(LCD_PANEL_BACKLIGHT_GPIO, 0);
> 
> Nothing does
> 
> 	gpio_request(LCD_PANEL_QVGA_GPIO, "qvga something");
> 	gpio_request(LCD_PANEL_RESET_GPIO, "lcd reset");
> 

Accepted, change omap_request_gpio() to gpio_request().

> And by removing the initial direction setting call (above),
> behavior of at least the reset line changes:  it's no longer
> pullsed low.
> 
> It'd be better to change the direction setting calls above
> (setting an initial low value), and then make the calls
> below use gpio_set_value().
> 
>   
> >  #ifdef CONFIG_FB_OMAP_LCD_VGA
> > -       omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 0);
> > +       gpio_direction_output(LCD_PANEL_QVGA_GPIO, 0);
> >  #else
> > -       omap_set_gpio_dataout(LCD_PANEL_QVGA_GPIO, 1);
> > +       gpio_direction_output(LCD_PANEL_QVGA_GPIO, 1);
> >  #endif
> > -       omap_set_gpio_dataout(LCD_PANEL_RESET_GPIO, 1);
> > +       gpio_direction_output(LCD_PANEL_RESET_GPIO, 1);
> 
> Use gpio_set_value() to replace omap_set_gpio_dataout(), except
> when initializing.  The reset pin *was* being toggled...

These actions are in init function. so keep omap_set_gpio_dataout() in
place.

Thanks for your review, I will resend it.

Stanley.

> 
> - Dave
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP.
  2008-11-21  7:50   ` stanley.miao
@ 2008-11-21  7:52     ` David Brownell
  2008-11-21  8:21       ` stanley.miao
  0 siblings, 1 reply; 5+ messages in thread
From: David Brownell @ 2008-11-21  7:52 UTC (permalink / raw)
  To: stanley.miao; +Cc: linux-omap

On Thursday 20 November 2008, stanley.miao wrote:
> 
> > Use gpio_set_value() to replace omap_set_gpio_dataout(), except
> > when initializing.  The reset pin *was* being toggled...
> 
> These actions are in init function. so keep omap_set_gpio_dataout() in
> place.

No, omap_set_gpio_dataout() is gone.  You can't call it any more.

  gpio_direction_output(gpio, initial_value)

is what you'd want after gpio_request().
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP.
  2008-11-21  7:52     ` David Brownell
@ 2008-11-21  8:21       ` stanley.miao
  0 siblings, 0 replies; 5+ messages in thread
From: stanley.miao @ 2008-11-21  8:21 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-omap

On Thu, 2008-11-20 at 23:52 -0800, David Brownell wrote:
> On Thursday 20 November 2008, stanley.miao wrote:
> > 
> > > Use gpio_set_value() to replace omap_set_gpio_dataout(), except
> > > when initializing.  The reset pin *was* being toggled...
> > 
> > These actions are in init function. so keep omap_set_gpio_dataout() in
> > place.

Sorry, it should be "keep gpio_direction_out() in place". I made a
mistake, but the code is right.

Stanley.

> 
> No, omap_set_gpio_dataout() is gone.  You can't call it any more.
> 
>   gpio_direction_output(gpio, initial_value)
> 
> is what you'd want after gpio_request().



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-21  8:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20 14:01 [PATCH] OMAP: Switch to gpio_direction_output in OMAP_LDP Stanley.Miao
2008-11-20 19:11 ` David Brownell
2008-11-21  7:50   ` stanley.miao
2008-11-21  7:52     ` David Brownell
2008-11-21  8:21       ` stanley.miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox