Patchwork [U-Boot,2/8] pxa_lcd: make lcd_enable() a weak pointer

login
register
mail settings
Submitter Mike Dunn
Date April 7, 2013, 4:40 p.m.
Message ID <1365352865-2137-3-git-send-email-mikedunn@newsguy.com>
Download mbox | patch
Permalink /patch/234518/
State Superseded
Delegated to: Albert ARIBAUD
Headers show

Comments

Mike Dunn - April 7, 2013, 4:40 p.m.
Make lcd_init() a weak pointer aliased to the current (and currently empty)
lcd_init(), so that boards can overload it if necessary.  The palmtreo680 board
needs to wiggle some gpios and configure the pwm controller in order to get the
lcd and its backlight working.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---
 drivers/video/pxa_lcd.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Fabio Estevam - April 7, 2013, 7:08 p.m.
On Sun, Apr 7, 2013 at 1:40 PM, Mike Dunn <mikedunn@newsguy.com> wrote:

> +void lcd_enable(void)
> +       __attribute__((weak, alias("__lcd_enable")));

What about declaring it as:

__weak void lcd_enable(void)
Mike Dunn - April 8, 2013, 5:49 p.m.
On 04/07/2013 12:08 PM, Fabio Estevam wrote:
> On Sun, Apr 7, 2013 at 1:40 PM, Mike Dunn <mikedunn@newsguy.com> wrote:
> 
>> +void lcd_enable(void)
>> +       __attribute__((weak, alias("__lcd_enable")));
> 
> What about declaring it as:
> 
> __weak void lcd_enable(void)
> 
> 



Yes, that works.  And very to-the-point :)  Thanks.

Mike

Patch

diff --git a/drivers/video/pxa_lcd.c b/drivers/video/pxa_lcd.c
index d5fbe7b..fd848ef 100644
--- a/drivers/video/pxa_lcd.c
+++ b/drivers/video/pxa_lcd.c
@@ -410,10 +410,14 @@  void lcd_initcolregs (void)
 #endif /* LCD_MONOCHROME */
 
 /*----------------------------------------------------------------------*/
-void lcd_enable (void)
+void __lcd_enable(void)
 {
 }
 
+void lcd_enable(void)
+	__attribute__((weak, alias("__lcd_enable")));
+
+
 /************************************************************************/
 /* ** PXA255 specific routines						*/
 /************************************************************************/