Get rid of stupid _backlight_* function names
_remote_backlight_* and _buttonlight_* are cleaned as well
Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
diff --git a/apps/plugins/lib/grey_core.c b/apps/plugins/lib/grey_core.c
index bb68235..fc445c5 100644
--- a/apps/plugins/lib/grey_core.c
+++ b/apps/plugins/lib/grey_core.c
@@ -469,7 +469,7 @@
static void _timer_isr(void)
{
#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;
if ((_grey_info.flags & (_GREY_BACKLIGHT_ON|GREY_RAWMAPPED)) == check)
@@ -648,7 +648,7 @@
else
{
#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;
#endif
fill_gvalues();
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 945d906..66da5d5 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -1093,7 +1093,7 @@
}
#endif
-static void osd_backlight_on_video_mode(bool video_on)
+static void osdbacklight_hw_on_video_mode(bool video_on)
{
if (video_on) {
/* Turn off backlight timeout */
@@ -1779,7 +1779,7 @@
retval = stream_seek(time, SEEK_SET);
if (retval >= STREAM_OK) {
- osd_backlight_on_video_mode(true);
+ osdbacklight_hw_on_video_mode(true);
osd_backlight_brightness_video_mode(true);
stream_show_vo(true);
@@ -1826,7 +1826,7 @@
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 */
if (stream_can_seek() && rb->global_settings->pause_rewind) {
@@ -1847,7 +1847,7 @@
/* Cancel video and resume auto refresh - the resyc when starting
* playback will perform those tasks */
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_cancel_refresh(OSD_REFRESH_VIDEO | OSD_REFRESH_RESUME);
osd_set_status(OSD_STATUS_PLAYING);
@@ -1871,7 +1871,7 @@
if (resume_time != INVALID_TIMESTAMP)
settings.resume_time = resume_time;
- osd_backlight_on_video_mode(false);
+ osdbacklight_hw_on_video_mode(false);
osd_backlight_brightness_video_mode(false);
}
diff --git a/bootloader/gigabeat.c b/bootloader/gigabeat.c
index 4d52407..a79454b 100644
--- a/bootloader/gigabeat.c
+++ b/bootloader/gigabeat.c
@@ -63,7 +63,7 @@
ata_sleepnow();
}
- _backlight_off();
+ backlight_hw_off();
power_off();
}
diff --git a/bootloader/iaudio_coldfire.c b/bootloader/iaudio_coldfire.c
index 953e649..c79ab4b 100644
--- a/bootloader/iaudio_coldfire.c
+++ b/bootloader/iaudio_coldfire.c
@@ -98,9 +98,9 @@
sleep(HZ*2);
/* Backlight OFF */
- _backlight_off();
+ backlight_hw_off();
#ifdef HAVE_REMOTE_LCD
- _remote_backlight_off();
+ remote_backlight_hw_off();
#endif
__reset_cookie();
diff --git a/bootloader/imx233.c b/bootloader/imx233.c
index 65799de..efe19bf 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -217,9 +217,9 @@
system_prepare_fw_start();
/* 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
- * _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
- _backlight_off();
+ backlight_hw_off();
#endif
disable_interrupt(IRQ_FIQ_STATUS);
commit_discard_idcache();
diff --git a/bootloader/iriver_h1x0.c b/bootloader/iriver_h1x0.c
index 742d0dd..8fd95d0 100644
--- a/bootloader/iriver_h1x0.c
+++ b/bootloader/iriver_h1x0.c
@@ -158,9 +158,9 @@
sleep(HZ*2);
/* Backlight OFF */
- _backlight_off();
+ backlight_hw_off();
#ifdef HAVE_REMOTE_LCD
- _remote_backlight_off();
+ remote_backlight_hw_off();
#endif
__reset_cookie();
@@ -418,12 +418,12 @@
__uda1380_reset_hi();
/* Start with the main backlight OFF. */
- _backlight_init();
- _backlight_off();
+ backlight_hw_init();
+ backlight_hw_off();
/* Remote backlight ON */
#ifdef HAVE_REMOTE_LCD
- _remote_backlight_on();
+ remote_backlight_hw_on();
#endif
system_init();
@@ -576,7 +576,7 @@
sleep(HZ);
/* Backlight OFF */
- _backlight_off();
+ backlight_hw_off();
}
cpu_idle_mode(false);
diff --git a/bootloader/iriver_h300.c b/bootloader/iriver_h300.c
index 100e660..ca5c630 100644
--- a/bootloader/iriver_h300.c
+++ b/bootloader/iriver_h300.c
@@ -102,8 +102,8 @@
sleep(HZ*2);
- _backlight_off();
- _remote_backlight_off();
+ backlight_hw_off();
+ remote_backlight_hw_off();
__reset_cookie();
power_off();
@@ -184,10 +184,10 @@
restore_irq(mask);
/* Start with the main backlight OFF. */
- _backlight_init();
- _backlight_off();
+ backlight_hw_init();
+ backlight_hw_off();
- _remote_backlight_on();
+ remote_backlight_hw_on();
system_init();
kernel_init();
diff --git a/bootloader/main-e200r-installer.c b/bootloader/main-e200r-installer.c
index c5751d3..5d1bff7 100644
--- a/bootloader/main-e200r-installer.c
+++ b/bootloader/main-e200r-installer.c
@@ -101,7 +101,7 @@
font_init();
button_init();
i2c_init();
- _backlight_on();
+ backlight_hw_on();
lcd_set_foreground(LCD_WHITE);
lcd_set_background(LCD_BLACK);
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 562cf17..07da640 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -320,7 +320,7 @@
#endif
#if defined(SANSA_E200) || defined(PHILIPS_SA9200)
i2c_init();
- _backlight_on();
+ backlight_hw_on();
#endif
if (button_hold())
diff --git a/bootloader/main-ppsansawipe.c b/bootloader/main-ppsansawipe.c
index 88f7229..d85a228 100644
--- a/bootloader/main-ppsansawipe.c
+++ b/bootloader/main-ppsansawipe.c
@@ -181,7 +181,7 @@
font_init();
button_init();
i2c_init();
- _backlight_on();
+ backlight_hw_on();
lcd_set_foreground(LCD_WHITE);
lcd_set_background(LCD_BLACK);
diff --git a/bootloader/meizu_m3.c b/bootloader/meizu_m3.c
index 936d3ac..cefb186 100644
--- a/bootloader/meizu_m3.c
+++ b/bootloader/meizu_m3.c
@@ -176,7 +176,7 @@
| QT1106_DI | QT1106_SLD_SLIDER | QT1106_RES_256);
snprintf(mystring, 64, "%x %2.2x",(slider & 0x008000)>>15, slider&0xff);
lcd_puts(0,1,mystring);
- _backlight_set_brightness((slider & 0xFF) >> 4);
+ backlight_hw_brightness((slider & 0xFF) >> 4);
/*
if(slider & 0x008000)
diff --git a/bootloader/mpio_hd200_hd300.c b/bootloader/mpio_hd200_hd300.c
index e66732f..3d821ca 100644
--- a/bootloader/mpio_hd200_hd300.c
+++ b/bootloader/mpio_hd200_hd300.c
@@ -150,7 +150,7 @@
}
/* Backlight OFF */
- _backlight_off();
+ backlight_hw_off();
__reset_cookie();
power_off();
@@ -372,7 +372,7 @@
cpu_idle_mode(true);
/* lowlevel init only */
- _backlight_init();
+ backlight_hw_init();
/* Handle wakeup event. Possibilities are:
* RTC alarm (HD300)
diff --git a/bootloader/samsung_yps3.c b/bootloader/samsung_yps3.c
index 927cd6e..9a09b11 100644
--- a/bootloader/samsung_yps3.c
+++ b/bootloader/samsung_yps3.c
@@ -114,7 +114,7 @@
i2c_init();
fmradio_i2c_init();
adc_init();
- _backlight_init();
+ backlight_hw_init();
button_init_device();
// FM power
@@ -259,13 +259,13 @@
if (button & BUTTON_MENU) {
if (brightness < MAX_BRIGHTNESS_SETTING) {
brightness++;
- _backlight_set_brightness(brightness);
+ backlight_hw_brightness(brightness);
}
}
else if (button & BUTTON_BACK) {
if (brightness > MIN_BRIGHTNESS_SETTING) {
brightness--;
- _backlight_set_brightness(brightness);
+ backlight_hw_brightness(brightness);
}
}
snprintf(mystring, 64, "brightness %3d", brightness);
diff --git a/bootloader/sansaview.c b/bootloader/sansaview.c
index 03e24b8..7ea4b59 100644
--- a/bootloader/sansaview.c
+++ b/bootloader/sansaview.c
@@ -54,11 +54,11 @@
while(1)
{
- _backlight_on();
- _buttonlight_off();
+ backlight_hw_on();
+ buttonlight_hw_off();
sleep(HZ/4);
- _backlight_off();
- _buttonlight_on();
+ backlight_hw_off();
+ buttonlight_hw_on();
sleep(HZ/4);
}
}
diff --git a/bootloader/telechips.c b/bootloader/telechips.c
index d2cf10e..879e72a 100644
--- a/bootloader/telechips.c
+++ b/bootloader/telechips.c
@@ -82,10 +82,10 @@
}
#if 0
if (button & BUTTON_SELECT){
- _backlight_off();
+ backlight_hw_off();
}
else{
- _backlight_on();
+ backlight_hw_on();
}
#endif
printf("Btn: 0x%08x",button);
@@ -147,7 +147,7 @@
show_logo();
- _backlight_on();
+ backlight_hw_on();
/* Only load the firmware if TCCBOOT is defined - this ensures SDRAM_START is
available for loading the firmware. Otherwise display the debug screen. */
diff --git a/firmware/backlight-sw-fading.c b/firmware/backlight-sw-fading.c
index 2aff2f9..c336d40 100644
--- a/firmware/backlight-sw-fading.c
+++ b/firmware/backlight-sw-fading.c
@@ -28,7 +28,7 @@
#include "backlight-sw-fading.h"
/* 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)
* add proper #defines for software fading
*/
@@ -46,7 +46,7 @@
{
if (LIKELY(current_brightness < backlight_brightness))
{
- _backlight_set_brightness(++current_brightness);
+ backlight_hw_brightness(++current_brightness);
}
return(current_brightness >= backlight_brightness);
}
@@ -56,14 +56,14 @@
{
if (LIKELY(current_brightness > MIN_BRIGHTNESS_SETTING))
{
- _backlight_set_brightness(--current_brightness);
+ backlight_hw_brightness(--current_brightness);
return false;
}
else
{
/* decrement once more, since backlight is off */
current_brightness--;
- _backlight_off();
+ backlight_hw_off();
return true;
}
}
diff --git a/firmware/backlight.c b/firmware/backlight.c
index d24fc13..d6dbf3e 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -126,10 +126,10 @@
if (buttonlight_timer < 0)
{
buttonlight_timer = 0; /* Disable the timeout */
- _buttonlight_off();
+ buttonlight_hw_off();
}
else
- _buttonlight_on();
+ buttonlight_hw_on();
}
/* external interface */
@@ -421,7 +421,7 @@
if (backlight_fading_state == NOT_FADING)
{
/* make sure the backlight is at lowest level */
- _backlight_on();
+ backlight_hw_on();
}
backlight_fading_state = FADING_UP;
}
@@ -429,8 +429,8 @@
{
backlight_fading_state = NOT_FADING;
_backlight_fade_update_state(backlight_brightness);
- _backlight_on();
- _backlight_set_brightness(backlight_brightness);
+ backlight_hw_on();
+ backlight_hw_brightness(backlight_brightness);
}
}
@@ -444,11 +444,11 @@
{
backlight_fading_state = NOT_FADING;
_backlight_fade_update_state(MIN_BRIGHTNESS_SETTING-1);
- _backlight_off();
+ backlight_hw_off();
#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG)
/* write the lowest brightness level to the hardware so that
* fading up is glitch free */
- _backlight_set_brightness(MIN_BRIGHTNESS_SETTING);
+ backlight_hw_brightness(MIN_BRIGHTNESS_SETTING);
#endif
#ifdef HAVE_LCD_SLEEP
backlight_lcd_sleep_countdown(true);
@@ -463,7 +463,7 @@
#if BACKLIGHT_FADE_IN_THREAD
backlight_setup_fade_down();
#else
- _backlight_off();
+ backlight_hw_off();
/* targets that have fading need to start the countdown when done with
* fading */
#ifdef HAVE_LCD_SLEEP
@@ -500,7 +500,7 @@
#if BACKLIGHT_FADE_IN_THREAD
backlight_setup_fade_up();
#else
- _backlight_on();
+ backlight_hw_on();
#endif
}
}
@@ -514,12 +514,12 @@
if (timeout < 0)
{
remote_backlight_timer = 0; /* Disable the timeout */
- _remote_backlight_off();
+ remote_backlight_hw_off();
}
else
{
remote_backlight_timer = timeout;
- _remote_backlight_on();
+ remote_backlight_hw_on();
}
}
#endif /* HAVE_REMOTE_LCD */
@@ -596,7 +596,7 @@
case REMOTE_BACKLIGHT_OFF:
remote_backlight_timer = 0; /* Disable the timeout */
- _remote_backlight_off();
+ remote_backlight_hw_off();
break;
#endif /* HAVE_REMOTE_LCD */
@@ -611,7 +611,7 @@
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
case BACKLIGHT_BRIGHTNESS_CHANGED:
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) \
|| (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG)
/* receive backlight brightness */
@@ -632,11 +632,11 @@
case BUTTON_LIGHT_OFF:
buttonlight_timer = 0;
- _buttonlight_off();
+ buttonlight_hw_off();
break;
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
case BUTTON_LIGHT_BRIGHTNESS_CHANGED:
- _buttonlight_set_brightness((int)ev.data);
+ buttonlight_hw_brightness((int)ev.data);
break;
#endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */
#endif /* HAVE_BUTTON_LIGHT */
@@ -703,7 +703,7 @@
remote_backlight_timer -= BACKLIGHT_THREAD_TIMEOUT;
if(remote_backlight_timer <= 0)
{
- _remote_backlight_off();
+ remote_backlight_hw_off();
}
}
#endif /* HAVE_REMOVE_LCD */
@@ -713,7 +713,7 @@
buttonlight_timer -= BACKLIGHT_THREAD_TIMEOUT;
if (buttonlight_timer <= 0)
{
- _buttonlight_off();
+ buttonlight_hw_off();
}
}
#endif /* HAVE_BUTTON_LIGHT */
@@ -723,7 +723,7 @@
{
queue_init(&backlight_queue, true);
- if (_backlight_init())
+ if (backlight_hw_init())
{
#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM)
/* If backlight is already on, don't fade in. */
@@ -962,8 +962,8 @@
#if defined(HAVE_BACKLIGHT) && !defined(BACKLIGHT_FULL_INIT)
void backlight_init(void)
{
- (void)_backlight_init();
- _backlight_on();
+ (void)backlight_hw_init();
+ backlight_hw_on();
}
#endif
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h
index ceeb979..40efd63 100644
--- a/firmware/export/backlight.h
+++ b/firmware/export/backlight.h
@@ -65,8 +65,8 @@
#endif /* !HAVE_BACKLIGHT */
#ifdef HAVE_REMOTE_LCD
-void _remote_backlight_on(void);
-void _remote_backlight_off(void);
+void remote_backlight_hw_on(void);
+void remote_backlight_hw_off(void);
void remote_backlight_on(void);
void remote_backlight_off(void);
void remote_backlight_set_timeout(int value);
diff --git a/firmware/target/arm/as3525/backlight-e200v2-fuze.c b/firmware/target/arm/as3525/backlight-e200v2-fuze.c
index 91e1ef4..26602fc 100644
--- a/firmware/target/arm/as3525/backlight-e200v2-fuze.c
+++ b/firmware/target/arm/as3525/backlight-e200v2-fuze.c
@@ -28,12 +28,12 @@
int buttonlight_is_on = 0;
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
ascodec_write(AS3514_DCDC15, brightness);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -45,7 +45,7 @@
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
ascodec_write(AS3514_DCDC15, 0x0);
#ifdef HAVE_LCD_ENABLE
@@ -53,7 +53,7 @@
#endif
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
/* Needed for buttonlight and MicroSD to work at the same time */
/* Turn ROD control on, as the OF does */
@@ -63,7 +63,7 @@
buttonlight_is_on = 1;
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
/* Needed for buttonlight and MicroSD to work at the same time */
/* Turn ROD control off, as the OF does */
diff --git a/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c b/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
index 1da57de..6344eff 100644
--- a/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
+++ b/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
@@ -98,7 +98,7 @@
}
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
GPIOA_DIR |= 1<<5;
if (c200v2_variant == 1) {
@@ -109,14 +109,14 @@
return true;
}
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
backlight_level = brightness_table[brightness];
if (brightness > 0)
- _backlight_on();
+ backlight_hw_on();
else
- _backlight_off();
+ backlight_hw_off();
}
static void _pwm_on(void)
@@ -130,7 +130,7 @@
_set_timer2_pwm_ratio(0);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
if (backlight_is_on == 1) {
/* Update pwm ratio in case user changed the brightness */
@@ -146,7 +146,7 @@
backlight_is_on = 1;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
if (backlight_is_on == 0)
return;
@@ -159,7 +159,7 @@
#endif
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
if (buttonlight_is_on == 1)
return;
@@ -169,7 +169,7 @@
buttonlight_is_on = 1;
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (buttonlight_is_on == 0)
return;
diff --git a/firmware/target/arm/as3525/sansa-c200v2/backlight-target.h b/firmware/target/arm/as3525/sansa-c200v2/backlight-target.h
index 4a098f7..a6b07de 100644
--- a/firmware/target/arm/as3525/sansa-c200v2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-c200v2/backlight-target.h
@@ -23,22 +23,22 @@
#include <stdbool.h>
-bool _backlight_init(void);
+bool backlight_hw_init(void);
void _backlight_pwm(int on);
-void _backlight_on(void);
-void _backlight_off(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
static inline void _backlight_panic_on(void)
{
- _backlight_on();
+ backlight_hw_on();
_backlight_pwm(1);
}
-void _backlight_set_brightness(int brightness);
+void backlight_hw_brightness(int brightness);
int __backlight_is_on(void);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
/*
* FIXME: This may be better off in kernel.h, but...
diff --git a/firmware/target/arm/as3525/sansa-clip/backlight-target.h b/firmware/target/arm/as3525/sansa-clip/backlight-target.h
index 00c6e5c..669f0f5 100644
--- a/firmware/target/arm/as3525/sansa-clip/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clip/backlight-target.h
@@ -25,30 +25,30 @@
#include "lcd.h"
#include "backlight.h"
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
lcd_enable(true);
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
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 */
return true;
}
-static inline void _buttonlight_on(void)
+static inline void buttonlight_hw_on(void)
{
GPIOD_PIN(7) = (1<<7);
}
-static inline void _buttonlight_off(void)
+static inline void buttonlight_hw_off(void)
{
GPIOD_PIN(7) = 0;
}
diff --git a/firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c b/firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c
index e3b518b..76df12c 100644
--- a/firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c
+++ b/firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c
@@ -24,13 +24,13 @@
#include "as3525v2.h"
#include "ascodec.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x90);
lcd_enable(true);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
lcd_enable(false);
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x00);
diff --git a/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h b/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h
index 3dd9240..9e8ff1c 100644
--- a/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h
@@ -21,10 +21,10 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
+#define backlight_hw_init() true
-void _backlight_on(void);
-void _backlight_off(void);
-#define _backlight_panic_on() _backlight_on()
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+#define _backlight_panic_on() backlight_hw_on()
#endif
diff --git a/firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c b/firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c
index f4927ba..65f69e8 100644
--- a/firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c
+++ b/firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c
@@ -24,13 +24,13 @@
#include "as3525v2.h"
#include "ascodec.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x90);
lcd_enable(true);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
lcd_enable(false);
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x0);
diff --git a/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h b/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
index b2da63d..800b26d 100644
--- a/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
@@ -24,22 +24,22 @@
#include <stdbool.h>
#include "cpu.h"
-void _backlight_on(void);
-void _backlight_off(void);
-#define _backlight_panic_on() _backlight_on()
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+#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 */
return true;
}
-static inline void _buttonlight_on(void)
+static inline void buttonlight_hw_on(void)
{
GPIOA_PIN(5) = 1<<5;
}
-static inline void _buttonlight_off(void)
+static inline void buttonlight_hw_off(void)
{
GPIOA_PIN(5) = 0;
}
diff --git a/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c
index a47941b..9fde68d 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c
@@ -27,12 +27,12 @@
#include "ascodec.h"
#include "lcd-target.h"
-bool _backlight_init()
+bool backlight_hw_init()
{
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
/* GPIO B1 controls backlight */
GPIOB_DIR |= (1 << 1);
@@ -43,7 +43,7 @@
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(false);
@@ -52,7 +52,7 @@
GPIOB_PIN(1) = 0;
}
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
oled_brightness(brightness);
}
diff --git a/firmware/target/arm/as3525/sansa-clipzip/backlight-target.h b/firmware/target/arm/as3525/sansa-clipzip/backlight-target.h
index bf58973..00b925c 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clipzip/backlight-target.h
@@ -21,11 +21,11 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
-#define _backlight_panic_on() _backlight_on()
+#define _backlight_panic_on() backlight_hw_on()
#endif
diff --git a/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h b/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h
index 227a154..0baaf24 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h
@@ -21,13 +21,13 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
-#define _backlight_panic_on() _backlight_on()
-void _backlight_set_brightness(int brightness);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+#define _backlight_panic_on() backlight_hw_on()
+void backlight_hw_brightness(int brightness);
int __backlight_is_on(void);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/as3525/sansa-fuze/backlight-target.h b/firmware/target/arm/as3525/sansa-fuze/backlight-target.h
index df6df57..c4e95e9 100644
--- a/firmware/target/arm/as3525/sansa-fuze/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-fuze/backlight-target.h
@@ -21,13 +21,13 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
-#define _backlight_panic_on() _backlight_on()
-void _backlight_set_brightness(int brightness);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+#define _backlight_panic_on() backlight_hw_on()
+void backlight_hw_brightness(int brightness);
#ifdef HAVE_BUTTON_LIGHT
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif
#endif
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
index a01b168..71f0c1a 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
+++ b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
@@ -26,12 +26,12 @@
#include "ascodec.h"
#include "as3514.h"
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
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, 2, backlight_brightness * 10);
@@ -49,7 +49,7 @@
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -57,7 +57,7 @@
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x0);
#ifdef HAVE_LCD_ENABLE
@@ -65,7 +65,7 @@
#endif
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
if (amsv2_variant == 0)
{
@@ -77,7 +77,7 @@
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (amsv2_variant == 0)
{
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h b/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h
index f9d7005..4138ef7 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h
@@ -25,13 +25,13 @@
#include "config.h"
#include "ascodec.h"
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-#define _backlight_panic_on() _backlight_on()
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+#define _backlight_panic_on() backlight_hw_on()
+void backlight_hw_brightness(int brightness);
#ifdef HAVE_BUTTON_LIGHT
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif
#endif
diff --git a/firmware/target/arm/as3525/sansa-m200v4/backlight-target.h b/firmware/target/arm/as3525/sansa-m200v4/backlight-target.h
index b5560bd..f3ef109 100644
--- a/firmware/target/arm/as3525/sansa-m200v4/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-m200v4/backlight-target.h
@@ -21,22 +21,22 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-static inline bool _backlight_init(void)
+static inline bool backlight_hw_init(void)
{
GPIOD_DIR |= (1<<1);
return true;
}
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
GPIOD_PIN(1) = (1<<1);
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
GPIOD_PIN(1) = 0x00;
}
-#define _backlight_panic_on() _backlight_on()
+#define _backlight_panic_on() backlight_hw_on()
#endif
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index ead40ea..4530d5d 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -969,7 +969,7 @@
if (buttonlight_is_on)
GPIOD_DIR &= ~(1<<7);
else
- _buttonlight_off();
+ buttonlight_hw_off();
#endif
#if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE)
@@ -993,7 +993,7 @@
#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE)
bitmod32(&CCU_IO, 0<<2, 3<<2); /* XPD is general purpose IO (b3:2 = 00) */
if (buttonlight_is_on)
- _buttonlight_on();
+ buttonlight_hw_on();
#endif
}
}
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index f128ef6..51b6755 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -360,7 +360,7 @@
void system_reboot(void)
{
- _backlight_off();
+ backlight_hw_off();
disable_irq();
diff --git a/firmware/target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c
index fabf8aa..b604494 100644
--- a/firmware/target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c
+++ b/firmware/target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c
@@ -19,27 +19,27 @@
*
****************************************************************************/
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int 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)
{
}
diff --git a/firmware/target/arm/imx233/creative-zen/backlight-target.h b/firmware/target/arm/imx233/creative-zen/backlight-target.h
index 78a0a72..60a2fbe 100644
--- a/firmware/target/arm/imx233/creative-zen/backlight-target.h
+++ b/firmware/target/arm/imx233/creative-zen/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/arm/imx233/creative-zen/backlight-zen.c b/firmware/target/arm/imx233/creative-zen/backlight-zen.c
index 6d16281..ef2ab61 100644
--- a/firmware/target/arm/imx233/creative-zen/backlight-zen.c
+++ b/firmware/target/arm/imx233/creative-zen/backlight-zen.c
@@ -28,7 +28,7 @@
#include "pinctrl-imx233.h"
#include "pwm-imx233.h"
-void _backlight_set_brightness(int level)
+void backlight_hw_brightness(int level)
{
#if defined(CREATIVE_ZENXFISTYLE)
imx233_pwm_setup_simple(4, 24000, level);
@@ -49,7 +49,7 @@
#endif
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
#if !defined(CREATIVE_ZENV) && !defined(CREATIVE_ZENXFISTYLE)
imx233_pinctrl_acquire(1, 12, "backlight_enable");
@@ -60,19 +60,19 @@
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
#endif
/* 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 */
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/backlight-target.h b/firmware/target/arm/imx233/creative-zenxfi2/backlight-target.h
index e376696..483272f 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/backlight-target.h
+++ b/firmware/target/arm/imx233/creative-zenxfi2/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c
index b01dc36..02e7a0f 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c
+++ b/firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c
@@ -26,19 +26,19 @@
#include "backlight-target.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_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;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -46,10 +46,10 @@
/* 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 */
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/backlight-target.h b/firmware/target/arm/imx233/creative-zenxfi3/backlight-target.h
index c7508c8..edc67ba 100644
--- a/firmware/target/arm/imx233/creative-zenxfi3/backlight-target.h
+++ b/firmware/target/arm/imx233/creative-zenxfi3/backlight-target.h
@@ -21,13 +21,13 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
-void _buttonlight_set_brightness(int brightness);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
+void buttonlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/backlight-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/backlight-zenxfi3.c
index 7013696..2b77a4d 100644
--- a/firmware/target/arm/imx233/creative-zenxfi3/backlight-zenxfi3.c
+++ b/firmware/target/arm/imx233/creative-zenxfi3/backlight-zenxfi3.c
@@ -27,19 +27,19 @@
#include "pwm-imx233.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_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;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -47,29 +47,29 @@
/* 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 */
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
}
/* ELE8 is the button light GPIO */
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
/* assume mpr121 was initialized by button-zenxfi3.c */
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 */
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 */
/* since backlight brightness is the same for the screen and the button light,
diff --git a/firmware/target/arm/imx233/samsung-ypz5/backlight-target.h b/firmware/target/arm/imx233/samsung-ypz5/backlight-target.h
index 5fa2ed3..e26f838 100644
--- a/firmware/target/arm/imx233/samsung-ypz5/backlight-target.h
+++ b/firmware/target/arm/imx233/samsung-ypz5/backlight-target.h
@@ -20,9 +20,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c b/firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c
index 27a7ece..b02c3a1 100644
--- a/firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c
+++ b/firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c
@@ -77,7 +77,7 @@
udelay(TIME_LAT);
}
-void _backlight_set_brightness(int level)
+void backlight_hw_brightness(int level)
{
/* Don't try to reset backlight if not necessary
* Moreover this helps to avoid flickering when
@@ -120,7 +120,7 @@
current_level = level;
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
imx233_pinctrl_acquire(3, 13, "backlight");
imx233_pinctrl_set_function(3, 13, PINCTRL_FUNCTION_GPIO);
@@ -130,19 +130,19 @@
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
#endif
/* 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 */
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c
index 3ee9d09..f87dbdd 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c
@@ -26,7 +26,7 @@
#include "backlight-target.h"
#include "pinctrl-imx233.h"
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
if(brightness != 0)
brightness = MAX_BRIGHTNESS_SETTING + 1 - brightness;
@@ -39,17 +39,17 @@
}
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
imx233_pinctrl_acquire(1, 28, "backlight");
imx233_pinctrl_set_function(1, 28, PINCTRL_FUNCTION_GPIO);
imx233_pinctrl_set_drive(1, 28, PINCTRL_DRIVE_8mA);
imx233_pinctrl_enable_gpio(1, 28, true);
- _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
+ backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -57,10 +57,10 @@
/* 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 */
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/backlight-target.h b/firmware/target/arm/imx233/sansa-fuzeplus/backlight-target.h
index e376696..483272f 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/backlight-target.h
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/arm/imx233/sony-nwz/backlight-nwz.c b/firmware/target/arm/imx233/sony-nwz/backlight-nwz.c
index d99d213..fecbeda 100644
--- a/firmware/target/arm/imx233/sony-nwz/backlight-nwz.c
+++ b/firmware/target/arm/imx233/sony-nwz/backlight-nwz.c
@@ -27,7 +27,7 @@
#include "pwm-imx233.h"
#include "pinctrl-imx233.h"
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
bool en = brightness > 0;
imx233_pwm_setup_simple(2, 24000, 100 - brightness);
@@ -35,17 +35,17 @@
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_set_function(0, 10, PINCTRL_FUNCTION_GPIO);
imx233_pinctrl_enable_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;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -53,10 +53,10 @@
/* 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 */
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
diff --git a/firmware/target/arm/imx233/sony-nwz/backlight-target.h b/firmware/target/arm/imx233/sony-nwz/backlight-target.h
index 78a0a72..60a2fbe 100644
--- a/firmware/target/arm/imx233/sony-nwz/backlight-target.h
+++ b/firmware/target/arm/imx233/sony-nwz/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/arm/imx233/system-imx233.c b/firmware/target/arm/imx233/system-imx233.c
index f34eab6..38865c4 100644
--- a/firmware/target/arm/imx233/system-imx233.c
+++ b/firmware/target/arm/imx233/system-imx233.c
@@ -105,7 +105,7 @@
void system_reboot(void)
{
- _backlight_off();
+ backlight_hw_off();
disable_irq();
@@ -119,8 +119,8 @@
imx233_rtc_enable_watchdog(false);
/* make sure lcd and backlight are on */
lcd_update();
- _backlight_on();
- _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
+ backlight_hw_on();
+ backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
/* wait until button release (if a button is pressed) */
#ifdef HAVE_BUTTON_DATA
int data;
diff --git a/firmware/target/arm/imx31/gigabeat-s/backlight-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/backlight-gigabeat-s.c
index 60fcb47..29d8980 100644
--- a/firmware/target/arm/imx31/gigabeat-s/backlight-gigabeat-s.c
+++ b/firmware/target/arm/imx31/gigabeat-s/backlight-gigabeat-s.c
@@ -79,7 +79,7 @@
/* Backlight ramping settings */
static uint32_t led_ramp_mask = MC13783_LEDMDRAMPDOWN | MC13783_LEDMDRAMPUP;
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
/* Set default LED register value */
mc13783_write(MC13783_LED_CONTROL0,
@@ -88,7 +88,7 @@
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
/* Our PWM and I-Level is different than retailos (but same apparent
* brightness), so init to our default. */
- _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
+ backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
#else
/* Use default PWM */
backlight_pwm_bits = mc13783_read(MC13783_LED_CONTROL2) & MC13783_LEDMDDC;
@@ -113,7 +113,7 @@
led_ramp_mask &= ~MC13783_LEDMDRAMPUP;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
static const char regs[2] =
{
@@ -149,7 +149,7 @@
}
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
uint32_t ctrl0 = MC13783_LED_CONTROL0_BITS | MC13783_LEDEN;
@@ -173,7 +173,7 @@
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
/* Assumes that the backlight has been initialized - parameter should
* 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;
backlight_pwm_bits = backlight_on_status ?
diff --git a/firmware/target/arm/imx31/gigabeat-s/backlight-target.h b/firmware/target/arm/imx31/gigabeat-s/backlight-target.h
index 2ae1372..124fa87 100644
--- a/firmware/target/arm/imx31/gigabeat-s/backlight-target.h
+++ b/firmware/target/arm/imx31/gigabeat-s/backlight-target.h
@@ -27,10 +27,10 @@
#define BACKLIGHT_FULL_INIT
#endif
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
void _backlight_lcd_sleep(void);
diff --git a/firmware/target/arm/imx31/gigabeat-s/power-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/power-gigabeat-s.c
index d194a69..5d89802 100644
--- a/firmware/target/arm/imx31/gigabeat-s/power-gigabeat-s.c
+++ b/firmware/target/arm/imx31/gigabeat-s/power-gigabeat-s.c
@@ -136,7 +136,7 @@
dptc_stop();
/* Cut backlight */
- _backlight_off();
+ backlight_hw_off();
/* Let it fade */
sleep(5*HZ/4);
diff --git a/firmware/target/arm/ipod/1g2g/backlight-1g2g.c b/firmware/target/arm/ipod/1g2g/backlight-1g2g.c
index b779781..7f1fa7b 100644
--- a/firmware/target/arm/ipod/1g2g/backlight-1g2g.c
+++ b/firmware/target/arm/ipod/1g2g/backlight-1g2g.c
@@ -24,13 +24,13 @@
#include "backlight.h"
#include "backlight-target.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
LCD1_CONTROL |= 0x02;
lcd_set_backlight_inversion(true);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
LCD1_CONTROL &= ~0x02;
lcd_set_backlight_inversion(false);
diff --git a/firmware/target/arm/ipod/1g2g/backlight-target.h b/firmware/target/arm/ipod/1g2g/backlight-target.h
index 2282605..e888aa7 100644
--- a/firmware/target/arm/ipod/1g2g/backlight-target.h
+++ b/firmware/target/arm/ipod/1g2g/backlight-target.h
@@ -21,8 +21,8 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() false
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() false
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/ipod/3g/backlight-3g.c b/firmware/target/arm/ipod/3g/backlight-3g.c
index 77088e3..fcc1623 100644
--- a/firmware/target/arm/ipod/3g/backlight-3g.c
+++ b/firmware/target/arm/ipod/3g/backlight-3g.c
@@ -23,12 +23,12 @@
#include "backlight.h"
#include "backlight-target.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
LCD1_CONTROL |= 0x02;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
LCD1_CONTROL &= ~0x02;
}
diff --git a/firmware/target/arm/ipod/backlight-4g_color.c b/firmware/target/arm/ipod/backlight-4g_color.c
index befb036..96ed387 100644
--- a/firmware/target/arm/ipod/backlight-4g_color.c
+++ b/firmware/target/arm/ipod/backlight-4g_color.c
@@ -44,11 +44,11 @@
static unsigned brightness = 100; /* 1 to 255 */
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
* latter. */
-void _backlight_on(void)
+void backlight_hw_on(void)
{
/* brightness full */
outl(0x80000000 | (brightness << 16), 0x7000a010);
@@ -56,27 +56,27 @@
enabled = true;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
outl(0x80000000, 0x7000a010);
GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x08);
enabled = false;
}
-void _backlight_set_brightness(int val)
+void backlight_hw_brightness(int val)
{
brightness = log_brightness[val];
if (enabled)
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_OUTPUT_VAL, 0x08); /* B03 = 1 */
GPO32_ENABLE &= ~0x2000000; /* D01 disable, so pwm takes over */
DEV_EN |= DEV_PWM; /* PWM enable */
- _backlight_on();
+ backlight_hw_on();
return true;
}
diff --git a/firmware/target/arm/ipod/backlight-nano_video.c b/firmware/target/arm/ipod/backlight-nano_video.c
index 2f56f94..e2e9bf0 100644
--- a/firmware/target/arm/ipod/backlight-nano_video.c
+++ b/firmware/target/arm/ipod/backlight-nano_video.c
@@ -38,7 +38,7 @@
static int current_dim = 16; /* default after enabling the backlight dimmer */
static bool enabled = false;
-void _backlight_set_brightness(int val)
+void backlight_hw_brightness(int val)
{
int oldlevel;
@@ -91,7 +91,7 @@
GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x80);
sleep(HZ/100);
current_dim = 16;
- _backlight_set_brightness(brightness);
+ backlight_hw_brightness(brightness);
}
else
{
@@ -116,7 +116,7 @@
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_OUTPUT_EN, 0x08);
diff --git a/firmware/target/arm/ipod/backlight-target.h b/firmware/target/arm/ipod/backlight-target.h
index 9b6a96b..fef7ee8 100644
--- a/firmware/target/arm/ipod/backlight-target.h
+++ b/firmware/target/arm/ipod/backlight-target.h
@@ -23,8 +23,8 @@
#if defined(IPOD_VIDEO) || defined(IPOD_NANO)
-bool _backlight_init(void);
-void _backlight_set_brightness(int val);
+bool backlight_hw_init(void);
+void backlight_hw_brightness(int val);
void _backlight_led_on(void);
void _backlight_led_off(void);
void _backlight_hw_enable(bool on);
@@ -34,48 +34,48 @@
#endif
#ifdef BOOTLOADER
-#define _backlight_on() do { _backlight_hw_enable(true); \
+#define backlight_hw_on() do { _backlight_hw_enable(true); \
_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)
#else /* !BOOTLOADER */
-#define _backlight_on_isr() _backlight_led_on()
-#define _backlight_off_isr() _backlight_led_off()
-#define _backlight_on_normal() do { _backlight_hw_enable(true); \
+#define backlight_hw_on_isr() _backlight_led_on()
+#define backlight_hw_off_isr() _backlight_led_off()
+#define backlight_hw_on_normal() do { _backlight_hw_enable(true); \
_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)
#define _BACKLIGHT_FADE_ENABLE
#endif /* !BOOTLOADER */
#elif defined(IPOD_4G) || defined(IPOD_COLOR)
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int val);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int val);
#elif defined(IPOD_MINI) || defined(IPOD_MINI2G)
-#define _backlight_init() true
+#define backlight_hw_init() true
void _backlight_hw_on(void);
void _backlight_hw_off(void);
#ifdef BOOTLOADER
-#define _backlight_on() _backlight_hw_on()
-#define _backlight_off() _backlight_hw_off()
+#define backlight_hw_on() _backlight_hw_on()
+#define backlight_hw_off() _backlight_hw_off()
#else
-#define _backlight_on_isr() _backlight_hw_on()
-#define _backlight_off_isr() _backlight_hw_off()
-#define _backlight_on_normal() _backlight_hw_on()
-#define _backlight_off_normal() _backlight_hw_off()
+#define backlight_hw_on_isr() _backlight_hw_on()
+#define backlight_hw_off_isr() _backlight_hw_off()
+#define backlight_hw_on_normal() _backlight_hw_on()
+#define backlight_hw_off_normal() _backlight_hw_off()
#endif
#elif defined(IPOD_1G2G) || defined(IPOD_3G)
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#endif
#endif
diff --git a/firmware/target/arm/ipod/button-1g-3g.c b/firmware/target/arm/ipod/button-1g-3g.c
index 045a0f6..67aa7eb 100644
--- a/firmware/target/arm/ipod/button-1g-3g.c
+++ b/firmware/target/arm/ipod/button-1g-3g.c
@@ -66,7 +66,7 @@
static int prev_scroll = -1;
static int direction = 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 wheel_delta = 1ul << 24;
@@ -96,10 +96,10 @@
}
/* 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();
reset_poweroff_timer();
- next_backlight_on = current_tick + HZ/4;
+ nextbacklight_hw_on = current_tick + HZ/4;
}
/* has wheel travelled far enough? */
@@ -152,7 +152,7 @@
wheel_velocity = v;
/* ensure backlight never gets stuck for an extended period if tick
* wrapped such that next poke is very far ahead */
- next_backlight_on = current_tick - 1;
+ nextbacklight_hw_on = current_tick - 1;
}
else {
/* some velocity filtering to smooth things out */
diff --git a/firmware/target/arm/ipod/button-mini1g.c b/firmware/target/arm/ipod/button-mini1g.c
index d4a75c9..a508958 100644
--- a/firmware/target/arm/ipod/button-mini1g.c
+++ b/firmware/target/arm/ipod/button-mini1g.c
@@ -60,7 +60,7 @@
static int prev_scroll = -1;
static int direction = 0;
static int count = 0;
- static long next_backlight_on = 0;
+ static long nextbacklight_hw_on = 0;
int wheel_keycode = BUTTON_NONE;
int scroll;
@@ -92,10 +92,10 @@
}
/* 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();
reset_poweroff_timer();
- next_backlight_on = current_tick + HZ/4;
+ nextbacklight_hw_on = current_tick + HZ/4;
}
if (++count < WHEEL_BASE_SENSITIVITY)
@@ -144,7 +144,7 @@
wheel_velocity = v;
/* ensure backlight never gets stuck for an extended period if tick
* wrapped such that next poke is very far ahead */
- next_backlight_on = current_tick - 1;
+ nextbacklight_hw_on = current_tick - 1;
}
else {
/* some velocity filtering to smooth things out */
diff --git a/firmware/target/arm/ipod/lcd-color_nano.c b/firmware/target/arm/ipod/lcd-color_nano.c
index c7676fa..67d26aa 100644
--- a/firmware/target/arm/ipod/lcd-color_nano.c
+++ b/firmware/target/arm/ipod/lcd-color_nano.c
@@ -122,7 +122,7 @@
#if defined(IPOD_NANO)
_backlight_hw_enable(false);
#elif defined(IPOD_COLOR)
- _backlight_off();
+ backlight_hw_off();
#endif
if ((lcd_type&1) == 0) {
diff --git a/firmware/target/arm/iriver/backlight-target.h b/firmware/target/arm/iriver/backlight-target.h
index a27b489..3882964 100644
--- a/firmware/target/arm/iriver/backlight-target.h
+++ b/firmware/target/arm/iriver/backlight-target.h
@@ -21,8 +21,8 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/iriver/h10/backlight-h10.c b/firmware/target/arm/iriver/h10/backlight-h10.c
index db10f39..80dfdd8 100644
--- a/firmware/target/arm/iriver/h10/backlight-h10.c
+++ b/firmware/target/arm/iriver/h10/backlight-h10.c
@@ -25,7 +25,7 @@
#include "backlight-target.h"
#include "lcd.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -33,7 +33,7 @@
GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x20);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL, 0x20);
#ifdef HAVE_LCD_ENABLE
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c
index f3891c5..b39010f 100644
--- a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c
@@ -28,22 +28,22 @@
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). */
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
return (GPO32_ENABLE & 0x1000000) ? true : false;
}
-void _backlight_hw_on(void)
+void backlight_hw_on(void)
{
GPO32_ENABLE |= 0x1000000;
}
-void _backlight_hw_off(void)
+void backlight_hw_off(void)
{
GPO32_ENABLE &= ~0x1000000;
}
-void _buttonlight_set_brightness(int brightness)
+void buttonlight_hw_brightness(int brightness)
{
/* clamp the brightness value */
brightness = MAX(0, MIN(15, brightness));
@@ -51,13 +51,13 @@
outl(MIN_BRIGHTNESS-(log_brightness[brightness - 1] << 16), 0x7000a010);
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
/* turn on all touchpad leds */
GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL;
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
/* turn off all touchpad leds */
GPIOA_OUTPUT_VAL &= ~BUTTONLIGHT_ALL;
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-target.h b/firmware/target/arm/olympus/mrobe-100/backlight-target.h
index df25106..725e1ad 100644
--- a/firmware/target/arm/olympus/mrobe-100/backlight-target.h
+++ b/firmware/target/arm/olympus/mrobe-100/backlight-target.h
@@ -22,23 +22,20 @@
#ifndef 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_off(void);
#ifdef HAVE_REMOTE_LCD
-void _remote_backlight_on(void);
-void _remote_backlight_off(void);
+void remote_backlight_hw_on(void);
+void remote_backlight_hw_off(void);
#endif
-#ifdef BOOTLOADER
-#define _backlight_on() _backlight_hw_on()
-#define _backlight_off() _backlight_hw_off()
-#else
-#define _backlight_on_isr() _backlight_hw_on()
-#define _backlight_off_isr() _backlight_hw_off()
-#define _backlight_on_normal() _backlight_hw_on()
-#define _backlight_off_normal() _backlight_hw_off()
+#ifndef BOOTLOADER
+#define _backlight_on_isr() backlight_hw_on()
+#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
#endif
@@ -53,8 +50,8 @@
BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \
BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL)
-void _buttonlight_set_brightness(int brightness);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_brightness(int brightness);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
index 34b1149..22bc4fb 100644
--- a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
@@ -552,13 +552,13 @@
rc_status |= RC_UPDATE_LCD;
}
-void _remote_backlight_on(void)
+void remote_backlight_hw_on(void)
{
rc_status |= RC_BACKLIGHT_ON;
rc_status |= RC_UPDATE_CONTROLLER;
}
-void _remote_backlight_off(void)
+void remote_backlight_hw_off(void)
{
rc_status &= ~RC_BACKLIGHT_ON;
rc_status |= RC_UPDATE_CONTROLLER;
diff --git a/firmware/target/arm/pbell/vibe500/backlight-target.h b/firmware/target/arm/pbell/vibe500/backlight-target.h
index 7fd6d87..396fea3 100644
--- a/firmware/target/arm/pbell/vibe500/backlight-target.h
+++ b/firmware/target/arm/pbell/vibe500/backlight-target.h
@@ -21,18 +21,18 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
-void _backlight_set_brightness(int brightness);
+void backlight_hw_brightness(int brightness);
#endif
#ifdef HAVE_BUTTON_LIGHT
-void _buttonlight_on(void);
-void _buttonlight_off(void);
-void _buttonlight_set_brightness(int brightness);
+voidbuttonlight_hw_on(void);
+voidbuttonlight_hw_off(void);
+voidbuttonlight_hw_set_brightness(int brightness);
#endif
#endif /* BACKLIGHT_TARGET.H */
diff --git a/firmware/target/arm/pbell/vibe500/backlight-vibe500.c b/firmware/target/arm/pbell/vibe500/backlight-vibe500.c
index ab71012..1d03ddd 100644
--- a/firmware/target/arm/pbell/vibe500/backlight-vibe500.c
+++ b/firmware/target/arm/pbell/vibe500/backlight-vibe500.c
@@ -27,7 +27,7 @@
#include "lcd.h"
#include "synaptics-mep.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -35,7 +35,7 @@
GPIO_SET_BITWISE(GPIOJ_OUTPUT_VAL, 0x01);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPIO_CLEAR_BITWISE(GPIOJ_OUTPUT_VAL, 0x01);
#ifdef HAVE_LCD_ENABLE
@@ -47,7 +47,7 @@
static const int brightness_vals[16] =
{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 */
DEV_INIT1&=0xFFFF3F3F;
@@ -60,7 +60,7 @@
#ifdef HAVE_BUTTON_LIGHT
static unsigned short buttonlight_status = 0;
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
if (!buttonlight_status)
{
@@ -69,7 +69,7 @@
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (buttonlight_status)
{
@@ -78,7 +78,7 @@
}
}
-void _buttonlight_set_brightness(int brightness)
+void buttonlight_hw_brightness(int brightness)
{
/* no brightness control, but lights stays on - for compatibility */
(void)brightness;
diff --git a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
index 95a9ad8..efa8572 100644
--- a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
+++ b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
@@ -29,13 +29,13 @@
static const int brightness_vals[16] =
{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);
}
#endif
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true);
@@ -45,7 +45,7 @@
GPO32_VAL |= 0x400;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPO32_ENABLE |= 0x400;
GPO32_VAL &=~0x400;
@@ -60,7 +60,7 @@
static unsigned short buttonight_brightness = DEFAULT_BRIGHTNESS_SETTING - 1;
static unsigned short buttonlight_status = 0;
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
if (!buttonlight_status)
{
@@ -69,7 +69,7 @@
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (buttonlight_status)
{
@@ -78,7 +78,7 @@
}
}
-void _buttonlight_set_brightness(int brightness)
+void buttonlight_hw_brightness(int brightness)
{
buttonight_brightness = brightness - 1;
touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness);
diff --git a/firmware/target/arm/philips/hdd1630/backlight-target.h b/firmware/target/arm/philips/hdd1630/backlight-target.h
index 63f3f5a..d79f09a 100644
--- a/firmware/target/arm/philips/hdd1630/backlight-target.h
+++ b/firmware/target/arm/philips/hdd1630/backlight-target.h
@@ -21,18 +21,18 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
-void _backlight_set_brightness(int brightness);
+void backlight_hw_brightness(int brightness);
#endif
#ifdef HAVE_BUTTON_LIGHT
-void _buttonlight_on(void);
-void _buttonlight_off(void);
-void _buttonlight_set_brightness(int brightness);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
+void buttonlight_hw_brightness(int brightness);
#endif
#endif
diff --git a/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c b/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c
index 46c03e7..b6422a5 100644
--- a/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c
+++ b/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c
@@ -29,13 +29,13 @@
static const int brightness_vals[16] =
{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);
}
#endif
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true);
@@ -45,7 +45,7 @@
GPO32_VAL |= 0x400;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPO32_ENABLE |= 0x400;
GPO32_VAL &= ~0x400;
@@ -60,7 +60,7 @@
static unsigned short buttonight_brightness = DEFAULT_BRIGHTNESS_SETTING - 1;
static unsigned short buttonlight_status = 0;
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
if (!buttonlight_status)
{
@@ -77,7 +77,7 @@
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (buttonlight_status)
{
@@ -89,7 +89,7 @@
}
}
-void _buttonlight_set_brightness(int brightness)
+void buttonlight_hw_brightness(int brightness)
{
touchpad_set_parameter(0x01,0x21,0x01);
touchpad_set_parameter(0x00,0x22,0x15);
diff --git a/firmware/target/arm/philips/hdd6330/backlight-target.h b/firmware/target/arm/philips/hdd6330/backlight-target.h
index 63f3f5a..d79f09a 100644
--- a/firmware/target/arm/philips/hdd6330/backlight-target.h
+++ b/firmware/target/arm/philips/hdd6330/backlight-target.h
@@ -21,18 +21,18 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
-void _backlight_set_brightness(int brightness);
+void backlight_hw_brightness(int brightness);
#endif
#ifdef HAVE_BUTTON_LIGHT
-void _buttonlight_on(void);
-void _buttonlight_off(void);
-void _buttonlight_set_brightness(int brightness);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
+void buttonlight_hw_brightness(int brightness);
#endif
#endif
diff --git a/firmware/target/arm/philips/power-hdd.c b/firmware/target/arm/philips/power-hdd.c
index a7f1302..d38c6de 100644
--- a/firmware/target/arm/philips/power-hdd.c
+++ b/firmware/target/arm/philips/power-hdd.c
@@ -111,7 +111,7 @@
void power_off(void)
{
- _backlight_off();
+ backlight_hw_off();
sleep(HZ/10);
/* power off bit */
diff --git a/firmware/target/arm/philips/sa9200/backlight-sa9200.c b/firmware/target/arm/philips/sa9200/backlight-sa9200.c
index 0de4c05..7046d09 100644
--- a/firmware/target/arm/philips/sa9200/backlight-sa9200.c
+++ b/firmware/target/arm/philips/sa9200/backlight-sa9200.c
@@ -27,12 +27,12 @@
#include "synaptics-mep.h"
#include "lcd.h"
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
ascodec_write(AS3514_DCDC15, brightness);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -40,13 +40,13 @@
#if (CONFIG_BACKLIGHT_FADING != BACKLIGHT_FADING_SW_SETTING) /* in bootloader/sim */
/* if we set the brightness to the settings value, then fading up
* is glitchy */
- _backlight_set_brightness(backlight_brightness);
+ backlight_hw_brightness(backlight_brightness);
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
@@ -58,7 +58,7 @@
#define BUTTONLIGHT_MAX 0x0f
static unsigned short buttonlight_status = 0;
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
if (!buttonlight_status)
{
@@ -68,7 +68,7 @@
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (buttonlight_status)
{
diff --git a/firmware/target/arm/philips/sa9200/backlight-target.h b/firmware/target/arm/philips/sa9200/backlight-target.h
index 9d695e5..349f2e2 100644
--- a/firmware/target/arm/philips/sa9200/backlight-target.h
+++ b/firmware/target/arm/philips/sa9200/backlight-target.h
@@ -21,15 +21,15 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
int __backlight_is_on(void);
#ifdef HAVE_BUTTON_LIGHT
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif
#endif
diff --git a/firmware/target/arm/pnx0101/backlight-target.h b/firmware/target/arm/pnx0101/backlight-target.h
index 40152f1..7ebe85d 100644
--- a/firmware/target/arm/pnx0101/backlight-target.h
+++ b/firmware/target/arm/pnx0101/backlight-target.h
@@ -21,8 +21,8 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/pnx0101/iriver-ifp7xx/backlight-ifp7xx.c b/firmware/target/arm/pnx0101/iriver-ifp7xx/backlight-ifp7xx.c
index 6cf2422..8be7a59 100644
--- a/firmware/target/arm/pnx0101/iriver-ifp7xx/backlight-ifp7xx.c
+++ b/firmware/target/arm/pnx0101/iriver-ifp7xx/backlight-ifp7xx.c
@@ -24,12 +24,12 @@
#include "backlight.h"
#include "lcd.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
GPIO3_SET = 1;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPIO3_CLR = 1;
}
diff --git a/firmware/target/arm/rk27xx/backlight-rk27xx.c b/firmware/target/arm/rk27xx/backlight-rk27xx.c
index 361d18c..1756fcd 100644
--- a/firmware/target/arm/rk27xx/backlight-rk27xx.c
+++ b/firmware/target/arm/rk27xx/backlight-rk27xx.c
@@ -77,7 +77,7 @@
};
#endif
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
/* configure PD4 as output */
GPIO_PDCON |= (1<<4);
@@ -105,7 +105,7 @@
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true);
@@ -120,7 +120,7 @@
PWMT0_CTRL |= (1<<3) | (1<<0);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
/* setup PWM0 pin as GPIO which is pulled low */
SCU_IOMUXB_CON &= ~(1<<11);
@@ -135,7 +135,7 @@
#endif
}
-void _backlight_set_brightness(int val)
+void backlight_hw_brightness(int val)
{
brightness = val & 0x1f;
PWMT0_HRC = lin_brightness[brightness];
diff --git a/firmware/target/arm/rk27xx/backlight-target.h b/firmware/target/arm/rk27xx/backlight-target.h
index 91579b0..a436186 100644
--- a/firmware/target/arm/rk27xx/backlight-target.h
+++ b/firmware/target/arm/rk27xx/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c
index f3d9aac..c30eb8d 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c
@@ -74,7 +74,7 @@
static unsigned short buttonlight_trigger_now;
/* 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 */
backlight_control = BACKLIGHT_CONTROL_IDLE;
@@ -335,7 +335,7 @@
backlight_control = BACKLIGHT_CONTROL_FADE;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -343,7 +343,7 @@
__backlight_dim(false);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
__backlight_dim(true);
}
@@ -373,12 +373,12 @@
buttonlight_control = BUTTONLIGHT_CONTROL_FADE;
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
__buttonlight_dim(false);
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
#ifndef BOOTLOADER
if(buttonlight_get_current_timeout() > 0)
@@ -388,7 +388,7 @@
__buttonlight_off();
}
-void _buttonlight_set_brightness(int brightness)
+void buttonlight_hw_brightness(int brightness)
{
/* stop the interrupt from messing us up */
buttonlight_control = BUTTONLIGHT_CONTROL_IDLE;
@@ -396,7 +396,7 @@
buttonlight_control = BUTTONLIGHT_CONTROL_SET;
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
unsigned char brightness = log_brightness[DEFAULT_BRIGHTNESS_SETTING];
buttonlight_brightness = brightness;
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h
index 8db2b11..ef30bab 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h
@@ -43,12 +43,12 @@
/* See enum buttonlight_mode for available functions */
void __buttonlight_mode(enum buttonlight_mode mode);
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
-void _buttonlight_set_brightness(int brightness);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_brightness(int brightness);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c
index ad9098d..e31a633 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c
@@ -81,8 +81,8 @@
int(*reboot_point)(void);
reboot_point=(void*)(unsigned char*) 0x00000000;
/* turn off backlight and wait for 1 second */
- _backlight_off();
- _buttonlight_off();
+ backlight_hw_off();
+ buttonlight_hw_off();
sleep(HZ);
/* Do this to allow the drive to properly reset when player restarts
diff --git a/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c b/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c
index b39bfc4..c4b93da 100644
--- a/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c
+++ b/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c
@@ -46,7 +46,7 @@
/* Assumes that the backlight has been initialized */
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
if (brightness < 0)
brightness = 0;
@@ -86,22 +86,22 @@
backlight_control = BACKLIGHT_CONTROL_IDLE;
break;
case BACKLIGHT_CONTROL_OFF:
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
backlight_control = BACKLIGHT_CONTROL_IDLE;
break;
case BACKLIGHT_CONTROL_ON:
- _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
+ backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
backlight_control = BACKLIGHT_CONTROL_IDLE;
break;
case BACKLIGHT_CONTROL_SET:
/* 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
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;
break;
case BACKLIGHT_CONTROL_FADE:
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
backlight_control = BACKLIGHT_CONTROL_IDLE;
break;
default:
@@ -127,7 +127,7 @@
backlight_control = BACKLIGHT_CONTROL_FADE;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -135,13 +135,13 @@
__backlight_dim(false);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
__backlight_dim(true);
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
unsigned char brightness = log_brightness[DEFAULT_BRIGHTNESS_SETTING];
_backlight_brightness = brightness;
diff --git a/firmware/target/arm/s3c2440/mini2440/backlight-target.h b/firmware/target/arm/s3c2440/mini2440/backlight-target.h
index c804f16..ceb6824 100644
--- a/firmware/target/arm/s3c2440/mini2440/backlight-target.h
+++ b/firmware/target/arm/s3c2440/mini2440/backlight-target.h
@@ -23,9 +23,9 @@
#define GPIO_LCD_PWR (1 << 4) /* GPIO.G4 */
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif
diff --git a/firmware/target/arm/s5l8700/backlight-meizu.c b/firmware/target/arm/s5l8700/backlight-meizu.c
index 4eb6967..d5c9a22 100644
--- a/firmware/target/arm/s5l8700/backlight-meizu.c
+++ b/firmware/target/arm/s5l8700/backlight-meizu.c
@@ -32,7 +32,7 @@
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 */
static const unsigned int logtable[] =
@@ -42,21 +42,21 @@
TCDATA0 = logtable[brightness];
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
/* configure backlight pin P0.2 as timer PWM output */
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 */
PCON0 = ((PCON0 & ~(3 << 4)) | (1 << 4));
PDAT0 &= ~(1 << 2);
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
/* enable timer clock */
PWRCON &= ~(1 << 4);
@@ -72,7 +72,7 @@
TCPRE = 20; /* prescaler */
TCCMD = (1 << 0); /* TC_EN */
- _backlight_on();
+ backlight_hw_on();
return true;
}
diff --git a/firmware/target/arm/s5l8700/backlight-target.h b/firmware/target/arm/s5l8700/backlight-target.h
index 91579b0..a436186 100644
--- a/firmware/target/arm/s5l8700/backlight-target.h
+++ b/firmware/target/arm/s5l8700/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/backlight-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/backlight-nano2g.c
index 3e0e746..b38e0f1 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/backlight-nano2g.c
+++ b/firmware/target/arm/s5l8700/ipodnano2g/backlight-nano2g.c
@@ -32,12 +32,12 @@
void lcd_update(void);
#endif
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
pmu_write(0x28, brightness);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_SLEEP
if (!lcd_active())
@@ -50,18 +50,18 @@
pmu_write(0x29, 1);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
pmu_write(0x29, 0);
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
pmu_write(0x2a, 6);
pmu_write(0x28, 0x2e);
pmu_write(0x2b, 20);
- _backlight_on();
+ backlight_hw_on();
return true;
}
diff --git a/firmware/target/arm/s5l8700/yps3/backlight-target.h b/firmware/target/arm/s5l8700/yps3/backlight-target.h
index 0507be4..74ea0aa 100644
--- a/firmware/target/arm/s5l8700/yps3/backlight-target.h
+++ b/firmware/target/arm/s5l8700/yps3/backlight-target.h
@@ -21,13 +21,13 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/arm/s5l8700/yps3/backlight-yps3.c b/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
index 7cf3a44..ae3cc3b 100644
--- a/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
+++ b/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
@@ -35,7 +35,7 @@
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 */
static const unsigned int logtable[] =
@@ -45,39 +45,39 @@
TADATA0 = logtable[brightness];
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
/* configure backlight pin P0.0 as timer PWM output */
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 */
PCON0 = ((PCON0 & ~(3 << 0)) | (1 << 0));
PDAT0 &= ~(1 << 0);
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
PDAT3 |= (3 << 2);
PDAT4 |= (1 << 2);
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
PDAT3 &= ~(3 << 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) */
PCON3 = (PCON3 & ~0x0000FF00) | 0x00001100;
PCON4 = (PCON4 & ~0x00000F00) | 0x00000100;
- _buttonlight_off();
+ buttonlight_hw_off();
/* enable timer clock */
PWRCON &= ~(1 << 4);
@@ -93,7 +93,7 @@
TAPRE = 20; /* prescaler */
TACMD = (1 << 0); /* TA_EN */
- _backlight_on();
+ backlight_hw_on();
return true;
}
diff --git a/firmware/target/arm/s5l8702/ipod6g/backlight-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/backlight-ipod6g.c
index 481a264..7d1c8bd 100644
--- a/firmware/target/arm/s5l8702/ipod6g/backlight-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/backlight-ipod6g.c
@@ -32,12 +32,12 @@
void lcd_update(void);
#endif
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
pmu_write(0x28, brightness);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_SLEEP
if (!lcd_active())
@@ -50,20 +50,20 @@
pmu_write(0x29, 1);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
pmu_write(0x29, 0);
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
/* LEDCTL: overvoltage protection enabled, OCP limit is 500mA */
pmu_write(0x2a, 0x05);
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;
}
diff --git a/firmware/target/arm/s5l8702/ipod6g/backlight-target.h b/firmware/target/arm/s5l8702/ipod6g/backlight-target.h
index 05a8add..21ff6c3 100644
--- a/firmware/target/arm/s5l8702/ipod6g/backlight-target.h
+++ b/firmware/target/arm/s5l8702/ipod6g/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif
diff --git a/firmware/target/arm/samsung/backlight-target.h b/firmware/target/arm/samsung/backlight-target.h
index a27b489..3882964 100644
--- a/firmware/target/arm/samsung/backlight-target.h
+++ b/firmware/target/arm/samsung/backlight-target.h
@@ -21,8 +21,8 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/samsung/yh820/backlight-yh820.c b/firmware/target/arm/samsung/yh820/backlight-yh820.c
index 0bbdb4f..b24f812 100644
--- a/firmware/target/arm/samsung/yh820/backlight-yh820.c
+++ b/firmware/target/arm/samsung/yh820/backlight-yh820.c
@@ -25,7 +25,7 @@
#include "backlight-target.h"
#include "lcd.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_SLEEP
backlight_lcd_sleep_countdown(false); /* stop counter */
@@ -36,7 +36,7 @@
GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x2);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x2);
#ifdef HAVE_LCD_ENABLE
diff --git a/firmware/target/arm/samsung/yh920/backlight-yh920.c b/firmware/target/arm/samsung/yh920/backlight-yh920.c
index 0bbdb4f..b24f812 100644
--- a/firmware/target/arm/samsung/yh920/backlight-yh920.c
+++ b/firmware/target/arm/samsung/yh920/backlight-yh920.c
@@ -25,7 +25,7 @@
#include "backlight-target.h"
#include "lcd.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_SLEEP
backlight_lcd_sleep_countdown(false); /* stop counter */
@@ -36,7 +36,7 @@
GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x2);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x2);
#ifdef HAVE_LCD_ENABLE
diff --git a/firmware/target/arm/samsung/yh925/backlight-yh925.c b/firmware/target/arm/samsung/yh925/backlight-yh925.c
index 5f29f9f..8eb287b 100644
--- a/firmware/target/arm/samsung/yh925/backlight-yh925.c
+++ b/firmware/target/arm/samsung/yh925/backlight-yh925.c
@@ -25,7 +25,7 @@
#include "backlight-target.h"
#include "lcd.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_SLEEP
backlight_lcd_sleep_countdown(false); /* stop counter */
@@ -36,7 +36,7 @@
GPIO_SET_BITWISE(GPIOF_OUTPUT_VAL, 0x1);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPIO_CLEAR_BITWISE(GPIOF_OUTPUT_VAL, 0x1);
#ifdef HAVE_LCD_ENABLE
diff --git a/firmware/target/arm/sandisk/backlight-c200_e200.c b/firmware/target/arm/sandisk/backlight-c200_e200.c
index 0280604..ad1a6d9 100644
--- a/firmware/target/arm/sandisk/backlight-c200_e200.c
+++ b/firmware/target/arm/sandisk/backlight-c200_e200.c
@@ -26,12 +26,12 @@
#include "ascodec.h"
#include "as3514.h"
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
ascodec_write(AS3514_DCDC15, brightness);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
@@ -39,19 +39,19 @@
#if (CONFIG_BACKLIGHT_FADING != BACKLIGHT_FADING_SW_SETTING) /* in bootloader/sim */
/* if we set the brightness to the settings value, then fading up
* is glitchy */
- _backlight_set_brightness(backlight_brightness);
+ backlight_hw_brightness(backlight_brightness);
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
GPIO_SET_BITWISE(GPIOG_OUTPUT_VAL, 0x80);
#ifdef SANSA_C200
@@ -59,7 +59,7 @@
#endif
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
GPIO_CLEAR_BITWISE(GPIOG_OUTPUT_VAL, 0x80);
#ifdef SANSA_C200
diff --git a/firmware/target/arm/sandisk/backlight-target.h b/firmware/target/arm/sandisk/backlight-target.h
index 1f5e475..cbe26f5 100644
--- a/firmware/target/arm/sandisk/backlight-target.h
+++ b/firmware/target/arm/sandisk/backlight-target.h
@@ -21,11 +21,11 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/sandisk/sansa-e200/button-e200.c b/firmware/target/arm/sandisk/sansa-e200/button-e200.c
index 73279b4..0df71f4 100644
--- a/firmware/target/arm/sandisk/sansa-e200/button-e200.c
+++ b/firmware/target/arm/sandisk/sansa-e200/button-e200.c
@@ -135,7 +135,7 @@
static int prev_keypost = BUTTON_NONE;
static int count = 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 delta = 1ul << 24;
@@ -166,11 +166,11 @@
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
* than every 1/4 second */
- next_backlight_on = current_tick + HZ/4;
+ nextbacklight_hw_on = current_tick + HZ/4;
backlight_on();
#ifdef HAVE_BUTTON_LIGHT
buttonlight_on();
@@ -209,7 +209,7 @@
velocity = v;
/* Ensure backlight never gets stuck for an extended period if tick
* wrapped such that next poke is very far ahead */
- next_backlight_on = current_tick - 1;
+ nextbacklight_hw_on = current_tick - 1;
}
else
{
diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-target.h b/firmware/target/arm/sandisk/sansa-view/backlight-target.h
index 545ee93..c518757 100644
--- a/firmware/target/arm/sandisk/sansa-view/backlight-target.h
+++ b/firmware/target/arm/sandisk/sansa-view/backlight-target.h
@@ -24,10 +24,10 @@
#include <stdbool.h>
-void _backlight_on(void);
-void _backlight_off(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+void buttonlight_hw_on(void);
+void buttonlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-view.c b/firmware/target/arm/sandisk/sansa-view/backlight-view.c
index c065ec3..637e5b4 100644
--- a/firmware/target/arm/sandisk/sansa-view/backlight-view.c
+++ b/firmware/target/arm/sandisk/sansa-view/backlight-view.c
@@ -25,7 +25,7 @@
#include "lcd.h"
#include "backlight.h"
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
GPIO_SET_BITWISE(GPIOD_ENABLE, 0x01);
GPIO_SET_BITWISE(GPIOD_OUTPUT_EN, 0x01);
@@ -44,22 +44,22 @@
return true;
}
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
(void)brightness;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x01);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
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, 0x01); /* horizontal buttonlight */
@@ -70,7 +70,7 @@
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, 0x01); /* horizontal buttonlight */
diff --git a/firmware/target/arm/tatung/tpj1022/backlight-target.h b/firmware/target/arm/tatung/tpj1022/backlight-target.h
index f82dc56..4a5e677 100644
--- a/firmware/target/arm/tatung/tpj1022/backlight-target.h
+++ b/firmware/target/arm/tatung/tpj1022/backlight-target.h
@@ -24,8 +24,8 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
-void _backlight_on(void);
-void _backlight_off(void);
+#define backlight_hw_init() true
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#endif
diff --git a/firmware/target/arm/tatung/tpj1022/backlight-tpj1022.c b/firmware/target/arm/tatung/tpj1022/backlight-tpj1022.c
index 87ec19f..d633877 100644
--- a/firmware/target/arm/tatung/tpj1022/backlight-tpj1022.c
+++ b/firmware/target/arm/tatung/tpj1022/backlight-tpj1022.c
@@ -27,7 +27,7 @@
#include "system.h"
#include "backlight.h"
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#if 0
int level = disable_irq_save();
@@ -36,7 +36,7 @@
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
#if 0
int level = disable_irq_save();
diff --git a/firmware/target/arm/tcc77x/c100/backlight-target.h b/firmware/target/arm/tcc77x/c100/backlight-target.h
index 738a2f8..7ae7102 100644
--- a/firmware/target/arm/tcc77x/c100/backlight-target.h
+++ b/firmware/target/arm/tcc77x/c100/backlight-target.h
@@ -23,15 +23,15 @@
#include "tcc77x.h"
-#define _backlight_init() true
+#define backlight_hw_init() true
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
/* Enable backlight */
GPIOE |= 0x2;
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
/* Disable backlight */
GPIOE &= ~0x2;
diff --git a/firmware/target/arm/tcc77x/iaudio7/backlight-target.h b/firmware/target/arm/tcc77x/iaudio7/backlight-target.h
index 9a6182f..0b227cd 100644
--- a/firmware/target/arm/tcc77x/iaudio7/backlight-target.h
+++ b/firmware/target/arm/tcc77x/iaudio7/backlight-target.h
@@ -26,7 +26,7 @@
void power_touch_panel(bool on);
-static inline bool _backlight_init(void)
+static inline bool backlight_hw_init(void)
{
GPIOD_DIR |= 0x2;
/* set backlight on by default, since the screen is unreadable without it */
@@ -34,13 +34,13 @@
return true;
}
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
GPIOD |= 0x2;
power_touch_panel(true);
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
GPIOD &= ~0x2;
power_touch_panel(false);
diff --git a/firmware/target/arm/tcc77x/logikdax/backlight-target.h b/firmware/target/arm/tcc77x/logikdax/backlight-target.h
index 7630a83..202e118 100644
--- a/firmware/target/arm/tcc77x/logikdax/backlight-target.h
+++ b/firmware/target/arm/tcc77x/logikdax/backlight-target.h
@@ -23,15 +23,15 @@
#include "tcc77x.h"
-#define _backlight_init() true
+#define backlight_hw_init() true
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
/* Enable backlight */
GPIOD |= 0x10;
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
/* Disable backlight */
GPIOD &= ~0x10;
diff --git a/firmware/target/arm/tcc77x/m200/backlight-target.h b/firmware/target/arm/tcc77x/m200/backlight-target.h
index bbc9037..d73ac78 100644
--- a/firmware/target/arm/tcc77x/m200/backlight-target.h
+++ b/firmware/target/arm/tcc77x/m200/backlight-target.h
@@ -23,19 +23,19 @@
#include "tcc77x.h"
-static inline bool _backlight_init(void)
+static inline bool backlight_hw_init(void)
{
GPIOA_DIR |= 0x40;
return true;
}
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
/* Enable backlight */
GPIOA |= 0x40;
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
/* Disable backlight */
GPIOA &= ~0x40;
diff --git a/firmware/target/arm/tcc780x/cowond2/backlight-cowond2.c b/firmware/target/arm/tcc780x/cowond2/backlight-cowond2.c
index 5668023..37ee0e5 100644
--- a/firmware/target/arm/tcc780x/cowond2/backlight-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/backlight-cowond2.c
@@ -26,15 +26,15 @@
#include "tcc780x.h"
#include "pmu-target.h"
-int _backlight_init(void)
+int backlight_hw_init(void)
{
- _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
+ backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
/* set backlight on by default, since the screen is unreadable without it */
- _backlight_on();
+ backlight_hw_on();
return true;
}
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
int level = disable_irq_save();
@@ -56,7 +56,7 @@
restore_irq(level);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
if (get_pmu_type() == PCF50606)
{
@@ -70,7 +70,7 @@
}
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
if (get_pmu_type() == PCF50606)
{
diff --git a/firmware/target/arm/tcc780x/cowond2/backlight-target.h b/firmware/target/arm/tcc780x/cowond2/backlight-target.h
index dbb0baa..6577f74 100644
--- a/firmware/target/arm/tcc780x/cowond2/backlight-target.h
+++ b/firmware/target/arm/tcc780x/cowond2/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-int _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+int backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif
diff --git a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
index df2ea1f..6c8541e 100644
--- a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
@@ -92,7 +92,7 @@
if (!(GPIOA & 0x4))
btn |= BUTTON_POWER;
- if (btn & BUTTON_TOUCHSCREEN && !is_backlight_on(true))
+ if (btn & BUTTON_TOUCHSCREEN && !isbacklight_hw_on(true))
old_data = *data = 0;
return btn;
diff --git a/firmware/target/arm/tcc780x/cowond2/power-cowond2.c b/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
index 0978728..6576afb 100644
--- a/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
@@ -78,7 +78,7 @@
void power_off(void)
{
/* Turn the backlight off first to avoid a bright stripe on power-off */
- _backlight_off();
+ backlight_hw_off();
sleep(HZ/10);
/* Power off the player using the same mechanism as the OF */
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/backlight-target.h b/firmware/target/arm/tms320dm320/creative-zvm/backlight-target.h
index c50ce6a..4ebe314 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/backlight-target.h
+++ b/firmware/target/arm/tms320dm320/creative-zvm/backlight-target.h
@@ -22,10 +22,10 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
/* true: backlight fades off - false: backlight fades on */
void __backlight_dim(bool dim);
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c
index 0cebc1b..0b338c1 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c
@@ -55,7 +55,7 @@
spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
lcd_awake(); /* power on lcd + visible display */
@@ -64,25 +64,25 @@
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
_backlight_write_brightness(0);
}
/* Assumes that the backlight has been initialized */
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
_backlight_write_brightness(brightness);
}
void __backlight_dim(bool dim_now)
{
- _backlight_set_brightness(dim_now ?
+ backlight_hw_brightness(dim_now ?
DEFAULT_BRIGHTNESS_SETTING :
DEFAULT_DIMNESS_SETTING);
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
short read_value;
@@ -102,7 +102,7 @@
spi_block_transfer(SPI_target_BACKLIGHT, commands[2], 2, 0, 0);
- _backlight_set_brightness(backlight_brightness);
+ backlight_hw_brightness(backlight_brightness);
return true;
}
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/backlight-target.h b/firmware/target/arm/tms320dm320/mrobe-500/backlight-target.h
index ab8ceac..5e91cd6 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/backlight-target.h
+++ b/firmware/target/arm/tms320dm320/mrobe-500/backlight-target.h
@@ -22,10 +22,10 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
/* true: backlight fades off - false: backlight fades on */
void __backlight_dim(bool dim);
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c
index b001032..e21e1fa 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c
@@ -292,13 +292,13 @@
remote_state_control=REMOTE_CONTROL_DRAW;
}
-void _remote_backlight_on(void)
+void remote_backlight_hw_on(void)
{
remote_power|=0x40;
remote_state_control_next=REMOTE_CONTROL_POWER;
}
-void _remote_backlight_off(void)
+void remote_backlight_hw_off(void)
{
remote_power&=~(0x40);
remote_state_control_next=REMOTE_CONTROL_POWER;
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c
index d9e0d52..7734831 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c
@@ -75,7 +75,7 @@
void power_off(void)
{
/* turn off backlight and wait for 1 second */
- _backlight_off();
+ backlight_hw_off();
#if defined(HAVE_REMOTE_LCD)
lcd_remote_sleep();
#endif
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
index c8b2c96..611bdbf 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
@@ -92,15 +92,15 @@
static unsigned char velocity = 0;
static unsigned long wheel_delta = 1ul << 24;
static unsigned char wheel_prev = 0;
- static long next_backlight_on = 0;
+ static long nextbacklight_hw_on = 0;
static int prev_key = -1;
static int prev_key_post = 0;
- if (TIME_AFTER(current_tick, next_backlight_on))
+ if (TIME_AFTER(current_tick, nextbacklight_hw_on))
{
backlight_on();
reset_poweroff_timer();
- next_backlight_on = current_tick + HZ/4;
+ nextbacklight_hw_on = current_tick + HZ/4;
}
if (wheel_prev < wheel)
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c
index 4104c21..c65d806 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c
@@ -50,7 +50,7 @@
IO_CLK_PWM1H = brightness*70;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_SLEEP
if (!lcd_active())
@@ -67,7 +67,7 @@
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
_backlight_write_brightness(0);
@@ -77,23 +77,23 @@
}
/* Assumes that the backlight has been initialized */
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
_backlight_write_brightness(brightness);
}
void __backlight_dim(bool dim_now)
{
- _backlight_set_brightness(dim_now ?
+ backlight_hw_brightness(dim_now ?
DEFAULT_BRIGHTNESS_SETTING :
DEFAULT_DIMNESS_SETTING);
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
IO_CLK_PWM1C = 0x58D; /* as found in OF */
- _backlight_set_brightness(backlight_brightness);
+ backlight_hw_brightness(backlight_brightness);
return true;
}
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/backlight-target.h b/firmware/target/arm/tms320dm320/sansa-connect/backlight-target.h
index 89bd837..3a6fc8c 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/backlight-target.h
+++ b/firmware/target/arm/tms320dm320/sansa-connect/backlight-target.h
@@ -22,10 +22,10 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
/* true: backlight fades off - false: backlight fades on */
void __backlight_dim(bool dim);
diff --git a/firmware/target/coldfire/iaudio/m3/backlight-m3.c b/firmware/target/coldfire/iaudio/m3/backlight-m3.c
index 0b4ee51..1163d6a 100644
--- a/firmware/target/coldfire/iaudio/m3/backlight-m3.c
+++ b/firmware/target/coldfire/iaudio/m3/backlight-m3.c
@@ -25,7 +25,7 @@
#include "backlight.h"
#include "backlight-target.h"
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
and_l(~0x00000008, &GPIO1_OUT);
or_l(0x00000008, &GPIO1_ENABLE);
@@ -33,12 +33,12 @@
return true; /* Backlight always ON after boot. */
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
and_l(~0x00000008, &GPIO1_OUT);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
or_l(0x00000008, &GPIO1_OUT);
}
diff --git a/firmware/target/coldfire/iaudio/m3/backlight-target.h b/firmware/target/coldfire/iaudio/m3/backlight-target.h
index 7c3ba97..fdc8438 100644
--- a/firmware/target/coldfire/iaudio/m3/backlight-target.h
+++ b/firmware/target/coldfire/iaudio/m3/backlight-target.h
@@ -22,8 +22,8 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#endif
diff --git a/firmware/target/coldfire/iaudio/m5/backlight-m5.c b/firmware/target/coldfire/iaudio/m5/backlight-m5.c
index daa6138..2738a32 100644
--- a/firmware/target/coldfire/iaudio/m5/backlight-m5.c
+++ b/firmware/target/coldfire/iaudio/m5/backlight-m5.c
@@ -26,14 +26,14 @@
#include "pcf50606.h"
#include "lcd.h"
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
- _backlight_on();
+ backlight_hw_on();
return true; /* Backlight always ON after boot. */
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
int level = disable_irq_save();
@@ -41,7 +41,7 @@
restore_irq(level);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
int level = disable_irq_save();
@@ -49,12 +49,12 @@
restore_irq(level);
}
-void _remote_backlight_on(void)
+void remote_backlight_hw_on(void)
{
and_l(~0x00200000, &GPIO_OUT);
}
-void _remote_backlight_off(void)
+void remote_backlight_hw_off(void)
{
or_l(0x00200000, &GPIO_OUT);
}
diff --git a/firmware/target/coldfire/iaudio/m5/backlight-target.h b/firmware/target/coldfire/iaudio/m5/backlight-target.h
index 43e8a2c..38acdd0 100644
--- a/firmware/target/coldfire/iaudio/m5/backlight-target.h
+++ b/firmware/target/coldfire/iaudio/m5/backlight-target.h
@@ -21,10 +21,10 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _remote_backlight_on(void);
-void _remote_backlight_off(void);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void remote_backlight_hw_on(void);
+void remote_backlight_hw_off(void);
#endif
diff --git a/firmware/target/coldfire/iaudio/x5/backlight-target.h b/firmware/target/coldfire/iaudio/x5/backlight-target.h
index 2b5281c..1d9bee0 100644
--- a/firmware/target/coldfire/iaudio/x5/backlight-target.h
+++ b/firmware/target/coldfire/iaudio/x5/backlight-target.h
@@ -21,11 +21,11 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int val);
-void _remote_backlight_on(void);
-void _remote_backlight_off(void);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int val);
+void remote_backlight_hw_on(void);
+void remote_backlight_hw_off(void);
#endif
diff --git a/firmware/target/coldfire/iaudio/x5/backlight-x5.c b/firmware/target/coldfire/iaudio/x5/backlight-x5.c
index 8a06c7d..de8b3d8 100644
--- a/firmware/target/coldfire/iaudio/x5/backlight-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/backlight-x5.c
@@ -26,15 +26,15 @@
#include "pcf50606.h"
#include "lcd.h"
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
- _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
- _backlight_on();
+ backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING);
+ backlight_hw_on();
return true; /* Backlight always ON after boot. */
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
int level;
#ifdef HAVE_LCD_ENABLE
@@ -45,7 +45,7 @@
restore_irq(level);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
int level = disable_irq_save();
pcf50606_write(0x38, 0x80); /* Backlight OFF, GPO1INV=1, GPO1ACT=000 */
@@ -56,7 +56,7 @@
}
/* set brightness by changing the PWM */
-void _backlight_set_brightness(int val)
+void backlight_hw_brightness(int val)
{
/* disable IRQs while bitbanging */
int old_irq_level = disable_irq_save();
@@ -65,12 +65,12 @@
restore_irq(old_irq_level);
}
-void _remote_backlight_on(void)
+void remote_backlight_hw_on(void)
{
and_l(~0x00200000, &GPIO_OUT);
}
-void _remote_backlight_off(void)
+void remote_backlight_hw_off(void)
{
or_l(0x00200000, &GPIO_OUT);
}
diff --git a/firmware/target/coldfire/iriver/h100/backlight-h100.c b/firmware/target/coldfire/iriver/h100/backlight-h100.c
index 47c02cb..1f582ec 100644
--- a/firmware/target/coldfire/iriver/h100/backlight-h100.c
+++ b/firmware/target/coldfire/iriver/h100/backlight-h100.c
@@ -27,7 +27,7 @@
#include "lcd.h"
/* Returns the current state of the backlight (true=ON, false=OFF). */
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
or_l(0x00020000, &GPIO1_ENABLE);
or_l(0x00020000, &GPIO1_FUNCTION);
@@ -45,12 +45,12 @@
or_l(0x00020000, &GPIO1_OUT);
}
-void _remote_backlight_on(void)
+void remote_backlight_hw_on(void)
{
and_l(~0x00000800, &GPIO_OUT);
}
-void _remote_backlight_off(void)
+void remote_backlight_hw_off(void)
{
or_l(0x00000800, &GPIO_OUT);
}
diff --git a/firmware/target/coldfire/iriver/h100/backlight-target.h b/firmware/target/coldfire/iriver/h100/backlight-target.h
index 5cd6fa7..64d0353 100644
--- a/firmware/target/coldfire/iriver/h100/backlight-target.h
+++ b/firmware/target/coldfire/iriver/h100/backlight-target.h
@@ -21,22 +21,19 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void); /* Returns backlight current state (true=ON). */
-void _backlight_hw_on(void);
-void _backlight_hw_off(void);
+bool backlight_hw_init(void); /* Returns backlight current state (true=ON). */
+void backlight_hw_on(void);
+void backlight_hw_off(void);
-#ifdef BOOTLOADER
-#define _backlight_on() _backlight_hw_on()
-#define _backlight_off() _backlight_hw_off()
-#else
-#define _backlight_on_isr() _backlight_hw_on()
-#define _backlight_off_isr() _backlight_hw_off()
-#define _backlight_on_normal() _backlight_hw_on()
-#define _backlight_off_normal() _backlight_hw_off()
+#ifndef BOOTLOADER
+#define backlight_hw_on_isr() backlight_hw_on()
+#define backlight_hw_off_isr() backlight_hw_off()
+#define backlight_hw_on_normal() backlight_hw_on()
+#define backlight_hw_off_normal() backlight_hw_off()
#define _BACKLIGHT_FADE_BOOST
#endif
-void _remote_backlight_on(void);
-void _remote_backlight_off(void);
+void remote_backlight_hw_on(void);
+void remote_backlight_hw_off(void);
#endif
diff --git a/firmware/target/coldfire/iriver/h300/backlight-h300.c b/firmware/target/coldfire/iriver/h300/backlight-h300.c
index 64e09b9..9e44dfa 100644
--- a/firmware/target/coldfire/iriver/h300/backlight-h300.c
+++ b/firmware/target/coldfire/iriver/h300/backlight-h300.c
@@ -28,7 +28,7 @@
#include "pcf50606.h"
#include "lcd.h"
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
or_l(0x00020000, &GPIO1_ENABLE);
or_l(0x00020000, &GPIO1_FUNCTION);
@@ -37,21 +37,21 @@
return true; /* Backlight always ON after boot. */
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
lcd_enable(true);
sleep(HZ/100); /* lcd needs time - avoid flashing for dark screens */
or_l(0x00020000, &GPIO1_OUT);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
and_l(~0x00020000, &GPIO1_OUT);
lcd_enable(false);
}
/* set brightness by changing the PWM */
-void _backlight_set_brightness(int val)
+void backlight_hw_brightness(int val)
{
/* disable IRQs while bitbanging */
int old_irq_level = disable_irq_save();
@@ -60,12 +60,12 @@
restore_irq(old_irq_level);
}
-void _remote_backlight_on(void)
+void remote_backlight_hw_on(void)
{
and_l(~0x00000002, &GPIO1_OUT);
}
-void _remote_backlight_off(void)
+void remote_backlight_hw_off(void)
{
or_l(0x00000002, &GPIO1_OUT);
}
diff --git a/firmware/target/coldfire/iriver/h300/backlight-target.h b/firmware/target/coldfire/iriver/h300/backlight-target.h
index 046a8fb..1ea9087 100644
--- a/firmware/target/coldfire/iriver/h300/backlight-target.h
+++ b/firmware/target/coldfire/iriver/h300/backlight-target.h
@@ -21,11 +21,11 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void); /* Returns backlight current state (true=ON). */
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int val);
-void _remote_backlight_on(void);
-void _remote_backlight_off(void);
+bool backlight_hw_init(void); /* Returns backlight current state (true=ON). */
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int val);
+void remote_backlight_hw_on(void);
+void remote_backlight_hw_off(void);
#endif
diff --git a/firmware/target/coldfire/mpio/backlight-mpio.c b/firmware/target/coldfire/mpio/backlight-mpio.c
index 1e40e9b..e04fa6d 100644
--- a/firmware/target/coldfire/mpio/backlight-mpio.c
+++ b/firmware/target/coldfire/mpio/backlight-mpio.c
@@ -27,11 +27,11 @@
#include "backlight-target.h"
#include "lcd.h"
-static bool _backlight_on = true;
+static bool backlight_hw_on = true;
static int _brightness = DEFAULT_BRIGHTNESS_SETTING;
/* Returns the current state of the backlight (true=ON, false=OFF). */
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
#ifdef BOOTLOADER
and_l(~(1<<28),&GPIO_OUT);
@@ -44,12 +44,12 @@
void _backlight_hw_on(void)
{
#ifndef BOOTLOADER
- if (_backlight_on)
+ if (backlight_hw_on)
return;
#endif
- _backlight_set_brightness(_brightness);
- _backlight_on = true;
+ backlight_hw_brightness(_brightness);
+ backlight_hw_on = true;
}
@@ -57,15 +57,15 @@
{
/* GPIO28 low */
and_l(~(1<<28),&GPIO_OUT);
- _backlight_on = false;
+ backlight_hw_on = false;
}
-void _backlight_set_brightness(int val)
+void backlight_hw_brightness(int val)
{
unsigned char i;
#ifndef BOOTLOADER
- if( _brightness == val && _backlight_on == true )
+ if( _brightness == val && backlight_hw_on == true )
return;
#endif
@@ -83,12 +83,12 @@
_brightness = val;
}
-void _remote_backlight_on(void)
+void remote_backlight_hw_on(void)
{
/* I don't have remote to play with */
}
-void _remote_backlight_off(void)
+void remote_backlight_hw_off(void)
{
/* I don't have remote to play with */
}
diff --git a/firmware/target/coldfire/mpio/backlight-target.h b/firmware/target/coldfire/mpio/backlight-target.h
index 93b1f30..b73bf27 100644
--- a/firmware/target/coldfire/mpio/backlight-target.h
+++ b/firmware/target/coldfire/mpio/backlight-target.h
@@ -21,15 +21,13 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void); /* Returns backlight current state (true=ON). */
-void _backlight_hw_on(void);
-void _backlight_hw_off(void);
-void _backlight_set_brightness(int val);
+bool backlight_hw_init(void); /* Returns backlight current state (true=ON). */
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int val);
-#define _backlight_on() _backlight_hw_on()
-#define _backlight_off() _backlight_hw_off()
-#define _backlight_on_isr() _backlight_hw_on()
-#define _backlight_off_isr() _backlight_hw_off()
-#define _backlight_on_normal() _backlight_hw_on()
-#define _backlight_off_normal() _backlight_hw_off()
+#define backlight_hw_on_isr() backlight_hw_on()
+#define backlight_hw_off_isr() backlight_hw_off()
+#define backlight_hw_on_normal() backlight_hw_on()
+#define backlight_hw_off_normal() backlight_hw_off()
#endif
diff --git a/firmware/target/coldfire/mpio/hd300/button-hd300.c b/firmware/target/coldfire/mpio/hd300/button-hd300.c
index fda26dd..e84b8d4 100644
--- a/firmware/target/coldfire/mpio/hd300/button-hd300.c
+++ b/firmware/target/coldfire/mpio/hd300/button-hd300.c
@@ -80,7 +80,7 @@
static signed char prev_scroll_lines = -1;
static signed char direction = 0;
static unsigned char count = 0;
- static long next_backlight_on = 0;
+ static long nextbacklight_hw_on = 0;
signed int new_scroll_lines;
signed int scroll_dir;
@@ -120,11 +120,11 @@
}
/* poke backlight */
- if (TIME_AFTER(current_tick, next_backlight_on))
+ if (TIME_AFTER(current_tick, nextbacklight_hw_on))
{
backlight_on();
reset_poweroff_timer();
- next_backlight_on = current_tick + HZ/4;
+ nextbacklight_hw_on = current_tick + HZ/4;
}
/* apply sensitivity filter */
diff --git a/firmware/target/hosted/android/dx50/backlight-dx50.c b/firmware/target/hosted/android/dx50/backlight-dx50.c
index 98dbcb8..8eb4c58 100644
--- a/firmware/target/hosted/android/dx50/backlight-dx50.c
+++ b/firmware/target/hosted/android/dx50/backlight-dx50.c
@@ -27,13 +27,13 @@
#include <stdio.h>
#include "unistd.h"
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
/* We have nothing to do */
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
FILE *f = fopen("/sys/power/state", "w");
fputs("on", f);
@@ -41,7 +41,7 @@
lcd_enable(true);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
FILE * f;
@@ -62,7 +62,7 @@
}
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
/* Just another check... */
if (brightness > MAX_BRIGHTNESS_SETTING)
diff --git a/firmware/target/hosted/android/dx50/backlight-target.h b/firmware/target/hosted/android/dx50/backlight-target.h
index 67836aa..0dc7ce3 100644
--- a/firmware/target/hosted/android/dx50/backlight-target.h
+++ b/firmware/target/hosted/android/dx50/backlight-target.h
@@ -23,9 +23,9 @@
#include <stdbool.h>
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/hosted/samsungypr/backlight-target.h b/firmware/target/hosted/samsungypr/backlight-target.h
index 21db75c..138c2cc 100644
--- a/firmware/target/hosted/samsungypr/backlight-target.h
+++ b/firmware/target/hosted/samsungypr/backlight-target.h
@@ -21,9 +21,9 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/hosted/samsungypr/ypr0/backlight-ypr0.c b/firmware/target/hosted/samsungypr/ypr0/backlight-ypr0.c
index 5555b30..353ab15 100644
--- a/firmware/target/hosted/samsungypr/ypr0/backlight-ypr0.c
+++ b/firmware/target/hosted/samsungypr/ypr0/backlight-ypr0.c
@@ -29,13 +29,13 @@
static bool backlight_on_status = true; /* Is on or off? */
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
/* We have nothing to do */
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
if (!backlight_on_status)
{
@@ -51,7 +51,7 @@
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
if (backlight_on_status)
{
@@ -66,7 +66,7 @@
backlight_on_status = false;
}
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
/* Just another check... */
if (brightness > MAX_BRIGHTNESS_SETTING)
diff --git a/firmware/target/hosted/samsungypr/ypr1/backlight-ypr1.c b/firmware/target/hosted/samsungypr/ypr1/backlight-ypr1.c
index e4f0457..7f9cc1e 100644
--- a/firmware/target/hosted/samsungypr/ypr1/backlight-ypr1.c
+++ b/firmware/target/hosted/samsungypr/ypr1/backlight-ypr1.c
@@ -27,32 +27,32 @@
static bool backlight_on_status = true; /* Is on or off? */
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
/* We have nothing to do */
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
if (!backlight_on_status) {
- _backlight_set_brightness(backlight_brightness);
+ backlight_hw_brightness(backlight_brightness);
}
backlight_on_status = true;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
if (backlight_on_status) {
- _backlight_set_brightness(0);
+ backlight_hw_brightness(0);
}
backlight_on_status = false;
}
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
/* Just another check... */
if (brightness > MAX_BRIGHTNESS_SETTING) {
diff --git a/firmware/target/mips/ingenic_jz47xx/backlight-target.h b/firmware/target/mips/ingenic_jz47xx/backlight-target.h
index 67836aa..0dc7ce3 100644
--- a/firmware/target/mips/ingenic_jz47xx/backlight-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/backlight-target.h
@@ -23,9 +23,9 @@
#include <stdbool.h>
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c
index 7f83412..aacfe36 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c
@@ -53,19 +53,19 @@
old_val = val;
}
-static void set_backlight_on(void)
+static void setbacklight_hw_on(void)
{
__tcu_start_counter(BACKLIGHT_PWM);
__tcu_enable_pwm_output(BACKLIGHT_PWM);
}
-static void set_backlight_off(void)
+static void setbacklight_hw_off(void)
{
__tcu_disable_pwm_output(BACKLIGHT_PWM);
__tcu_stop_counter(BACKLIGHT_PWM);
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
__gpio_as_pwm(BACKLIGHT_PWM);
__tcu_start_timer_clock(BACKLIGHT_PWM);
@@ -88,24 +88,24 @@
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd */
#endif
- set_backlight_on();
+ setbacklight_hw_on();
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
- set_backlight_off();
+ setbacklight_hw_off();
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off lcd */
#endif
}
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
-void _backlight_set_brightness(int brightness)
+void backlight_hw_brightness(int brightness)
{
set_backlight(brightness);
}
@@ -115,6 +115,6 @@
/* Turn off LED supply */
void _backlight_lcd_sleep(void)
{
- _backlight_off();
+ backlight_hw_off();
}
#endif
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
index d06cb28..a810fde 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
@@ -184,7 +184,7 @@
#if CONFIG_ORIENTATION == SCREEN_LANDSCAPE
*data = (*data & 0xFFFF) | ((LCD_HEIGHT - (*data >> 16)) << 16);
#endif
- if( UNLIKELY(!is_backlight_on(true)) )
+ if( UNLIKELY(!isbacklight_hw_on(true)) )
*data = 0;
old_data = *data;
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/backlight-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx767/backlight-target.h
index 67836aa..0dc7ce3 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx767/backlight-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/backlight-target.h
@@ -23,9 +23,9 @@
#include <stdbool.h>
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
-void _backlight_set_brightness(int brightness);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
+void backlight_hw_brightness(int brightness);
#endif /* BACKLIGHT_TARGET_H */
diff --git a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
index ab232ba..5ef500a 100644
--- a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
@@ -272,7 +272,7 @@
lcd_set_viewport(NULL);
#endif
lcd_clear_display();
- _backlight_on();
+ backlight_hw_on();
lcd_puts(0, 0, parse_exception(cause));
lcd_putsf(0, 1, "0x%08x at 0x%08x", read_c0_badvaddr(), epc);
diff --git a/firmware/target/sh/archos/fm_v2/backlight-target.h b/firmware/target/sh/archos/fm_v2/backlight-target.h
index 9eff090..c3dd395 100644
--- a/firmware/target/sh/archos/fm_v2/backlight-target.h
+++ b/firmware/target/sh/archos/fm_v2/backlight-target.h
@@ -24,15 +24,15 @@
#include "config.h"
#include "rtc.h"
-#define _backlight_init() true
+#define backlight_hw_init() true
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
rtc_write(0x13, 0x10); /* 32 kHz square wave */
rtc_write(0x0a, rtc_read(0x0a) | 0x40); /* Enable square wave */
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
/* While on, backlight is flashing at 32 kHz. If the square wave output
is disabled while the backlight is lit, it will become constantly lit,
diff --git a/firmware/target/sh/archos/ondio/backlight-target.h b/firmware/target/sh/archos/ondio/backlight-target.h
index 9dd3eb1..438c8c9 100644
--- a/firmware/target/sh/archos/ondio/backlight-target.h
+++ b/firmware/target/sh/archos/ondio/backlight-target.h
@@ -27,7 +27,7 @@
#ifdef HAVE_BACKLIGHT
/* A stock Ondio has no backlight, it needs a hardware mod. */
-static inline bool _backlight_init(void)
+static inline bool backlight_hw_init(void)
{
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
or_b(0x40, &PADRH); /* drive it high */
@@ -35,12 +35,12 @@
return true;
}
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
or_b(0x40, &PADRH); /* drive it high */
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
and_b(~0x40, &PADRH); /* drive it low */
}
diff --git a/firmware/target/sh/archos/ondio/power-ondio.c b/firmware/target/sh/archos/ondio/power-ondio.c
index 8602677..d7bbc08 100644
--- a/firmware/target/sh/archos/ondio/power-ondio.c
+++ b/firmware/target/sh/archos/ondio/power-ondio.c
@@ -70,7 +70,7 @@
disable_irq();
#ifdef HAVE_BACKLIGHT
/* Switch off the light on backlight-modded Ondios */
- _backlight_off();
+ backlight_hw_off();
#endif
and_b(~0x20, &PBDRL);
or_b(0x20, &PBIORL);
diff --git a/firmware/target/sh/archos/player/backlight-target.h b/firmware/target/sh/archos/player/backlight-target.h
index 71d6a93..b97d21a 100644
--- a/firmware/target/sh/archos/player/backlight-target.h
+++ b/firmware/target/sh/archos/player/backlight-target.h
@@ -24,7 +24,7 @@
#include "config.h"
#include "cpu.h"
-static inline bool _backlight_init(void)
+static inline bool backlight_hw_init(void)
{
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
and_b(~0x40, &PADRH); /* drive and set low */
@@ -32,13 +32,13 @@
return true;
}
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
and_b(~0x40, &PADRH); /* drive and set low */
or_b(0x40, &PAIORH);
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
and_b(~0x40, &PAIORH); /* let it float (up) */
}
diff --git a/firmware/target/sh/archos/recorder/backlight-target.h b/firmware/target/sh/archos/recorder/backlight-target.h
index 9eff090..c3dd395 100644
--- a/firmware/target/sh/archos/recorder/backlight-target.h
+++ b/firmware/target/sh/archos/recorder/backlight-target.h
@@ -24,15 +24,15 @@
#include "config.h"
#include "rtc.h"
-#define _backlight_init() true
+#define backlight_hw_init() true
-static inline void _backlight_on(void)
+static inline void backlight_hw_on(void)
{
rtc_write(0x13, 0x10); /* 32 kHz square wave */
rtc_write(0x0a, rtc_read(0x0a) | 0x40); /* Enable square wave */
}
-static inline void _backlight_off(void)
+static inline void backlight_hw_off(void)
{
/* While on, backlight is flashing at 32 kHz. If the square wave output
is disabled while the backlight is lit, it will become constantly lit,
diff --git a/uisimulator/common/backlight-sim.c b/uisimulator/common/backlight-sim.c
index f60a218..0d6440b 100644
--- a/uisimulator/common/backlight-sim.c
+++ b/uisimulator/common/backlight-sim.c
@@ -30,7 +30,7 @@
/* in uisimulator/sdl/lcd-bitmap.c and lcd-charcell.c */
extern void sim_backlight(int value);
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
return true;
}
@@ -45,7 +45,7 @@
(MAX_BRIGHTNESS_SETTING - MIN_BRIGHTNESS_SETTING + 1);
}
-void _backlight_set_brightness(int val)
+void backlight_hw_brightness(int val)
{
sim_backlight(normalize_backlight(val));
}
@@ -53,7 +53,7 @@
#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#if defined(HAVE_LCD_ENABLE)
lcd_enable(true);
@@ -72,7 +72,7 @@
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
sim_backlight(0);
#ifdef HAVE_LCD_ENABLE
@@ -82,16 +82,16 @@
#ifdef HAVE_BUTTON_LIGHT
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
}
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
-void _buttonlight_set_brightness(int val)
+void buttonlight_hw_brightness(int val)
{
(void)val;
}
@@ -99,12 +99,12 @@
#endif /* HAVE_BUTTON_LIGHT */
#ifdef HAVE_REMOTE_LCD
-void _remote_backlight_on(void)
+void remote_backlight_hw_on(void)
{
sim_remote_backlight(100);
}
-void _remote_backlight_off(void)
+void remote_backlight_hw_off(void)
{
sim_remote_backlight(0);
}
diff --git a/uisimulator/common/backlight-sim.h b/uisimulator/common/backlight-sim.h
index 4a97752..f7e35dc 100644
--- a/uisimulator/common/backlight-sim.h
+++ b/uisimulator/common/backlight-sim.h
@@ -24,18 +24,18 @@
#include "config.h"
-bool _backlight_init(void);
-void _backlight_on(void);
-void _backlight_off(void);
+bool backlight_hw_init(void);
+void backlight_hw_on(void);
+void backlight_hw_off(void);
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
-void _backlight_set_brightness(int val);
+void backlight_hw_brightness(int val);
#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
#ifdef HAVE_BUTTON_LIGHT
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+voidbuttonlight_hw_on(void);
+voidbuttonlight_hw_off(void);
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
-void _buttonlight_set_brightness(int val);
+voidbuttonlight_hw_set_brightness(int val);
#endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */
#endif /* HAVE_BUTTON_LIGHT */