diff options
-rw-r--r-- | board/goldelico/gta04/backlight.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/board/goldelico/gta04/backlight.c b/board/goldelico/gta04/backlight.c index 3cb976c..76b6e43 100644 --- a/board/goldelico/gta04/backlight.c +++ b/board/goldelico/gta04/backlight.c @@ -31,14 +31,24 @@ #include "backlight.h" #if defined(CONFIG_OMAP3_GTA04) + #define GPIO_BACKLIGHT 57 /* = GPT11_PWM */ #define GPT_BACKLIGHT OMAP34XX_GPT11 + +#elif defined(CONFIG_OMAP3_BEAGLE_HYBRID) + +#define GPIO_BACKLIGHT 145 /* = GPT10_PWM */ +#define GPT_BACKLIGHT OMAP34XX_GPT10 + #elif defined(CONFIG_OMAP3_BEAGLE_EXPANDER) + #define GPIO_BACKLIGHT 146 /* = GPT11_PWM (instead of UART2-TX) */ #define GPT_BACKLIGHT OMAP34XX_GPT11 -#else /* Beagle Hybrid */ -#define GPIO_BACKLIGHT 145 /* = GPT10_PWM */ -#define GPT_BACKLIGHT OMAP34XX_GPT10 + +#else + +#error undefined CONFIG + #endif #define USE_PWM 0 @@ -61,10 +71,12 @@ int backlight_init(void) struct gptimer *gpt_base = (struct gptimer *)GPT_BACKLIGHT; #if defined(CONFIG_OMAP3_GTA04) MUX_VAL(CP(GPMC_NCS6), (IEN | PTD | DIS | M3)) /* GPT_11 - Backlight enable*/\ +#elif defined(CONFIG_OMAP3_BEAGLE_HYBRID) + MUX_VAL(CP(UART2_RTS), (IEN | PTD | DIS | M2)) /* switch to GPT10 */ #elif defined(CONFIG_OMAP3_BEAGLE_EXPANDER) MUX_VAL(CP(UART2_TX), (IEN | PTD | DIS | M2)) /* switch to GPT11 */ -#else - MUX_VAL(CP(UART2_RTS), (IEN | PTD | DIS | M2)) /* switch to GPT10 */ +#else +#error undefined CONFIG #endif // writel(value, &gpt_base->registername); // program registers for generating a 100-1000 Hz PWM signal @@ -76,10 +88,12 @@ int backlight_init(void) #else #if defined(CONFIG_OMAP3_GTA04) MUX_VAL(CP(GPMC_NCS6), (IEN | PTD | DIS | M4)) /*GPIO_57 - Backlight enable*/ +#elif defined(CONFIG_OMAP3_BEAGLE_HYBRID) + MUX_VAL(CP(UART2_RTS), (IEN | PTD | DIS | M4)) /*GPIO_145*/ #elif defined(CONFIG_OMAP3_BEAGLE_EXPANDER) MUX_VAL(CP(UART2_TX), (IEN | PTD | DIS | M4)) /*GPIO_146*/ -#else - MUX_VAL(CP(UART2_RTS), (IEN | PTD | DIS | M4)) /*GPIO_145*/ +#else +#error undefined CONFIG #endif if(omap_request_gpio(GPIO_BACKLIGHT) == 0) // 0 == ok { |