Get rid of stupid _backlight_* function names

_remote_backlight_* and _buttonlight_* are cleaned as well

Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
This commit is contained in:
Marcin Bukat 2015-01-09 00:22:40 +01:00 committed by Gerrit Rockbox
parent 2a3e1628a5
commit 89ba7e818c
148 changed files with 679 additions and 687 deletions

View File

@ -469,7 +469,7 @@ static unsigned long _grey_get_pixel(int x, int y)
static void _timer_isr(void) static void _timer_isr(void)
{ {
#if defined(HAVE_BACKLIGHT_INVERSION) && !defined(SIMULATOR) #if defined(HAVE_BACKLIGHT_INVERSION) && !defined(SIMULATOR)
unsigned long check = rb->is_backlight_on(true) unsigned long check = rb->isbacklight_hw_on(true)
? 0 : _GREY_BACKLIGHT_ON; ? 0 : _GREY_BACKLIGHT_ON;
if ((_grey_info.flags & (_GREY_BACKLIGHT_ON|GREY_RAWMAPPED)) == check) if ((_grey_info.flags & (_GREY_BACKLIGHT_ON|GREY_RAWMAPPED)) == check)
@ -648,7 +648,7 @@ bool grey_init(unsigned char *gbuf, long gbuf_size,
else else
{ {
#if defined(HAVE_BACKLIGHT_INVERSION) && !defined(SIMULATOR) #if defined(HAVE_BACKLIGHT_INVERSION) && !defined(SIMULATOR)
if (rb->is_backlight_on(true)) if (rb->isbacklight_hw_on(true))
_grey_info.flags |= _GREY_BACKLIGHT_ON; _grey_info.flags |= _GREY_BACKLIGHT_ON;
#endif #endif
fill_gvalues(); fill_gvalues();

View File

@ -1093,7 +1093,7 @@ static void osd_lcd_enable_hook(unsigned short id, void* param)
} }
#endif #endif
static void osd_backlight_on_video_mode(bool video_on) static void osdbacklight_hw_on_video_mode(bool video_on)
{ {
if (video_on) { if (video_on) {
/* Turn off backlight timeout */ /* Turn off backlight timeout */
@ -1779,7 +1779,7 @@ static int osd_play(uint32_t time)
retval = stream_seek(time, SEEK_SET); retval = stream_seek(time, SEEK_SET);
if (retval >= STREAM_OK) { if (retval >= STREAM_OK) {
osd_backlight_on_video_mode(true); osdbacklight_hw_on_video_mode(true);
osd_backlight_brightness_video_mode(true); osd_backlight_brightness_video_mode(true);
stream_show_vo(true); stream_show_vo(true);
@ -1826,7 +1826,7 @@ static int osd_pause(void)
osd_set_status(OSD_STATUS_PAUSED); osd_set_status(OSD_STATUS_PAUSED);
osd_backlight_on_video_mode(false); osdbacklight_hw_on_video_mode(false);
/* Leave brightness alone and restore it when OSD is hidden */ /* Leave brightness alone and restore it when OSD is hidden */
if (stream_can_seek() && rb->global_settings->pause_rewind) { if (stream_can_seek() && rb->global_settings->pause_rewind) {
@ -1847,7 +1847,7 @@ static void osd_resume(void)
/* Cancel video and resume auto refresh - the resyc when starting /* Cancel video and resume auto refresh - the resyc when starting
* playback will perform those tasks */ * playback will perform those tasks */
osd_set_hp_pause_flag(false); osd_set_hp_pause_flag(false);
osd_backlight_on_video_mode(true); osdbacklight_hw_on_video_mode(true);
osd_backlight_brightness_video_mode(true); osd_backlight_brightness_video_mode(true);
osd_cancel_refresh(OSD_REFRESH_VIDEO | OSD_REFRESH_RESUME); osd_cancel_refresh(OSD_REFRESH_VIDEO | OSD_REFRESH_RESUME);
osd_set_status(OSD_STATUS_PLAYING); osd_set_status(OSD_STATUS_PLAYING);
@ -1871,7 +1871,7 @@ static void osd_stop(void)
if (resume_time != INVALID_TIMESTAMP) if (resume_time != INVALID_TIMESTAMP)
settings.resume_time = resume_time; settings.resume_time = resume_time;
osd_backlight_on_video_mode(false); osdbacklight_hw_on_video_mode(false);
osd_backlight_brightness_video_mode(false); osd_backlight_brightness_video_mode(false);
} }

View File

@ -63,7 +63,7 @@ void shutdown(void)
ata_sleepnow(); ata_sleepnow();
} }
_backlight_off(); backlight_hw_off();
power_off(); power_off();
} }

View File

@ -98,9 +98,9 @@ void shutdown(void)
sleep(HZ*2); sleep(HZ*2);
/* Backlight OFF */ /* Backlight OFF */
_backlight_off(); backlight_hw_off();
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
_remote_backlight_off(); remote_backlight_hw_off();
#endif #endif
__reset_cookie(); __reset_cookie();

View File

@ -217,9 +217,9 @@ void main(uint32_t arg, uint32_t addr)
system_prepare_fw_start(); system_prepare_fw_start();
/* if target defines lcd_enable() in bootloader, take this as a hint that /* if target defines lcd_enable() in bootloader, take this as a hint that
* we should use it to properly stop the lcd before moving one, the * we should use it to properly stop the lcd before moving one, the
* _backlight_off() routine is supposed to disable the lcd at the same time */ * backlight_hw_off() routine is supposed to disable the lcd at the same time */
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
_backlight_off(); backlight_hw_off();
#endif #endif
disable_interrupt(IRQ_FIQ_STATUS); disable_interrupt(IRQ_FIQ_STATUS);
commit_discard_idcache(); commit_discard_idcache();

View File

@ -158,9 +158,9 @@ void shutdown(void)
sleep(HZ*2); sleep(HZ*2);
/* Backlight OFF */ /* Backlight OFF */
_backlight_off(); backlight_hw_off();
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
_remote_backlight_off(); remote_backlight_hw_off();
#endif #endif
__reset_cookie(); __reset_cookie();
@ -418,12 +418,12 @@ void main(void)
__uda1380_reset_hi(); __uda1380_reset_hi();
/* Start with the main backlight OFF. */ /* Start with the main backlight OFF. */
_backlight_init(); backlight_hw_init();
_backlight_off(); backlight_hw_off();
/* Remote backlight ON */ /* Remote backlight ON */
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
_remote_backlight_on(); remote_backlight_hw_on();
#endif #endif
system_init(); system_init();
@ -576,7 +576,7 @@ void main(void)
sleep(HZ); sleep(HZ);
/* Backlight OFF */ /* Backlight OFF */
_backlight_off(); backlight_hw_off();
} }
cpu_idle_mode(false); cpu_idle_mode(false);

View File

@ -102,8 +102,8 @@ void shutdown(void)
sleep(HZ*2); sleep(HZ*2);
_backlight_off(); backlight_hw_off();
_remote_backlight_off(); remote_backlight_hw_off();
__reset_cookie(); __reset_cookie();
power_off(); power_off();
@ -184,10 +184,10 @@ void main(void)
restore_irq(mask); restore_irq(mask);
/* Start with the main backlight OFF. */ /* Start with the main backlight OFF. */
_backlight_init(); backlight_hw_init();
_backlight_off(); backlight_hw_off();
_remote_backlight_on(); remote_backlight_hw_on();
system_init(); system_init();
kernel_init(); kernel_init();

View File

@ -101,7 +101,7 @@ void* main(void)
font_init(); font_init();
button_init(); button_init();
i2c_init(); i2c_init();
_backlight_on(); backlight_hw_on();
lcd_set_foreground(LCD_WHITE); lcd_set_foreground(LCD_WHITE);
lcd_set_background(LCD_BLACK); lcd_set_background(LCD_BLACK);

View File

@ -320,7 +320,7 @@ void* main(void)
#endif #endif
#if defined(SANSA_E200) || defined(PHILIPS_SA9200) #if defined(SANSA_E200) || defined(PHILIPS_SA9200)
i2c_init(); i2c_init();
_backlight_on(); backlight_hw_on();
#endif #endif
if (button_hold()) if (button_hold())

View File

@ -181,7 +181,7 @@ void* main(void)
font_init(); font_init();
button_init(); button_init();
i2c_init(); i2c_init();
_backlight_on(); backlight_hw_on();
lcd_set_foreground(LCD_WHITE); lcd_set_foreground(LCD_WHITE);
lcd_set_background(LCD_BLACK); lcd_set_background(LCD_BLACK);

View File

@ -176,7 +176,7 @@ void main(void)
| QT1106_DI | QT1106_SLD_SLIDER | QT1106_RES_256); | QT1106_DI | QT1106_SLD_SLIDER | QT1106_RES_256);
snprintf(mystring, 64, "%x %2.2x",(slider & 0x008000)>>15, slider&0xff); snprintf(mystring, 64, "%x %2.2x",(slider & 0x008000)>>15, slider&0xff);
lcd_puts(0,1,mystring); lcd_puts(0,1,mystring);
_backlight_set_brightness((slider & 0xFF) >> 4); backlight_hw_brightness((slider & 0xFF) >> 4);
/* /*
if(slider & 0x008000) if(slider & 0x008000)

View File

@ -150,7 +150,7 @@ static void __shutdown(void)
} }
/* Backlight OFF */ /* Backlight OFF */
_backlight_off(); backlight_hw_off();
__reset_cookie(); __reset_cookie();
power_off(); power_off();
@ -372,7 +372,7 @@ void main(void)
cpu_idle_mode(true); cpu_idle_mode(true);
/* lowlevel init only */ /* lowlevel init only */
_backlight_init(); backlight_hw_init();
/* Handle wakeup event. Possibilities are: /* Handle wakeup event. Possibilities are:
* RTC alarm (HD300) * RTC alarm (HD300)

View File

@ -114,7 +114,7 @@ void main(void)
i2c_init(); i2c_init();
fmradio_i2c_init(); fmradio_i2c_init();
adc_init(); adc_init();
_backlight_init(); backlight_hw_init();
button_init_device(); button_init_device();
// FM power // FM power
@ -259,13 +259,13 @@ void main(void)
if (button & BUTTON_MENU) { if (button & BUTTON_MENU) {
if (brightness < MAX_BRIGHTNESS_SETTING) { if (brightness < MAX_BRIGHTNESS_SETTING) {
brightness++; brightness++;
_backlight_set_brightness(brightness); backlight_hw_brightness(brightness);
} }
} }
else if (button & BUTTON_BACK) { else if (button & BUTTON_BACK) {
if (brightness > MIN_BRIGHTNESS_SETTING) { if (brightness > MIN_BRIGHTNESS_SETTING) {
brightness--; brightness--;
_backlight_set_brightness(brightness); backlight_hw_brightness(brightness);
} }
} }
snprintf(mystring, 64, "brightness %3d", brightness); snprintf(mystring, 64, "brightness %3d", brightness);

View File

@ -54,11 +54,11 @@ void main(void)
while(1) while(1)
{ {
_backlight_on(); backlight_hw_on();
_buttonlight_off(); buttonlight_hw_off();
sleep(HZ/4); sleep(HZ/4);
_backlight_off(); backlight_hw_off();
_buttonlight_on(); buttonlight_hw_on();
sleep(HZ/4); sleep(HZ/4);
} }
} }

View File

@ -82,10 +82,10 @@ void show_debug_screen(void)
} }
#if 0 #if 0
if (button & BUTTON_SELECT){ if (button & BUTTON_SELECT){
_backlight_off(); backlight_hw_off();
} }
else{ else{
_backlight_on(); backlight_hw_on();
} }
#endif #endif
printf("Btn: 0x%08x",button); printf("Btn: 0x%08x",button);
@ -147,7 +147,7 @@ void* main(void)
show_logo(); show_logo();
_backlight_on(); backlight_hw_on();
/* Only load the firmware if TCCBOOT is defined - this ensures SDRAM_START is /* Only load the firmware if TCCBOOT is defined - this ensures SDRAM_START is
available for loading the firmware. Otherwise display the debug screen. */ available for loading the firmware. Otherwise display the debug screen. */

View File

@ -28,7 +28,7 @@
#include "backlight-sw-fading.h" #include "backlight-sw-fading.h"
/* To adapt a target do: /* To adapt a target do:
* - make sure _backlight_on doesn't set the brightness to something other than * - make sure backlight_hw_on doesn't set the brightness to something other than
* the previous value (lowest brightness in most cases) * the previous value (lowest brightness in most cases)
* add proper #defines for software fading * add proper #defines for software fading
*/ */
@ -46,7 +46,7 @@ static bool _backlight_fade_up(void)
{ {
if (LIKELY(current_brightness < backlight_brightness)) if (LIKELY(current_brightness < backlight_brightness))
{ {
_backlight_set_brightness(++current_brightness); backlight_hw_brightness(++current_brightness);
} }
return(current_brightness >= backlight_brightness); return(current_brightness >= backlight_brightness);
} }
@ -56,14 +56,14 @@ static bool _backlight_fade_down(void)
{ {
if (LIKELY(current_brightness > MIN_BRIGHTNESS_SETTING)) if (LIKELY(current_brightness > MIN_BRIGHTNESS_SETTING))
{ {
_backlight_set_brightness(--current_brightness); backlight_hw_brightness(--current_brightness);
return false; return false;
} }
else else
{ {
/* decrement once more, since backlight is off */ /* decrement once more, since backlight is off */
current_brightness--; current_brightness--;
_backlight_off(); backlight_hw_off();
return true; return true;
} }
} }

View File

@ -126,10 +126,10 @@ static void buttonlight_update_state(void)
if (buttonlight_timer < 0) if (buttonlight_timer < 0)
{ {
buttonlight_timer = 0; /* Disable the timeout */ buttonlight_timer = 0; /* Disable the timeout */
_buttonlight_off(); buttonlight_hw_off();
} }
else else
_buttonlight_on(); buttonlight_hw_on();
} }
/* external interface */ /* external interface */
@ -421,7 +421,7 @@ static void backlight_setup_fade_up(void)
if (backlight_fading_state == NOT_FADING) if (backlight_fading_state == NOT_FADING)
{ {
/* make sure the backlight is at lowest level */ /* make sure the backlight is at lowest level */
_backlight_on(); backlight_hw_on();
} }
backlight_fading_state = FADING_UP; backlight_fading_state = FADING_UP;
} }
@ -429,8 +429,8 @@ static void backlight_setup_fade_up(void)
{ {
backlight_fading_state = NOT_FADING; backlight_fading_state = NOT_FADING;
_backlight_fade_update_state(backlight_brightness); _backlight_fade_update_state(backlight_brightness);
_backlight_on(); backlight_hw_on();
_backlight_set_brightness(backlight_brightness); backlight_hw_brightness(backlight_brightness);
} }
} }
@ -444,11 +444,11 @@ static void backlight_setup_fade_down(void)
{ {
backlight_fading_state = NOT_FADING; backlight_fading_state = NOT_FADING;
_backlight_fade_update_state(MIN_BRIGHTNESS_SETTING-1); _backlight_fade_update_state(MIN_BRIGHTNESS_SETTING-1);
_backlight_off(); backlight_hw_off();
#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG)
/* write the lowest brightness level to the hardware so that /* write the lowest brightness level to the hardware so that
* fading up is glitch free */ * fading up is glitch free */
_backlight_set_brightness(MIN_BRIGHTNESS_SETTING); backlight_hw_brightness(MIN_BRIGHTNESS_SETTING);
#endif #endif
#ifdef HAVE_LCD_SLEEP #ifdef HAVE_LCD_SLEEP
backlight_lcd_sleep_countdown(true); backlight_lcd_sleep_countdown(true);
@ -463,7 +463,7 @@ static inline void do_backlight_off(void)
#if BACKLIGHT_FADE_IN_THREAD #if BACKLIGHT_FADE_IN_THREAD
backlight_setup_fade_down(); backlight_setup_fade_down();
#else #else
_backlight_off(); backlight_hw_off();
/* targets that have fading need to start the countdown when done with /* targets that have fading need to start the countdown when done with
* fading */ * fading */
#ifdef HAVE_LCD_SLEEP #ifdef HAVE_LCD_SLEEP
@ -500,7 +500,7 @@ static void backlight_update_state(void)
#if BACKLIGHT_FADE_IN_THREAD #if BACKLIGHT_FADE_IN_THREAD
backlight_setup_fade_up(); backlight_setup_fade_up();
#else #else
_backlight_on(); backlight_hw_on();
#endif #endif
} }
} }
@ -514,12 +514,12 @@ static void remote_backlight_update_state(void)
if (timeout < 0) if (timeout < 0)
{ {
remote_backlight_timer = 0; /* Disable the timeout */ remote_backlight_timer = 0; /* Disable the timeout */
_remote_backlight_off(); remote_backlight_hw_off();
} }
else else
{ {
remote_backlight_timer = timeout; remote_backlight_timer = timeout;
_remote_backlight_on(); remote_backlight_hw_on();
} }
} }
#endif /* HAVE_REMOTE_LCD */ #endif /* HAVE_REMOTE_LCD */
@ -596,7 +596,7 @@ void backlight_thread(void)
case REMOTE_BACKLIGHT_OFF: case REMOTE_BACKLIGHT_OFF:
remote_backlight_timer = 0; /* Disable the timeout */ remote_backlight_timer = 0; /* Disable the timeout */
_remote_backlight_off(); remote_backlight_hw_off();
break; break;
#endif /* HAVE_REMOTE_LCD */ #endif /* HAVE_REMOTE_LCD */
@ -611,7 +611,7 @@ void backlight_thread(void)
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
case BACKLIGHT_BRIGHTNESS_CHANGED: case BACKLIGHT_BRIGHTNESS_CHANGED:
backlight_brightness = (int)ev.data; backlight_brightness = (int)ev.data;
_backlight_set_brightness((int)ev.data); backlight_hw_brightness((int)ev.data);
#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \ #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \
|| (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG)
/* receive backlight brightness */ /* receive backlight brightness */
@ -632,11 +632,11 @@ void backlight_thread(void)
case BUTTON_LIGHT_OFF: case BUTTON_LIGHT_OFF:
buttonlight_timer = 0; buttonlight_timer = 0;
_buttonlight_off(); buttonlight_hw_off();
break; break;
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
case BUTTON_LIGHT_BRIGHTNESS_CHANGED: case BUTTON_LIGHT_BRIGHTNESS_CHANGED:
_buttonlight_set_brightness((int)ev.data); buttonlight_hw_brightness((int)ev.data);
break; break;
#endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */ #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */
#endif /* HAVE_BUTTON_LIGHT */ #endif /* HAVE_BUTTON_LIGHT */
@ -703,7 +703,7 @@ static void backlight_timeout_handler(void)
remote_backlight_timer -= BACKLIGHT_THREAD_TIMEOUT; remote_backlight_timer -= BACKLIGHT_THREAD_TIMEOUT;
if(remote_backlight_timer <= 0) if(remote_backlight_timer <= 0)
{ {
_remote_backlight_off(); remote_backlight_hw_off();
} }
} }
#endif /* HAVE_REMOVE_LCD */ #endif /* HAVE_REMOVE_LCD */
@ -713,7 +713,7 @@ static void backlight_timeout_handler(void)
buttonlight_timer -= BACKLIGHT_THREAD_TIMEOUT; buttonlight_timer -= BACKLIGHT_THREAD_TIMEOUT;
if (buttonlight_timer <= 0) if (buttonlight_timer <= 0)
{ {
_buttonlight_off(); buttonlight_hw_off();
} }
} }
#endif /* HAVE_BUTTON_LIGHT */ #endif /* HAVE_BUTTON_LIGHT */
@ -723,7 +723,7 @@ void backlight_init(void)
{ {
queue_init(&backlight_queue, true); queue_init(&backlight_queue, true);
if (_backlight_init()) if (backlight_hw_init())
{ {
#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM) #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM)
/* If backlight is already on, don't fade in. */ /* If backlight is already on, don't fade in. */
@ -962,8 +962,8 @@ void buttonlight_set_brightness(int val)
#if defined(HAVE_BACKLIGHT) && !defined(BACKLIGHT_FULL_INIT) #if defined(HAVE_BACKLIGHT) && !defined(BACKLIGHT_FULL_INIT)
void backlight_init(void) void backlight_init(void)
{ {
(void)_backlight_init(); (void)backlight_hw_init();
_backlight_on(); backlight_hw_on();
} }
#endif #endif

View File

@ -65,8 +65,8 @@ void lcd_set_sleep_after_backlight_off(int index);
#endif /* !HAVE_BACKLIGHT */ #endif /* !HAVE_BACKLIGHT */
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
void _remote_backlight_on(void); void remote_backlight_hw_on(void);
void _remote_backlight_off(void); void remote_backlight_hw_off(void);
void remote_backlight_on(void); void remote_backlight_on(void);
void remote_backlight_off(void); void remote_backlight_off(void);
void remote_backlight_set_timeout(int value); void remote_backlight_set_timeout(int value);

View File

@ -28,12 +28,12 @@
int buttonlight_is_on = 0; int buttonlight_is_on = 0;
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
ascodec_write(AS3514_DCDC15, brightness); ascodec_write(AS3514_DCDC15, brightness);
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -45,7 +45,7 @@ void _backlight_on(void)
#endif #endif
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
ascodec_write(AS3514_DCDC15, 0x0); ascodec_write(AS3514_DCDC15, 0x0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
@ -53,7 +53,7 @@ void _backlight_off(void)
#endif #endif
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
/* Needed for buttonlight and MicroSD to work at the same time */ /* Needed for buttonlight and MicroSD to work at the same time */
/* Turn ROD control on, as the OF does */ /* Turn ROD control on, as the OF does */
@ -63,7 +63,7 @@ void _buttonlight_on(void)
buttonlight_is_on = 1; buttonlight_is_on = 1;
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
/* Needed for buttonlight and MicroSD to work at the same time */ /* Needed for buttonlight and MicroSD to work at the same time */
/* Turn ROD control off, as the OF does */ /* Turn ROD control off, as the OF does */

View File

@ -98,7 +98,7 @@ void _backlight_pwm(int on)
} }
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
GPIOA_DIR |= 1<<5; GPIOA_DIR |= 1<<5;
if (c200v2_variant == 1) { if (c200v2_variant == 1) {
@ -109,14 +109,14 @@ bool _backlight_init(void)
return true; return true;
} }
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
backlight_level = brightness_table[brightness]; backlight_level = brightness_table[brightness];
if (brightness > 0) if (brightness > 0)
_backlight_on(); backlight_hw_on();
else else
_backlight_off(); backlight_hw_off();
} }
static void _pwm_on(void) static void _pwm_on(void)
@ -130,7 +130,7 @@ static void _pwm_off(void)
_set_timer2_pwm_ratio(0); _set_timer2_pwm_ratio(0);
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
if (backlight_is_on == 1) { if (backlight_is_on == 1) {
/* Update pwm ratio in case user changed the brightness */ /* Update pwm ratio in case user changed the brightness */
@ -146,7 +146,7 @@ void _backlight_on(void)
backlight_is_on = 1; backlight_is_on = 1;
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
if (backlight_is_on == 0) if (backlight_is_on == 0)
return; return;
@ -159,7 +159,7 @@ void _backlight_off(void)
#endif #endif
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
if (buttonlight_is_on == 1) if (buttonlight_is_on == 1)
return; return;
@ -169,7 +169,7 @@ void _buttonlight_on(void)
buttonlight_is_on = 1; buttonlight_is_on = 1;
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
if (buttonlight_is_on == 0) if (buttonlight_is_on == 0)
return; return;

View File

@ -23,22 +23,22 @@
#include <stdbool.h> #include <stdbool.h>
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_pwm(int on); void _backlight_pwm(int on);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
static inline void _backlight_panic_on(void) static inline void _backlight_panic_on(void)
{ {
_backlight_on(); backlight_hw_on();
_backlight_pwm(1); _backlight_pwm(1);
} }
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
int __backlight_is_on(void); int __backlight_is_on(void);
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
/* /*
* FIXME: This may be better off in kernel.h, but... * FIXME: This may be better off in kernel.h, but...

View File

@ -25,30 +25,30 @@
#include "lcd.h" #include "lcd.h"
#include "backlight.h" #include "backlight.h"
static inline void _backlight_on(void) static inline void backlight_hw_on(void)
{ {
lcd_enable(true); lcd_enable(true);
} }
static inline void _backlight_off(void) static inline void backlight_hw_off(void)
{ {
lcd_enable(false); lcd_enable(false);
} }
#define _backlight_panic_on() _backlight_on() #define _backlight_panic_on() backlight_hw_on()
static inline bool _backlight_init(void) static inline bool backlight_hw_init(void)
{ {
GPIOD_DIR |= (1<<7); /* for button light */ GPIOD_DIR |= (1<<7); /* for button light */
return true; return true;
} }
static inline void _buttonlight_on(void) static inline void buttonlight_hw_on(void)
{ {
GPIOD_PIN(7) = (1<<7); GPIOD_PIN(7) = (1<<7);
} }
static inline void _buttonlight_off(void) static inline void buttonlight_hw_off(void)
{ {
GPIOD_PIN(7) = 0; GPIOD_PIN(7) = 0;
} }

View File

@ -24,13 +24,13 @@
#include "as3525v2.h" #include "as3525v2.h"
#include "ascodec.h" #include "ascodec.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x90); ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x90);
lcd_enable(true); lcd_enable(true);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
lcd_enable(false); lcd_enable(false);
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x00); ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x00);

View File

@ -21,10 +21,10 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#define _backlight_panic_on() _backlight_on() #define _backlight_panic_on() backlight_hw_on()
#endif #endif

View File

@ -24,13 +24,13 @@
#include "as3525v2.h" #include "as3525v2.h"
#include "ascodec.h" #include "ascodec.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x90); ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x90);
lcd_enable(true); lcd_enable(true);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
lcd_enable(false); lcd_enable(false);
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x0); ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x0);

View File

@ -24,22 +24,22 @@
#include <stdbool.h> #include <stdbool.h>
#include "cpu.h" #include "cpu.h"
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#define _backlight_panic_on() _backlight_on() #define _backlight_panic_on() backlight_hw_on()
static inline bool _backlight_init(void) static inline bool backlight_hw_init(void)
{ {
GPIOA_DIR |= 1<<5; /* for button light */ GPIOA_DIR |= 1<<5; /* for button light */
return true; return true;
} }
static inline void _buttonlight_on(void) static inline void buttonlight_hw_on(void)
{ {
GPIOA_PIN(5) = 1<<5; GPIOA_PIN(5) = 1<<5;
} }
static inline void _buttonlight_off(void) static inline void buttonlight_hw_off(void)
{ {
GPIOA_PIN(5) = 0; GPIOA_PIN(5) = 0;
} }

View File

@ -27,12 +27,12 @@
#include "ascodec.h" #include "ascodec.h"
#include "lcd-target.h" #include "lcd-target.h"
bool _backlight_init() bool backlight_hw_init()
{ {
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
/* GPIO B1 controls backlight */ /* GPIO B1 controls backlight */
GPIOB_DIR |= (1 << 1); GPIOB_DIR |= (1 << 1);
@ -43,7 +43,7 @@ void _backlight_on(void)
#endif #endif
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); lcd_enable(false);
@ -52,7 +52,7 @@ void _backlight_off(void)
GPIOB_PIN(1) = 0; GPIOB_PIN(1) = 0;
} }
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
oled_brightness(brightness); oled_brightness(brightness);
} }

View File

@ -21,11 +21,11 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#define _backlight_panic_on() _backlight_on() #define _backlight_panic_on() backlight_hw_on()
#endif #endif

View File

@ -21,13 +21,13 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#define _backlight_panic_on() _backlight_on() #define _backlight_panic_on() backlight_hw_on()
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
int __backlight_is_on(void); int __backlight_is_on(void);
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif #endif

View File

@ -21,13 +21,13 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#define _backlight_panic_on() _backlight_on() #define _backlight_panic_on() backlight_hw_on()
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#ifdef HAVE_BUTTON_LIGHT #ifdef HAVE_BUTTON_LIGHT
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif #endif
#endif #endif

View File

@ -26,12 +26,12 @@
#include "ascodec.h" #include "ascodec.h"
#include "as3514.h" #include "as3514.h"
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
ascodec_write_pmu(AS3543_BACKLIGHT, 2, brightness * 10); ascodec_write_pmu(AS3543_BACKLIGHT, 2, brightness * 10);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80); ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80);
ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10); ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
@ -49,7 +49,7 @@ bool _backlight_init(void)
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -57,7 +57,7 @@ void _backlight_on(void)
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80); ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x0); ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
@ -65,7 +65,7 @@ void _backlight_off(void)
#endif #endif
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
if (amsv2_variant == 0) if (amsv2_variant == 0)
{ {
@ -77,7 +77,7 @@ void _buttonlight_on(void)
} }
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
if (amsv2_variant == 0) if (amsv2_variant == 0)
{ {

View File

@ -25,13 +25,13 @@
#include "config.h" #include "config.h"
#include "ascodec.h" #include "ascodec.h"
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#define _backlight_panic_on() _backlight_on() #define _backlight_panic_on() backlight_hw_on()
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#ifdef HAVE_BUTTON_LIGHT #ifdef HAVE_BUTTON_LIGHT
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif #endif
#endif #endif

View File

@ -21,22 +21,22 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
static inline bool _backlight_init(void) static inline bool backlight_hw_init(void)
{ {
GPIOD_DIR |= (1<<1); GPIOD_DIR |= (1<<1);
return true; return true;
} }
static inline void _backlight_on(void) static inline void backlight_hw_on(void)
{ {
GPIOD_PIN(1) = (1<<1); GPIOD_PIN(1) = (1<<1);
} }
static inline void _backlight_off(void) static inline void backlight_hw_off(void)
{ {
GPIOD_PIN(1) = 0x00; GPIOD_PIN(1) = 0x00;
} }
#define _backlight_panic_on() _backlight_on() #define _backlight_panic_on() backlight_hw_on()
#endif #endif

View File

@ -969,7 +969,7 @@ void sd_enable(bool on)
if (buttonlight_is_on) if (buttonlight_is_on)
GPIOD_DIR &= ~(1<<7); GPIOD_DIR &= ~(1<<7);
else else
_buttonlight_off(); buttonlight_hw_off();
#endif #endif
#if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) #if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE)
@ -993,7 +993,7 @@ void sd_enable(bool on)
#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE) #if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE)
bitmod32(&CCU_IO, 0<<2, 3<<2); /* XPD is general purpose IO (b3:2 = 00) */ bitmod32(&CCU_IO, 0<<2, 3<<2); /* XPD is general purpose IO (b3:2 = 00) */
if (buttonlight_is_on) if (buttonlight_is_on)
_buttonlight_on(); buttonlight_hw_on();
#endif #endif
} }
} }

View File

@ -360,7 +360,7 @@ void system_init(void)
void system_reboot(void) void system_reboot(void)
{ {
_backlight_off(); backlight_hw_off();
disable_irq(); disable_irq();

View File

@ -19,27 +19,27 @@
* *
****************************************************************************/ ****************************************************************************/
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
(void)brightness; (void)brightness;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
} }

View File

@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */ #endif /* BACKLIGHT_TARGET_H */

View File

@ -28,7 +28,7 @@
#include "pinctrl-imx233.h" #include "pinctrl-imx233.h"
#include "pwm-imx233.h" #include "pwm-imx233.h"
void _backlight_set_brightness(int level) void backlight_hw_brightness(int level)
{ {
#if defined(CREATIVE_ZENXFISTYLE) #if defined(CREATIVE_ZENXFISTYLE)
imx233_pwm_setup_simple(4, 24000, level); imx233_pwm_setup_simple(4, 24000, level);
@ -49,7 +49,7 @@ void _backlight_set_brightness(int level)
#endif #endif
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
#if !defined(CREATIVE_ZENV) && !defined(CREATIVE_ZENXFISTYLE) #if !defined(CREATIVE_ZENV) && !defined(CREATIVE_ZENXFISTYLE)
imx233_pinctrl_acquire(1, 12, "backlight_enable"); imx233_pinctrl_acquire(1, 12, "backlight_enable");
@ -60,19 +60,19 @@ bool _backlight_init(void)
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
#endif #endif
/* restore the previous backlight level */ /* restore the previous backlight level */
_backlight_set_brightness(backlight_brightness); backlight_hw_brightness(backlight_brightness);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* there is no real on/off but we can set to 0 brightness */ /* there is no real on/off but we can set to 0 brightness */
_backlight_set_brightness(0); backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */ lcd_enable(false); /* power off visible display */
#endif #endif

View File

@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */ #endif /* BACKLIGHT_TARGET_H */

View File

@ -26,19 +26,19 @@
#include "backlight-target.h" #include "backlight-target.h"
#include "pwm-imx233.h" #include "pwm-imx233.h"
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
imx233_pwm_setup_simple(4, 24000, brightness); imx233_pwm_setup_simple(4, 24000, brightness);
imx233_pwm_enable(4, true); imx233_pwm_enable(4, true);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -46,10 +46,10 @@ void _backlight_on(void)
/* don't do anything special, the core will set the brightness */ /* don't do anything special, the core will set the brightness */
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* there is no real on/off but we can set to 0 brightness */ /* there is no real on/off but we can set to 0 brightness */
_backlight_set_brightness(0); backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */ lcd_enable(false); /* power off visible display */
#endif #endif

View File

@ -21,13 +21,13 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
void _buttonlight_set_brightness(int brightness); void buttonlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */ #endif /* BACKLIGHT_TARGET_H */

View File

@ -27,19 +27,19 @@
#include "pwm-imx233.h" #include "pwm-imx233.h"
#include "mpr121.h" #include "mpr121.h"
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
imx233_pwm_setup_simple(2, 24000, brightness); imx233_pwm_setup_simple(2, 24000, brightness);
imx233_pwm_enable(2, true); imx233_pwm_enable(2, true);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -47,29 +47,29 @@ void _backlight_on(void)
/* don't do anything special, the core will set the brightness */ /* don't do anything special, the core will set the brightness */
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* there is no real on/off but we can set to 0 brightness */ /* there is no real on/off but we can set to 0 brightness */
_backlight_set_brightness(0); backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */ lcd_enable(false); /* power off visible display */
#endif #endif
} }
/* ELE8 is the button light GPIO */ /* ELE8 is the button light GPIO */
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
/* assume mpr121 was initialized by button-zenxfi3.c */ /* assume mpr121 was initialized by button-zenxfi3.c */
mpr121_set_gpio_output(8, ELE_GPIO_SET); mpr121_set_gpio_output(8, ELE_GPIO_SET);
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
/* assume mpr121 was initialized by button-zenxfi3.c */ /* assume mpr121 was initialized by button-zenxfi3.c */
mpr121_set_gpio_output(8, ELE_GPIO_CLR); mpr121_set_gpio_output(8, ELE_GPIO_CLR);
} }
void _buttonlight_set_brightness(int brightness) void buttonlight_hw_brightness(int brightness)
{ {
/* assume mpr121 was initialized by button-zenxfi3.c */ /* assume mpr121 was initialized by button-zenxfi3.c */
/* since backlight brightness is the same for the screen and the button light, /* since backlight brightness is the same for the screen and the button light,

View File

@ -20,9 +20,9 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */ #endif /* BACKLIGHT_TARGET_H */

View File

@ -77,7 +77,7 @@ static void aat3151_write(int addr, int data)
udelay(TIME_LAT); udelay(TIME_LAT);
} }
void _backlight_set_brightness(int level) void backlight_hw_brightness(int level)
{ {
/* Don't try to reset backlight if not necessary /* Don't try to reset backlight if not necessary
* Moreover this helps to avoid flickering when * Moreover this helps to avoid flickering when
@ -120,7 +120,7 @@ void _backlight_set_brightness(int level)
current_level = level; current_level = level;
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
imx233_pinctrl_acquire(3, 13, "backlight"); imx233_pinctrl_acquire(3, 13, "backlight");
imx233_pinctrl_set_function(3, 13, PINCTRL_FUNCTION_GPIO); imx233_pinctrl_set_function(3, 13, PINCTRL_FUNCTION_GPIO);
@ -130,19 +130,19 @@ bool _backlight_init(void)
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
#endif #endif
/* restore the previous backlight level */ /* restore the previous backlight level */
_backlight_set_brightness(backlight_brightness); backlight_hw_brightness(backlight_brightness);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* there is no real on/off but we can set to 0 brightness */ /* there is no real on/off but we can set to 0 brightness */
_backlight_set_brightness(0); backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */ lcd_enable(false); /* power off visible display */
#endif #endif

View File

@ -26,7 +26,7 @@
#include "backlight-target.h" #include "backlight-target.h"
#include "pinctrl-imx233.h" #include "pinctrl-imx233.h"
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
if(brightness != 0) if(brightness != 0)
brightness = MAX_BRIGHTNESS_SETTING + 1 - brightness; brightness = MAX_BRIGHTNESS_SETTING + 1 - brightness;
@ -39,17 +39,17 @@ void _backlight_set_brightness(int brightness)
} }
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
imx233_pinctrl_acquire(1, 28, "backlight"); imx233_pinctrl_acquire(1, 28, "backlight");
imx233_pinctrl_set_function(1, 28, PINCTRL_FUNCTION_GPIO); imx233_pinctrl_set_function(1, 28, PINCTRL_FUNCTION_GPIO);
imx233_pinctrl_set_drive(1, 28, PINCTRL_DRIVE_8mA); imx233_pinctrl_set_drive(1, 28, PINCTRL_DRIVE_8mA);
imx233_pinctrl_enable_gpio(1, 28, true); imx233_pinctrl_enable_gpio(1, 28, true);
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -57,10 +57,10 @@ void _backlight_on(void)
/* don't do anything special, the core will set the brightness */ /* don't do anything special, the core will set the brightness */
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* there is no real on/off but we can set to 0 brightness */ /* there is no real on/off but we can set to 0 brightness */
_backlight_set_brightness(0); backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */ lcd_enable(false); /* power off visible display */
#endif #endif

View File

@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */ #endif /* BACKLIGHT_TARGET_H */

View File

@ -27,7 +27,7 @@
#include "pwm-imx233.h" #include "pwm-imx233.h"
#include "pinctrl-imx233.h" #include "pinctrl-imx233.h"
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
bool en = brightness > 0; bool en = brightness > 0;
imx233_pwm_setup_simple(2, 24000, 100 - brightness); imx233_pwm_setup_simple(2, 24000, 100 - brightness);
@ -35,17 +35,17 @@ void _backlight_set_brightness(int brightness)
imx233_pinctrl_set_gpio(0, 10, en); imx233_pinctrl_set_gpio(0, 10, en);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
imx233_pinctrl_acquire(0, 10, "backlight_enable"); imx233_pinctrl_acquire(0, 10, "backlight_enable");
imx233_pinctrl_set_function(0, 10, PINCTRL_FUNCTION_GPIO); imx233_pinctrl_set_function(0, 10, PINCTRL_FUNCTION_GPIO);
imx233_pinctrl_enable_gpio(0, 10, true); imx233_pinctrl_enable_gpio(0, 10, true);
imx233_pinctrl_set_gpio(0, 10, true); imx233_pinctrl_set_gpio(0, 10, true);
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -53,10 +53,10 @@ void _backlight_on(void)
/* don't do anything special, the core will set the brightness */ /* don't do anything special, the core will set the brightness */
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* there is no real on/off but we can set to 0 brightness */ /* there is no real on/off but we can set to 0 brightness */
_backlight_set_brightness(0); backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */ lcd_enable(false); /* power off visible display */
#endif #endif

View File

@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */ #endif /* BACKLIGHT_TARGET_H */

View File

@ -105,7 +105,7 @@ void imx233_chip_reset(void)
void system_reboot(void) void system_reboot(void)
{ {
_backlight_off(); backlight_hw_off();
disable_irq(); disable_irq();
@ -119,8 +119,8 @@ void system_exception_wait(void)
imx233_rtc_enable_watchdog(false); imx233_rtc_enable_watchdog(false);
/* make sure lcd and backlight are on */ /* make sure lcd and backlight are on */
lcd_update(); lcd_update();
_backlight_on(); backlight_hw_on();
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
/* wait until button release (if a button is pressed) */ /* wait until button release (if a button is pressed) */
#ifdef HAVE_BUTTON_DATA #ifdef HAVE_BUTTON_DATA
int data; int data;

View File

@ -79,7 +79,7 @@ static uint32_t backlight_pwm_bits; /* Final PWM setting for fade-in */
/* Backlight ramping settings */ /* Backlight ramping settings */
static uint32_t led_ramp_mask = MC13783_LEDMDRAMPDOWN | MC13783_LEDMDRAMPUP; static uint32_t led_ramp_mask = MC13783_LEDMDRAMPDOWN | MC13783_LEDMDRAMPUP;
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
/* Set default LED register value */ /* Set default LED register value */
mc13783_write(MC13783_LED_CONTROL0, mc13783_write(MC13783_LED_CONTROL0,
@ -88,7 +88,7 @@ bool _backlight_init(void)
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
/* Our PWM and I-Level is different than retailos (but same apparent /* Our PWM and I-Level is different than retailos (but same apparent
* brightness), so init to our default. */ * brightness), so init to our default. */
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
#else #else
/* Use default PWM */ /* Use default PWM */
backlight_pwm_bits = mc13783_read(MC13783_LED_CONTROL2) & MC13783_LEDMDDC; backlight_pwm_bits = mc13783_read(MC13783_LED_CONTROL2) & MC13783_LEDMDDC;
@ -113,7 +113,7 @@ void backlight_set_fade_in(bool value)
led_ramp_mask &= ~MC13783_LEDMDRAMPUP; led_ramp_mask &= ~MC13783_LEDMDRAMPUP;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
static const char regs[2] = static const char regs[2] =
{ {
@ -149,7 +149,7 @@ void _backlight_on(void)
} }
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
uint32_t ctrl0 = MC13783_LED_CONTROL0_BITS | MC13783_LEDEN; uint32_t ctrl0 = MC13783_LED_CONTROL0_BITS | MC13783_LEDEN;
@ -173,7 +173,7 @@ void _backlight_off(void)
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
/* Assumes that the backlight has been initialized - parameter should /* Assumes that the backlight has been initialized - parameter should
* already be range-checked in public interface. */ * already be range-checked in public interface. */
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
uint32_t md = led_md_pwm_table[brightness].md; uint32_t md = led_md_pwm_table[brightness].md;
backlight_pwm_bits = backlight_on_status ? backlight_pwm_bits = backlight_on_status ?

View File

@ -27,10 +27,10 @@
#define BACKLIGHT_FULL_INIT #define BACKLIGHT_FULL_INIT
#endif #endif
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
void _backlight_lcd_sleep(void); void _backlight_lcd_sleep(void);

View File

@ -136,7 +136,7 @@ void power_off(void)
dptc_stop(); dptc_stop();
/* Cut backlight */ /* Cut backlight */
_backlight_off(); backlight_hw_off();
/* Let it fade */ /* Let it fade */
sleep(5*HZ/4); sleep(5*HZ/4);

View File

@ -24,13 +24,13 @@
#include "backlight.h" #include "backlight.h"
#include "backlight-target.h" #include "backlight-target.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
LCD1_CONTROL |= 0x02; LCD1_CONTROL |= 0x02;
lcd_set_backlight_inversion(true); lcd_set_backlight_inversion(true);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
LCD1_CONTROL &= ~0x02; LCD1_CONTROL &= ~0x02;
lcd_set_backlight_inversion(false); lcd_set_backlight_inversion(false);

View File

@ -21,8 +21,8 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() false #define backlight_hw_init() false
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#endif #endif

View File

@ -23,12 +23,12 @@
#include "backlight.h" #include "backlight.h"
#include "backlight-target.h" #include "backlight-target.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
LCD1_CONTROL |= 0x02; LCD1_CONTROL |= 0x02;
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
LCD1_CONTROL &= ~0x02; LCD1_CONTROL &= ~0x02;
} }

View File

@ -44,11 +44,11 @@ static unsigned char log_brightness[32] = {
static unsigned brightness = 100; /* 1 to 255 */ static unsigned brightness = 100; /* 1 to 255 */
static bool enabled = false; static bool enabled = false;
/* Handling B03 in _backlight_on() and _backlight_off() makes backlight go off /* Handling B03 in backlight_hw_on() and backlight_hw_off() makes backlight go off
* without delay. Not doing that does a short (fixed) fade out. Opt for the * without delay. Not doing that does a short (fixed) fade out. Opt for the
* latter. */ * latter. */
void _backlight_on(void) void backlight_hw_on(void)
{ {
/* brightness full */ /* brightness full */
outl(0x80000000 | (brightness << 16), 0x7000a010); outl(0x80000000 | (brightness << 16), 0x7000a010);
@ -56,27 +56,27 @@ void _backlight_on(void)
enabled = true; enabled = true;
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
outl(0x80000000, 0x7000a010); outl(0x80000000, 0x7000a010);
GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x08); GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x08);
enabled = false; enabled = false;
} }
void _backlight_set_brightness(int val) void backlight_hw_brightness(int val)
{ {
brightness = log_brightness[val]; brightness = log_brightness[val];
if (enabled) if (enabled)
outl(0x80000000 | (brightness << 16), 0x7000a010); outl(0x80000000 | (brightness << 16), 0x7000a010);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
GPIO_SET_BITWISE(GPIOB_ENABLE, 0x0c); /* B02 and B03 enable */ GPIO_SET_BITWISE(GPIOB_ENABLE, 0x0c); /* B02 and B03 enable */
GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x08); /* B03 = 1 */ GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x08); /* B03 = 1 */
GPO32_ENABLE &= ~0x2000000; /* D01 disable, so pwm takes over */ GPO32_ENABLE &= ~0x2000000; /* D01 disable, so pwm takes over */
DEV_EN |= DEV_PWM; /* PWM enable */ DEV_EN |= DEV_PWM; /* PWM enable */
_backlight_on(); backlight_hw_on();
return true; return true;
} }

View File

@ -38,7 +38,7 @@ static int brightness = 1; /* 1 to 32 */
static int current_dim = 16; /* default after enabling the backlight dimmer */ static int current_dim = 16; /* default after enabling the backlight dimmer */
static bool enabled = false; static bool enabled = false;
void _backlight_set_brightness(int val) void backlight_hw_brightness(int val)
{ {
int oldlevel; int oldlevel;
@ -91,7 +91,7 @@ void _backlight_hw_enable(bool on)
GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x80); GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x80);
sleep(HZ/100); sleep(HZ/100);
current_dim = 16; current_dim = 16;
_backlight_set_brightness(brightness); backlight_hw_brightness(brightness);
} }
else else
{ {
@ -116,7 +116,7 @@ void _backlight_led_off(void)
GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL, 0x80); GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL, 0x80);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
GPIO_SET_BITWISE(GPIOB_ENABLE, 0x08); GPIO_SET_BITWISE(GPIOB_ENABLE, 0x08);
GPIO_SET_BITWISE(GPIOB_OUTPUT_EN, 0x08); GPIO_SET_BITWISE(GPIOB_OUTPUT_EN, 0x08);

View File

@ -23,8 +23,8 @@
#if defined(IPOD_VIDEO) || defined(IPOD_NANO) #if defined(IPOD_VIDEO) || defined(IPOD_NANO)
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_set_brightness(int val); void backlight_hw_brightness(int val);
void _backlight_led_on(void); void _backlight_led_on(void);
void _backlight_led_off(void); void _backlight_led_off(void);
void _backlight_hw_enable(bool on); void _backlight_hw_enable(bool on);
@ -34,48 +34,48 @@ void lcd_awake(void);
#endif #endif
#ifdef BOOTLOADER #ifdef BOOTLOADER
#define _backlight_on() do { _backlight_hw_enable(true); \ #define backlight_hw_on() do { _backlight_hw_enable(true); \
_backlight_led_on(); } while(0) _backlight_led_on(); } while(0)
#define _backlight_off() do { _backlight_led_off(); \ #define backlight_hw_off() do { _backlight_led_off(); \
_backlight_hw_enable(false); } while(0) _backlight_hw_enable(false); } while(0)
#else /* !BOOTLOADER */ #else /* !BOOTLOADER */
#define _backlight_on_isr() _backlight_led_on() #define backlight_hw_on_isr() _backlight_led_on()
#define _backlight_off_isr() _backlight_led_off() #define backlight_hw_off_isr() _backlight_led_off()
#define _backlight_on_normal() do { _backlight_hw_enable(true); \ #define backlight_hw_on_normal() do { _backlight_hw_enable(true); \
_backlight_led_on(); } while(0) _backlight_led_on(); } while(0)
#define _backlight_off_normal() do { _backlight_led_off(); \ #define backlight_hw_off_normal() do { _backlight_led_off(); \
_backlight_hw_enable(false); } while(0) _backlight_hw_enable(false); } while(0)
#define _BACKLIGHT_FADE_ENABLE #define _BACKLIGHT_FADE_ENABLE
#endif /* !BOOTLOADER */ #endif /* !BOOTLOADER */
#elif defined(IPOD_4G) || defined(IPOD_COLOR) #elif defined(IPOD_4G) || defined(IPOD_COLOR)
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int val); void backlight_hw_brightness(int val);
#elif defined(IPOD_MINI) || defined(IPOD_MINI2G) #elif defined(IPOD_MINI) || defined(IPOD_MINI2G)
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_hw_on(void); void _backlight_hw_on(void);
void _backlight_hw_off(void); void _backlight_hw_off(void);
#ifdef BOOTLOADER #ifdef BOOTLOADER
#define _backlight_on() _backlight_hw_on() #define backlight_hw_on() _backlight_hw_on()
#define _backlight_off() _backlight_hw_off() #define backlight_hw_off() _backlight_hw_off()
#else #else
#define _backlight_on_isr() _backlight_hw_on() #define backlight_hw_on_isr() _backlight_hw_on()
#define _backlight_off_isr() _backlight_hw_off() #define backlight_hw_off_isr() _backlight_hw_off()
#define _backlight_on_normal() _backlight_hw_on() #define backlight_hw_on_normal() _backlight_hw_on()
#define _backlight_off_normal() _backlight_hw_off() #define backlight_hw_off_normal() _backlight_hw_off()
#endif #endif
#elif defined(IPOD_1G2G) || defined(IPOD_3G) #elif defined(IPOD_1G2G) || defined(IPOD_3G)
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#endif #endif
#endif #endif

View File

@ -66,7 +66,7 @@ static void handle_scroll_wheel(int new_scroll)
static int prev_scroll = -1; static int prev_scroll = -1;
static int direction = 0; static int direction = 0;
static int count = 0; static int count = 0;
static long next_backlight_on = 0; static long nextbacklight_hw_on = 0;
static unsigned long last_wheel_usec = 0; static unsigned long last_wheel_usec = 0;
static unsigned long wheel_delta = 1ul << 24; static unsigned long wheel_delta = 1ul << 24;
@ -96,10 +96,10 @@ static void handle_scroll_wheel(int new_scroll)
} }
/* poke backlight every 1/4s of activity */ /* poke backlight every 1/4s of activity */
if (TIME_AFTER(current_tick, next_backlight_on)) { if (TIME_AFTER(current_tick, nextbacklight_hw_on)) {
backlight_on(); backlight_on();
reset_poweroff_timer(); reset_poweroff_timer();
next_backlight_on = current_tick + HZ/4; nextbacklight_hw_on = current_tick + HZ/4;
} }
/* has wheel travelled far enough? */ /* has wheel travelled far enough? */
@ -152,7 +152,7 @@ static void handle_scroll_wheel(int new_scroll)
wheel_velocity = v; wheel_velocity = v;
/* ensure backlight never gets stuck for an extended period if tick /* ensure backlight never gets stuck for an extended period if tick
* wrapped such that next poke is very far ahead */ * wrapped such that next poke is very far ahead */
next_backlight_on = current_tick - 1; nextbacklight_hw_on = current_tick - 1;
} }
else { else {
/* some velocity filtering to smooth things out */ /* some velocity filtering to smooth things out */

View File

@ -60,7 +60,7 @@ static void handle_scroll_wheel(int new_scroll)
static int prev_scroll = -1; static int prev_scroll = -1;
static int direction = 0; static int direction = 0;
static int count = 0; static int count = 0;
static long next_backlight_on = 0; static long nextbacklight_hw_on = 0;
int wheel_keycode = BUTTON_NONE; int wheel_keycode = BUTTON_NONE;
int scroll; int scroll;
@ -92,10 +92,10 @@ static void handle_scroll_wheel(int new_scroll)
} }
/* poke backlight every 1/4s of activity */ /* poke backlight every 1/4s of activity */
if (TIME_AFTER(current_tick, next_backlight_on)) { if (TIME_AFTER(current_tick, nextbacklight_hw_on)) {
backlight_on(); backlight_on();
reset_poweroff_timer(); reset_poweroff_timer();
next_backlight_on = current_tick + HZ/4; nextbacklight_hw_on = current_tick + HZ/4;
} }
if (++count < WHEEL_BASE_SENSITIVITY) if (++count < WHEEL_BASE_SENSITIVITY)
@ -144,7 +144,7 @@ static void handle_scroll_wheel(int new_scroll)
wheel_velocity = v; wheel_velocity = v;
/* ensure backlight never gets stuck for an extended period if tick /* ensure backlight never gets stuck for an extended period if tick
* wrapped such that next poke is very far ahead */ * wrapped such that next poke is very far ahead */
next_backlight_on = current_tick - 1; nextbacklight_hw_on = current_tick - 1;
} }
else { else {
/* some velocity filtering to smooth things out */ /* some velocity filtering to smooth things out */

View File

@ -122,7 +122,7 @@ void lcd_shutdown(void) {
#if defined(IPOD_NANO) #if defined(IPOD_NANO)
_backlight_hw_enable(false); _backlight_hw_enable(false);
#elif defined(IPOD_COLOR) #elif defined(IPOD_COLOR)
_backlight_off(); backlight_hw_off();
#endif #endif
if ((lcd_type&1) == 0) { if ((lcd_type&1) == 0) {

View File

@ -21,8 +21,8 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#endif #endif

View File

@ -25,7 +25,7 @@
#include "backlight-target.h" #include "backlight-target.h"
#include "lcd.h" #include "lcd.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -33,7 +33,7 @@ void _backlight_on(void)
GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x20); GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x20);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL, 0x20); GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL, 0x20);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE

View File

@ -28,22 +28,22 @@
static const int log_brightness[12] = {0,4,8,12,20,28,40,60,88,124,176,255}; static const int log_brightness[12] = {0,4,8,12,20,28,40,60,88,124,176,255};
/* Returns the current state of the backlight (true=ON, false=OFF). */ /* Returns the current state of the backlight (true=ON, false=OFF). */
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
return (GPO32_ENABLE & 0x1000000) ? true : false; return (GPO32_ENABLE & 0x1000000) ? true : false;
} }
void _backlight_hw_on(void) void backlight_hw_on(void)
{ {
GPO32_ENABLE |= 0x1000000; GPO32_ENABLE |= 0x1000000;
} }
void _backlight_hw_off(void) void backlight_hw_off(void)
{ {
GPO32_ENABLE &= ~0x1000000; GPO32_ENABLE &= ~0x1000000;
} }
void _buttonlight_set_brightness(int brightness) void buttonlight_hw_brightness(int brightness)
{ {
/* clamp the brightness value */ /* clamp the brightness value */
brightness = MAX(0, MIN(15, brightness)); brightness = MAX(0, MIN(15, brightness));
@ -51,13 +51,13 @@ void _buttonlight_set_brightness(int brightness)
outl(MIN_BRIGHTNESS-(log_brightness[brightness - 1] << 16), 0x7000a010); outl(MIN_BRIGHTNESS-(log_brightness[brightness - 1] << 16), 0x7000a010);
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
/* turn on all touchpad leds */ /* turn on all touchpad leds */
GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL; GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL;
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
/* turn off all touchpad leds */ /* turn off all touchpad leds */
GPIOA_OUTPUT_VAL &= ~BUTTONLIGHT_ALL; GPIOA_OUTPUT_VAL &= ~BUTTONLIGHT_ALL;

View File

@ -22,23 +22,20 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); /* Returns backlight current state (true=ON). */ bool backlight_hw_init(void); /* Returns backlight current state (true=ON). */
void _backlight_hw_on(void); void _backlight_hw_on(void);
void _backlight_hw_off(void); void _backlight_hw_off(void);
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
void _remote_backlight_on(void); void remote_backlight_hw_on(void);
void _remote_backlight_off(void); void remote_backlight_hw_off(void);
#endif #endif
#ifdef BOOTLOADER #ifndef BOOTLOADER
#define _backlight_on() _backlight_hw_on() #define _backlight_on_isr() backlight_hw_on()
#define _backlight_off() _backlight_hw_off() #define _backlight_off_isr() backlight_hw_off()
#else #define _backlight_on_normal() backlight_hw_on()
#define _backlight_on_isr() _backlight_hw_on() #define _backlight_off_normal() backlight_hw_off()
#define _backlight_off_isr() _backlight_hw_off()
#define _backlight_on_normal() _backlight_hw_on()
#define _backlight_off_normal() _backlight_hw_off()
#define _BACKLIGHT_FADE_BOOST #define _BACKLIGHT_FADE_BOOST
#endif #endif
@ -53,8 +50,8 @@ void _remote_backlight_off(void);
BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \ BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \
BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL) BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL)
void _buttonlight_set_brightness(int brightness); void buttonlight_hw_brightness(int brightness);
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif #endif

View File

@ -552,13 +552,13 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
rc_status |= RC_UPDATE_LCD; rc_status |= RC_UPDATE_LCD;
} }
void _remote_backlight_on(void) void remote_backlight_hw_on(void)
{ {
rc_status |= RC_BACKLIGHT_ON; rc_status |= RC_BACKLIGHT_ON;
rc_status |= RC_UPDATE_CONTROLLER; rc_status |= RC_UPDATE_CONTROLLER;
} }
void _remote_backlight_off(void) void remote_backlight_hw_off(void)
{ {
rc_status &= ~RC_BACKLIGHT_ON; rc_status &= ~RC_BACKLIGHT_ON;
rc_status |= RC_UPDATE_CONTROLLER; rc_status |= RC_UPDATE_CONTROLLER;

View File

@ -21,18 +21,18 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif #endif
#ifdef HAVE_BUTTON_LIGHT #ifdef HAVE_BUTTON_LIGHT
void _buttonlight_on(void); voidbuttonlight_hw_on(void);
void _buttonlight_off(void); voidbuttonlight_hw_off(void);
void _buttonlight_set_brightness(int brightness); voidbuttonlight_hw_set_brightness(int brightness);
#endif #endif
#endif /* BACKLIGHT_TARGET.H */ #endif /* BACKLIGHT_TARGET.H */

View File

@ -27,7 +27,7 @@
#include "lcd.h" #include "lcd.h"
#include "synaptics-mep.h" #include "synaptics-mep.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -35,7 +35,7 @@ void _backlight_on(void)
GPIO_SET_BITWISE(GPIOJ_OUTPUT_VAL, 0x01); GPIO_SET_BITWISE(GPIOJ_OUTPUT_VAL, 0x01);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPIO_CLEAR_BITWISE(GPIOJ_OUTPUT_VAL, 0x01); GPIO_CLEAR_BITWISE(GPIOJ_OUTPUT_VAL, 0x01);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
@ -47,7 +47,7 @@ void _backlight_off(void)
static const int brightness_vals[16] = static const int brightness_vals[16] =
{255,237,219,201,183,165,147,130,112,94,76,58,40,22,5,0}; {255,237,219,201,183,165,147,130,112,94,76,58,40,22,5,0};
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
/* From PB Vibe Bootloader and OF */ /* From PB Vibe Bootloader and OF */
DEV_INIT1&=0xFFFF3F3F; DEV_INIT1&=0xFFFF3F3F;
@ -60,7 +60,7 @@ void _backlight_set_brightness(int brightness)
#ifdef HAVE_BUTTON_LIGHT #ifdef HAVE_BUTTON_LIGHT
static unsigned short buttonlight_status = 0; static unsigned short buttonlight_status = 0;
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
if (!buttonlight_status) if (!buttonlight_status)
{ {
@ -69,7 +69,7 @@ void _buttonlight_on(void)
} }
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
if (buttonlight_status) if (buttonlight_status)
{ {
@ -78,7 +78,7 @@ void _buttonlight_off(void)
} }
} }
void _buttonlight_set_brightness(int brightness) void buttonlight_hw_brightness(int brightness)
{ {
/* no brightness control, but lights stays on - for compatibility */ /* no brightness control, but lights stays on - for compatibility */
(void)brightness; (void)brightness;

View File

@ -29,13 +29,13 @@
static const int brightness_vals[16] = static const int brightness_vals[16] =
{255,237,219,201,183,165,147,130,112,94,76,58,40,22,5,0}; {255,237,219,201,183,165,147,130,112,94,76,58,40,22,5,0};
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
outl(0x80000000 | (brightness_vals[brightness-1] << 16), 0x7000a000); outl(0x80000000 | (brightness_vals[brightness-1] << 16), 0x7000a000);
} }
#endif #endif
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); lcd_enable(true);
@ -45,7 +45,7 @@ void _backlight_on(void)
GPO32_VAL |= 0x400; GPO32_VAL |= 0x400;
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPO32_ENABLE |= 0x400; GPO32_ENABLE |= 0x400;
GPO32_VAL &=~0x400; GPO32_VAL &=~0x400;
@ -60,7 +60,7 @@ void _backlight_off(void)
static unsigned short buttonight_brightness = DEFAULT_BRIGHTNESS_SETTING - 1; static unsigned short buttonight_brightness = DEFAULT_BRIGHTNESS_SETTING - 1;
static unsigned short buttonlight_status = 0; static unsigned short buttonlight_status = 0;
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
if (!buttonlight_status) if (!buttonlight_status)
{ {
@ -69,7 +69,7 @@ void _buttonlight_on(void)
} }
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
if (buttonlight_status) if (buttonlight_status)
{ {
@ -78,7 +78,7 @@ void _buttonlight_off(void)
} }
} }
void _buttonlight_set_brightness(int brightness) void buttonlight_hw_brightness(int brightness)
{ {
buttonight_brightness = brightness - 1; buttonight_brightness = brightness - 1;
touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness); touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness);

View File

@ -21,18 +21,18 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif #endif
#ifdef HAVE_BUTTON_LIGHT #ifdef HAVE_BUTTON_LIGHT
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
void _buttonlight_set_brightness(int brightness); void buttonlight_hw_brightness(int brightness);
#endif #endif
#endif #endif

View File

@ -29,13 +29,13 @@
static const int brightness_vals[16] = static const int brightness_vals[16] =
{255,237,219,201,183,165,147,130,112,94,76,58,40,22,5,0}; {255,237,219,201,183,165,147,130,112,94,76,58,40,22,5,0};
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
outl(0x80000000 | (brightness_vals[brightness-1] << 16), 0x7000a000); outl(0x80000000 | (brightness_vals[brightness-1] << 16), 0x7000a000);
} }
#endif #endif
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); lcd_enable(true);
@ -45,7 +45,7 @@ void _backlight_on(void)
GPO32_VAL |= 0x400; GPO32_VAL |= 0x400;
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPO32_ENABLE |= 0x400; GPO32_ENABLE |= 0x400;
GPO32_VAL &= ~0x400; GPO32_VAL &= ~0x400;
@ -60,7 +60,7 @@ void _backlight_off(void)
static unsigned short buttonight_brightness = DEFAULT_BRIGHTNESS_SETTING - 1; static unsigned short buttonight_brightness = DEFAULT_BRIGHTNESS_SETTING - 1;
static unsigned short buttonlight_status = 0; static unsigned short buttonlight_status = 0;
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
if (!buttonlight_status) if (!buttonlight_status)
{ {
@ -77,7 +77,7 @@ void _buttonlight_on(void)
} }
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
if (buttonlight_status) if (buttonlight_status)
{ {
@ -89,7 +89,7 @@ void _buttonlight_off(void)
} }
} }
void _buttonlight_set_brightness(int brightness) void buttonlight_hw_brightness(int brightness)
{ {
touchpad_set_parameter(0x01,0x21,0x01); touchpad_set_parameter(0x01,0x21,0x01);
touchpad_set_parameter(0x00,0x22,0x15); touchpad_set_parameter(0x00,0x22,0x15);

View File

@ -21,18 +21,18 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif #endif
#ifdef HAVE_BUTTON_LIGHT #ifdef HAVE_BUTTON_LIGHT
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
void _buttonlight_set_brightness(int brightness); void buttonlight_hw_brightness(int brightness);
#endif #endif
#endif #endif

View File

@ -111,7 +111,7 @@ bool ide_powered(void)
void power_off(void) void power_off(void)
{ {
_backlight_off(); backlight_hw_off();
sleep(HZ/10); sleep(HZ/10);
/* power off bit */ /* power off bit */

View File

@ -27,12 +27,12 @@
#include "synaptics-mep.h" #include "synaptics-mep.h"
#include "lcd.h" #include "lcd.h"
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
ascodec_write(AS3514_DCDC15, brightness); ascodec_write(AS3514_DCDC15, brightness);
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -40,13 +40,13 @@ void _backlight_on(void)
#if (CONFIG_BACKLIGHT_FADING != BACKLIGHT_FADING_SW_SETTING) /* in bootloader/sim */ #if (CONFIG_BACKLIGHT_FADING != BACKLIGHT_FADING_SW_SETTING) /* in bootloader/sim */
/* if we set the brightness to the settings value, then fading up /* if we set the brightness to the settings value, then fading up
* is glitchy */ * is glitchy */
_backlight_set_brightness(backlight_brightness); backlight_hw_brightness(backlight_brightness);
#endif #endif
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
_backlight_set_brightness(0); backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */ lcd_enable(false); /* power off visible display */
#endif #endif
@ -58,7 +58,7 @@ void _backlight_off(void)
#define BUTTONLIGHT_MAX 0x0f #define BUTTONLIGHT_MAX 0x0f
static unsigned short buttonlight_status = 0; static unsigned short buttonlight_status = 0;
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
if (!buttonlight_status) if (!buttonlight_status)
{ {
@ -68,7 +68,7 @@ void _buttonlight_on(void)
} }
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
if (buttonlight_status) if (buttonlight_status)
{ {

View File

@ -21,15 +21,15 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
int __backlight_is_on(void); int __backlight_is_on(void);
#ifdef HAVE_BUTTON_LIGHT #ifdef HAVE_BUTTON_LIGHT
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif #endif
#endif #endif

View File

@ -21,8 +21,8 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#endif #endif

View File

@ -24,12 +24,12 @@
#include "backlight.h" #include "backlight.h"
#include "lcd.h" #include "lcd.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
GPIO3_SET = 1; GPIO3_SET = 1;
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPIO3_CLR = 1; GPIO3_CLR = 1;
} }

View File

@ -77,7 +77,7 @@ static const unsigned short lin_brightness[] = {
}; };
#endif #endif
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
/* configure PD4 as output */ /* configure PD4 as output */
GPIO_PDCON |= (1<<4); GPIO_PDCON |= (1<<4);
@ -105,7 +105,7 @@ bool _backlight_init(void)
return true; return true;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); lcd_enable(true);
@ -120,7 +120,7 @@ void _backlight_on(void)
PWMT0_CTRL |= (1<<3) | (1<<0); PWMT0_CTRL |= (1<<3) | (1<<0);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* setup PWM0 pin as GPIO which is pulled low */ /* setup PWM0 pin as GPIO which is pulled low */
SCU_IOMUXB_CON &= ~(1<<11); SCU_IOMUXB_CON &= ~(1<<11);
@ -135,7 +135,7 @@ void _backlight_off(void)
#endif #endif
} }
void _backlight_set_brightness(int val) void backlight_hw_brightness(int val)
{ {
brightness = val & 0x1f; brightness = val & 0x1f;
PWMT0_HRC = lin_brightness[brightness]; PWMT0_HRC = lin_brightness[brightness];

View File

@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif #endif

View File

@ -74,7 +74,7 @@ static unsigned char buttonlight_target;
static unsigned short buttonlight_trigger_now; static unsigned short buttonlight_trigger_now;
/* Assumes that the backlight has been initialized */ /* Assumes that the backlight has been initialized */
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
/* stop the interrupt from messing us up */ /* stop the interrupt from messing us up */
backlight_control = BACKLIGHT_CONTROL_IDLE; backlight_control = BACKLIGHT_CONTROL_IDLE;
@ -335,7 +335,7 @@ static void __backlight_dim(bool dim_now)
backlight_control = BACKLIGHT_CONTROL_FADE; backlight_control = BACKLIGHT_CONTROL_FADE;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -343,7 +343,7 @@ void _backlight_on(void)
__backlight_dim(false); __backlight_dim(false);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
__backlight_dim(true); __backlight_dim(true);
} }
@ -373,12 +373,12 @@ static void __buttonlight_dim(bool dim_now)
buttonlight_control = BUTTONLIGHT_CONTROL_FADE; buttonlight_control = BUTTONLIGHT_CONTROL_FADE;
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
__buttonlight_dim(false); __buttonlight_dim(false);
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
#ifndef BOOTLOADER #ifndef BOOTLOADER
if(buttonlight_get_current_timeout() > 0) if(buttonlight_get_current_timeout() > 0)
@ -388,7 +388,7 @@ void _buttonlight_off(void)
__buttonlight_off(); __buttonlight_off();
} }
void _buttonlight_set_brightness(int brightness) void buttonlight_hw_brightness(int brightness)
{ {
/* stop the interrupt from messing us up */ /* stop the interrupt from messing us up */
buttonlight_control = BUTTONLIGHT_CONTROL_IDLE; buttonlight_control = BUTTONLIGHT_CONTROL_IDLE;
@ -396,7 +396,7 @@ void _buttonlight_set_brightness(int brightness)
buttonlight_control = BUTTONLIGHT_CONTROL_SET; buttonlight_control = BUTTONLIGHT_CONTROL_SET;
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
unsigned char brightness = log_brightness[DEFAULT_BRIGHTNESS_SETTING]; unsigned char brightness = log_brightness[DEFAULT_BRIGHTNESS_SETTING];
buttonlight_brightness = brightness; buttonlight_brightness = brightness;

View File

@ -43,12 +43,12 @@ void __buttonlight_trigger(void);
/* See enum buttonlight_mode for available functions */ /* See enum buttonlight_mode for available functions */
void __buttonlight_mode(enum buttonlight_mode mode); void __buttonlight_mode(enum buttonlight_mode mode);
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
void _buttonlight_set_brightness(int brightness); void buttonlight_hw_brightness(int brightness);
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif #endif

View File

@ -81,8 +81,8 @@ void power_off(void)
int(*reboot_point)(void); int(*reboot_point)(void);
reboot_point=(void*)(unsigned char*) 0x00000000; reboot_point=(void*)(unsigned char*) 0x00000000;
/* turn off backlight and wait for 1 second */ /* turn off backlight and wait for 1 second */
_backlight_off(); backlight_hw_off();
_buttonlight_off(); buttonlight_hw_off();
sleep(HZ); sleep(HZ);
/* Do this to allow the drive to properly reset when player restarts /* Do this to allow the drive to properly reset when player restarts

View File

@ -46,7 +46,7 @@ static unsigned char backlight_target;
/* Assumes that the backlight has been initialized */ /* Assumes that the backlight has been initialized */
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
if (brightness < 0) if (brightness < 0)
brightness = 0; brightness = 0;
@ -86,22 +86,22 @@ static void led_control_service(void)
backlight_control = BACKLIGHT_CONTROL_IDLE; backlight_control = BACKLIGHT_CONTROL_IDLE;
break; break;
case BACKLIGHT_CONTROL_OFF: case BACKLIGHT_CONTROL_OFF:
_backlight_set_brightness(0); backlight_hw_brightness(0);
backlight_control = BACKLIGHT_CONTROL_IDLE; backlight_control = BACKLIGHT_CONTROL_IDLE;
break; break;
case BACKLIGHT_CONTROL_ON: case BACKLIGHT_CONTROL_ON:
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
backlight_control = BACKLIGHT_CONTROL_IDLE; backlight_control = BACKLIGHT_CONTROL_IDLE;
break; break;
case BACKLIGHT_CONTROL_SET: case BACKLIGHT_CONTROL_SET:
/* TODO: This is probably wrong since it sets a fixed value. /* TODO: This is probably wrong since it sets a fixed value.
It was a fixed value of 255 before, but that was even more wrong It was a fixed value of 255 before, but that was even more wrong
since it accessed the log_brightness buffer out of bounds */ since it accessed the log_brightness buffer out of bounds */
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
backlight_control = BACKLIGHT_CONTROL_IDLE; backlight_control = BACKLIGHT_CONTROL_IDLE;
break; break;
case BACKLIGHT_CONTROL_FADE: case BACKLIGHT_CONTROL_FADE:
_backlight_set_brightness(0); backlight_hw_brightness(0);
backlight_control = BACKLIGHT_CONTROL_IDLE; backlight_control = BACKLIGHT_CONTROL_IDLE;
break; break;
default: default:
@ -127,7 +127,7 @@ static void __backlight_dim(bool dim_now)
backlight_control = BACKLIGHT_CONTROL_FADE; backlight_control = BACKLIGHT_CONTROL_FADE;
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -135,13 +135,13 @@ void _backlight_on(void)
__backlight_dim(false); __backlight_dim(false);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
__backlight_dim(true); __backlight_dim(true);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
unsigned char brightness = log_brightness[DEFAULT_BRIGHTNESS_SETTING]; unsigned char brightness = log_brightness[DEFAULT_BRIGHTNESS_SETTING];
_backlight_brightness = brightness; _backlight_brightness = brightness;

View File

@ -23,9 +23,9 @@
#define GPIO_LCD_PWR (1 << 4) /* GPIO.G4 */ #define GPIO_LCD_PWR (1 << 4) /* GPIO.G4 */
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif #endif

View File

@ -32,7 +32,7 @@
level. This makes the brightness curve more linear to the human eye. level. This makes the brightness curve more linear to the human eye.
*/ */
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
/* pwm = round(sqrt(2)**x), where brightness level x = 1..16 */ /* pwm = round(sqrt(2)**x), where brightness level x = 1..16 */
static const unsigned int logtable[] = static const unsigned int logtable[] =
@ -42,21 +42,21 @@ void _backlight_set_brightness(int brightness)
TCDATA0 = logtable[brightness]; TCDATA0 = logtable[brightness];
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
/* configure backlight pin P0.2 as timer PWM output */ /* configure backlight pin P0.2 as timer PWM output */
PCON0 = ((PCON0 & ~(3 << 4)) | (2 << 4)); PCON0 = ((PCON0 & ~(3 << 4)) | (2 << 4));
_backlight_set_brightness(backlight_brightness); backlight_hw_brightness(backlight_brightness);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* configure backlight pin P0.2 as GPIO and switch off */ /* configure backlight pin P0.2 as GPIO and switch off */
PCON0 = ((PCON0 & ~(3 << 4)) | (1 << 4)); PCON0 = ((PCON0 & ~(3 << 4)) | (1 << 4));
PDAT0 &= ~(1 << 2); PDAT0 &= ~(1 << 2);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
/* enable timer clock */ /* enable timer clock */
PWRCON &= ~(1 << 4); PWRCON &= ~(1 << 4);
@ -72,7 +72,7 @@ bool _backlight_init(void)
TCPRE = 20; /* prescaler */ TCPRE = 20; /* prescaler */
TCCMD = (1 << 0); /* TC_EN */ TCCMD = (1 << 0); /* TC_EN */
_backlight_on(); backlight_hw_on();
return true; return true;
} }

View File

@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif #endif

View File

@ -32,12 +32,12 @@ void lcd_awake(void);
void lcd_update(void); void lcd_update(void);
#endif #endif
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
pmu_write(0x28, brightness); pmu_write(0x28, brightness);
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_SLEEP #ifdef HAVE_LCD_SLEEP
if (!lcd_active()) if (!lcd_active())
@ -50,18 +50,18 @@ void _backlight_on(void)
pmu_write(0x29, 1); pmu_write(0x29, 1);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
pmu_write(0x29, 0); pmu_write(0x29, 0);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
pmu_write(0x2a, 6); pmu_write(0x2a, 6);
pmu_write(0x28, 0x2e); pmu_write(0x28, 0x2e);
pmu_write(0x2b, 20); pmu_write(0x2b, 20);
_backlight_on(); backlight_hw_on();
return true; return true;
} }

View File

@ -21,13 +21,13 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif /* BACKLIGHT_TARGET_H */ #endif /* BACKLIGHT_TARGET_H */

View File

@ -35,7 +35,7 @@
are three individually controllable groups: menu/back, cursor, middle). are three individually controllable groups: menu/back, cursor, middle).
*/ */
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
/* pwm = round(16 * 16**(x/16)), where brightness level x = 1..16 */ /* pwm = round(16 * 16**(x/16)), where brightness level x = 1..16 */
static const unsigned int logtable[] = static const unsigned int logtable[] =
@ -45,39 +45,39 @@ void _backlight_set_brightness(int brightness)
TADATA0 = logtable[brightness]; TADATA0 = logtable[brightness];
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
/* configure backlight pin P0.0 as timer PWM output */ /* configure backlight pin P0.0 as timer PWM output */
PCON0 = ((PCON0 & ~(3 << 0)) | (2 << 0)); PCON0 = ((PCON0 & ~(3 << 0)) | (2 << 0));
_backlight_set_brightness(backlight_brightness); backlight_hw_brightness(backlight_brightness);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
/* configure backlight pin P0.0 as GPIO and switch off */ /* configure backlight pin P0.0 as GPIO and switch off */
PCON0 = ((PCON0 & ~(3 << 0)) | (1 << 0)); PCON0 = ((PCON0 & ~(3 << 0)) | (1 << 0));
PDAT0 &= ~(1 << 0); PDAT0 &= ~(1 << 0);
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
PDAT3 |= (3 << 2); PDAT3 |= (3 << 2);
PDAT4 |= (1 << 2); PDAT4 |= (1 << 2);
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
PDAT3 &= ~(3 << 2); PDAT3 &= ~(3 << 2);
PDAT4 &= ~(1 << 2); PDAT4 &= ~(1 << 2);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
/* Enable button LEDs: P3.2 (menu/back), P3.3 (cursor), P4.2 (middle) */ /* Enable button LEDs: P3.2 (menu/back), P3.3 (cursor), P4.2 (middle) */
PCON3 = (PCON3 & ~0x0000FF00) | 0x00001100; PCON3 = (PCON3 & ~0x0000FF00) | 0x00001100;
PCON4 = (PCON4 & ~0x00000F00) | 0x00000100; PCON4 = (PCON4 & ~0x00000F00) | 0x00000100;
_buttonlight_off(); buttonlight_hw_off();
/* enable timer clock */ /* enable timer clock */
PWRCON &= ~(1 << 4); PWRCON &= ~(1 << 4);
@ -93,7 +93,7 @@ bool _backlight_init(void)
TAPRE = 20; /* prescaler */ TAPRE = 20; /* prescaler */
TACMD = (1 << 0); /* TA_EN */ TACMD = (1 << 0); /* TA_EN */
_backlight_on(); backlight_hw_on();
return true; return true;
} }

View File

@ -32,12 +32,12 @@ void lcd_awake(void);
void lcd_update(void); void lcd_update(void);
#endif #endif
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
pmu_write(0x28, brightness); pmu_write(0x28, brightness);
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_SLEEP #ifdef HAVE_LCD_SLEEP
if (!lcd_active()) if (!lcd_active())
@ -50,20 +50,20 @@ void _backlight_on(void)
pmu_write(0x29, 1); pmu_write(0x29, 1);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
pmu_write(0x29, 0); pmu_write(0x29, 0);
} }
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
/* LEDCTL: overvoltage protection enabled, OCP limit is 500mA */ /* LEDCTL: overvoltage protection enabled, OCP limit is 500mA */
pmu_write(0x2a, 0x05); pmu_write(0x2a, 0x05);
pmu_write(0x2b, 0x14); /* T_dimstep = 16 * value / 32768 */ pmu_write(0x2b, 0x14); /* T_dimstep = 16 * value / 32768 */
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
_backlight_on(); backlight_hw_on();
return true; return true;
} }

View File

@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
bool _backlight_init(void); bool backlight_hw_init(void);
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
#endif #endif

View File

@ -21,8 +21,8 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
#endif #endif

View File

@ -25,7 +25,7 @@
#include "backlight-target.h" #include "backlight-target.h"
#include "lcd.h" #include "lcd.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_SLEEP #ifdef HAVE_LCD_SLEEP
backlight_lcd_sleep_countdown(false); /* stop counter */ backlight_lcd_sleep_countdown(false); /* stop counter */
@ -36,7 +36,7 @@ void _backlight_on(void)
GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x2); GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x2);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x2); GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x2);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE

View File

@ -25,7 +25,7 @@
#include "backlight-target.h" #include "backlight-target.h"
#include "lcd.h" #include "lcd.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_SLEEP #ifdef HAVE_LCD_SLEEP
backlight_lcd_sleep_countdown(false); /* stop counter */ backlight_lcd_sleep_countdown(false); /* stop counter */
@ -36,7 +36,7 @@ void _backlight_on(void)
GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x2); GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x2);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x2); GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x2);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE

View File

@ -25,7 +25,7 @@
#include "backlight-target.h" #include "backlight-target.h"
#include "lcd.h" #include "lcd.h"
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_SLEEP #ifdef HAVE_LCD_SLEEP
backlight_lcd_sleep_countdown(false); /* stop counter */ backlight_lcd_sleep_countdown(false); /* stop counter */
@ -36,7 +36,7 @@ void _backlight_on(void)
GPIO_SET_BITWISE(GPIOF_OUTPUT_VAL, 0x1); GPIO_SET_BITWISE(GPIOF_OUTPUT_VAL, 0x1);
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPIO_CLEAR_BITWISE(GPIOF_OUTPUT_VAL, 0x1); GPIO_CLEAR_BITWISE(GPIOF_OUTPUT_VAL, 0x1);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE

View File

@ -26,12 +26,12 @@
#include "ascodec.h" #include "ascodec.h"
#include "as3514.h" #include "as3514.h"
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
ascodec_write(AS3514_DCDC15, brightness); ascodec_write(AS3514_DCDC15, brightness);
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */ lcd_enable(true); /* power on lcd + visible display */
@ -39,19 +39,19 @@ void _backlight_on(void)
#if (CONFIG_BACKLIGHT_FADING != BACKLIGHT_FADING_SW_SETTING) /* in bootloader/sim */ #if (CONFIG_BACKLIGHT_FADING != BACKLIGHT_FADING_SW_SETTING) /* in bootloader/sim */
/* if we set the brightness to the settings value, then fading up /* if we set the brightness to the settings value, then fading up
* is glitchy */ * is glitchy */
_backlight_set_brightness(backlight_brightness); backlight_hw_brightness(backlight_brightness);
#endif #endif
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
_backlight_set_brightness(0); backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE #ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */ lcd_enable(false); /* power off visible display */
#endif #endif
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
GPIO_SET_BITWISE(GPIOG_OUTPUT_VAL, 0x80); GPIO_SET_BITWISE(GPIOG_OUTPUT_VAL, 0x80);
#ifdef SANSA_C200 #ifdef SANSA_C200
@ -59,7 +59,7 @@ void _buttonlight_on(void)
#endif #endif
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
GPIO_CLEAR_BITWISE(GPIOG_OUTPUT_VAL, 0x80); GPIO_CLEAR_BITWISE(GPIOG_OUTPUT_VAL, 0x80);
#ifdef SANSA_C200 #ifdef SANSA_C200

View File

@ -21,11 +21,11 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define _backlight_init() true #define backlight_hw_init() true
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _backlight_set_brightness(int brightness); void backlight_hw_brightness(int brightness);
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif #endif

View File

@ -135,7 +135,7 @@ void clickwheel_int(void)
static int prev_keypost = BUTTON_NONE; static int prev_keypost = BUTTON_NONE;
static int count = 0; static int count = 0;
static int fast_mode = 0; static int fast_mode = 0;
static long next_backlight_on = 0; static long nextbacklight_hw_on = 0;
static unsigned long prev_usec[WHEEL_BASE_SENSITIVITY] = { 0 }; static unsigned long prev_usec[WHEEL_BASE_SENSITIVITY] = { 0 };
static unsigned long delta = 1ul << 24; static unsigned long delta = 1ul << 24;
@ -166,11 +166,11 @@ void clickwheel_int(void)
velocity = 0; velocity = 0;
} }
if (TIME_AFTER(current_tick, next_backlight_on)) if (TIME_AFTER(current_tick, nextbacklight_hw_on))
{ {
/* Poke backlight to turn it on or maintain it no more often /* Poke backlight to turn it on or maintain it no more often
* than every 1/4 second */ * than every 1/4 second */
next_backlight_on = current_tick + HZ/4; nextbacklight_hw_on = current_tick + HZ/4;
backlight_on(); backlight_on();
#ifdef HAVE_BUTTON_LIGHT #ifdef HAVE_BUTTON_LIGHT
buttonlight_on(); buttonlight_on();
@ -209,7 +209,7 @@ void clickwheel_int(void)
velocity = v; velocity = v;
/* Ensure backlight never gets stuck for an extended period if tick /* Ensure backlight never gets stuck for an extended period if tick
* wrapped such that next poke is very far ahead */ * wrapped such that next poke is very far ahead */
next_backlight_on = current_tick - 1; nextbacklight_hw_on = current_tick - 1;
} }
else else
{ {

View File

@ -24,10 +24,10 @@
#include <stdbool.h> #include <stdbool.h>
void _backlight_on(void); void backlight_hw_on(void);
void _backlight_off(void); void backlight_hw_off(void);
void _buttonlight_on(void); void buttonlight_hw_on(void);
void _buttonlight_off(void); void buttonlight_hw_off(void);
#endif #endif

View File

@ -25,7 +25,7 @@
#include "lcd.h" #include "lcd.h"
#include "backlight.h" #include "backlight.h"
bool _backlight_init(void) bool backlight_hw_init(void)
{ {
GPIO_SET_BITWISE(GPIOD_ENABLE, 0x01); GPIO_SET_BITWISE(GPIOD_ENABLE, 0x01);
GPIO_SET_BITWISE(GPIOD_OUTPUT_EN, 0x01); GPIO_SET_BITWISE(GPIOD_OUTPUT_EN, 0x01);
@ -44,22 +44,22 @@ bool _backlight_init(void)
return true; return true;
} }
void _backlight_set_brightness(int brightness) void backlight_hw_brightness(int brightness)
{ {
(void)brightness; (void)brightness;
} }
void _backlight_off(void) void backlight_hw_off(void)
{ {
GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x01); GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x01);
} }
void _backlight_on(void) void backlight_hw_on(void)
{ {
GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x01); GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x01);
} }
void _buttonlight_off(void) void buttonlight_hw_off(void)
{ {
GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x02); /* vertical buttonlight */ GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x02); /* vertical buttonlight */
GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */ GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */
@ -70,7 +70,7 @@ void _buttonlight_off(void)
GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */ GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */
} }
void _buttonlight_on(void) void buttonlight_hw_on(void)
{ {
GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x02); /* vertical buttonlight */ GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x02); /* vertical buttonlight */
GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */ GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */

Some files were not shown because too many files have changed in this diff Show More