On Wed, Aug 12, 2009 at 23:13:42, Kevin Hilman wrote:
> Sudhakar Rajashekhara <[email protected]> writes:
>
> > This patch adds platform support for the graphic display
> > (Sharp LK043T1DG01) found on DA850/OMAP-L138 based EVM.
> >
> > Signed-off-by: Sudhakar Rajashekhara <[email protected]>
> > ---
> > Since the previous version, following are the modifications:
> > 1. Defined the macros for the LCD back light and LCD power
> > GPIO pins.
> > 2. Made da850_lcd_hw_init() function static.
> > 3. Added gpio_free() for 1st GPIO pin, if gpio_request for
> > the 2nd GPIO pin fails.
> > 4. Removed un-necessary mdelays from da850_lcd_hw_init()
> > function.
> > 5. Also removed LPSC disable/enable sequence from
> > da850_lcd_hw_init() function.
> > 6. Removed the comments for the members of lcd_ctrl_config
> > structure.
> >
> > arch/arm/mach-davinci/board-da850-evm.c | 58
> > +++++++++++++++++++++++++++
> > arch/arm/mach-davinci/da850.c | 42 ++++++++++++++++++++
> > arch/arm/mach-davinci/devices-da8xx.c | 59
> > ++++++++++++++++++++++++++++
> > arch/arm/mach-davinci/include/mach/da8xx.h | 3 +
> > arch/arm/mach-davinci/include/mach/mux.h | 26 ++++++++++++
> > 5 files changed, 188 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c
> > b/arch/arm/mach-davinci/board-da850-evm.c
> > index d989346..b05b7f5 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
[...]
> >
> > +static int da850_lcd_hw_init(void)
> > +{
> > + int status;
> > +
> > + status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n");
> > + if (status < 0)
> > + return status;
> > +
> > + status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n");
> > + if (status < 0) {
> > + gpio_free(DA850_LCD_BL_PIN);
> > + return status;
> > + }
> > +
> > + gpio_direction_output(DA850_LCD_BL_PIN, 0);
> > + gpio_direction_output(DA850_LCD_PWR_PIN, 0);
> > +
> > + /* disable lcd backlight */
> > + gpio_set_value(DA850_LCD_BL_PIN, 0);
> > +
> > + /* disable lcd power */
> > + gpio_set_value(DA850_LCD_PWR_PIN, 0);
> > +
> > + /* enable lcd power */
> > + gpio_set_value(DA850_LCD_PWR_PIN, 1);
> > +
> > + /* enable lcd backlight */
> > + gpio_set_value(DA850_LCD_BL_PIN, 1);
> > +
> > + gpio_free(DA850_LCD_BL_PIN);
> > + gpio_free(DA850_LCD_PWR_PIN);
>
> Do you really want to free these and allow other potential users to
> change the direction/value?
>
> Since this board code, I suspect you want to request and hold the GPIO
> lines. This also would allow the use of the GPIO sysfs interface
> to toggle power and backlight for debug.
>
Point taken. I'll free the gpio only in case of error condition and
remove the call to gpio_free() while exiting from the function.
Regards, Sudhakar
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source