summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/backlight-sw-fading.c8
-rw-r--r--firmware/backlight.c40
-rw-r--r--firmware/export/backlight.h4
-rw-r--r--firmware/target/arm/as3525/backlight-e200v2-fuze.c10
-rw-r--r--firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c16
-rw-r--r--firmware/target/arm/as3525/sansa-c200v2/backlight-target.h14
-rw-r--r--firmware/target/arm/as3525/sansa-clip/backlight-target.h12
-rw-r--r--firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c4
-rw-r--r--firmware/target/arm/as3525/sansa-clipplus/backlight-target.h8
-rw-r--r--firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c4
-rw-r--r--firmware/target/arm/as3525/sansa-clipv2/backlight-target.h12
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c8
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/backlight-target.h10
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/backlight-target.h14
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/backlight-target.h14
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c12
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h14
-rw-r--r--firmware/target/arm/as3525/sansa-m200v4/backlight-target.h8
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c4
-rw-r--r--firmware/target/arm/as3525/system-as3525.c2
-rw-r--r--firmware/target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c10
-rw-r--r--firmware/target/arm/imx233/creative-zen/backlight-target.h8
-rw-r--r--firmware/target/arm/imx233/creative-zen/backlight-zen.c12
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/backlight-target.h8
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c12
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/backlight-target.h14
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/backlight-zenxfi3.c18
-rw-r--r--firmware/target/arm/imx233/samsung-ypz5/backlight-target.h8
-rw-r--r--firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c12
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c12
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/backlight-target.h8
-rw-r--r--firmware/target/arm/imx233/sony-nwz/backlight-nwz.c12
-rw-r--r--firmware/target/arm/imx233/sony-nwz/backlight-target.h8
-rw-r--r--firmware/target/arm/imx233/system-imx233.c6
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/backlight-gigabeat-s.c10
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/backlight-target.h8
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/power-gigabeat-s.c2
-rw-r--r--firmware/target/arm/ipod/1g2g/backlight-1g2g.c4
-rw-r--r--firmware/target/arm/ipod/1g2g/backlight-target.h6
-rw-r--r--firmware/target/arm/ipod/3g/backlight-3g.c4
-rw-r--r--firmware/target/arm/ipod/backlight-4g_color.c12
-rw-r--r--firmware/target/arm/ipod/backlight-nano_video.c6
-rw-r--r--firmware/target/arm/ipod/backlight-target.h44
-rw-r--r--firmware/target/arm/ipod/button-1g-3g.c8
-rw-r--r--firmware/target/arm/ipod/button-mini1g.c8
-rw-r--r--firmware/target/arm/ipod/lcd-color_nano.c2
-rw-r--r--firmware/target/arm/iriver/backlight-target.h6
-rw-r--r--firmware/target/arm/iriver/h10/backlight-h10.c4
-rw-r--r--firmware/target/arm/olympus/mrobe-100/backlight-mr100.c12
-rw-r--r--firmware/target/arm/olympus/mrobe-100/backlight-target.h25
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c4
-rw-r--r--firmware/target/arm/pbell/vibe500/backlight-target.h14
-rw-r--r--firmware/target/arm/pbell/vibe500/backlight-vibe500.c12
-rw-r--r--firmware/target/arm/philips/hdd1630/backlight-hdd1630.c12
-rw-r--r--firmware/target/arm/philips/hdd1630/backlight-target.h14
-rw-r--r--firmware/target/arm/philips/hdd6330/backlight-hdd6330.c12
-rw-r--r--firmware/target/arm/philips/hdd6330/backlight-target.h14
-rw-r--r--firmware/target/arm/philips/power-hdd.c2
-rw-r--r--firmware/target/arm/philips/sa9200/backlight-sa9200.c14
-rw-r--r--firmware/target/arm/philips/sa9200/backlight-target.h12
-rw-r--r--firmware/target/arm/pnx0101/backlight-target.h6
-rw-r--r--firmware/target/arm/pnx0101/iriver-ifp7xx/backlight-ifp7xx.c4
-rw-r--r--firmware/target/arm/rk27xx/backlight-rk27xx.c8
-rw-r--r--firmware/target/arm/rk27xx/backlight-target.h8
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c14
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h14
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c4
-rw-r--r--firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c16
-rw-r--r--firmware/target/arm/s3c2440/mini2440/backlight-target.h8
-rw-r--r--firmware/target/arm/s5l8700/backlight-meizu.c12
-rw-r--r--firmware/target/arm/s5l8700/backlight-target.h8
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/backlight-nano2g.c10
-rw-r--r--firmware/target/arm/s5l8700/yps3/backlight-target.h12
-rw-r--r--firmware/target/arm/s5l8700/yps3/backlight-yps3.c18
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/backlight-ipod6g.c12
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/backlight-target.h8
-rw-r--r--firmware/target/arm/samsung/backlight-target.h6
-rw-r--r--firmware/target/arm/samsung/yh820/backlight-yh820.c4
-rw-r--r--firmware/target/arm/samsung/yh920/backlight-yh920.c4
-rw-r--r--firmware/target/arm/samsung/yh925/backlight-yh925.c4
-rw-r--r--firmware/target/arm/sandisk/backlight-c200_e200.c14
-rw-r--r--firmware/target/arm/sandisk/backlight-target.h12
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/button-e200.c8
-rw-r--r--firmware/target/arm/sandisk/sansa-view/backlight-target.h8
-rw-r--r--firmware/target/arm/sandisk/sansa-view/backlight-view.c12
-rw-r--r--firmware/target/arm/tatung/tpj1022/backlight-target.h6
-rw-r--r--firmware/target/arm/tatung/tpj1022/backlight-tpj1022.c4
-rw-r--r--firmware/target/arm/tcc77x/c100/backlight-target.h6
-rw-r--r--firmware/target/arm/tcc77x/iaudio7/backlight-target.h6
-rw-r--r--firmware/target/arm/tcc77x/logikdax/backlight-target.h6
-rw-r--r--firmware/target/arm/tcc77x/m200/backlight-target.h6
-rw-r--r--firmware/target/arm/tcc780x/cowond2/backlight-cowond2.c12
-rw-r--r--firmware/target/arm/tcc780x/cowond2/backlight-target.h8
-rw-r--r--firmware/target/arm/tcc780x/cowond2/button-cowond2.c2
-rw-r--r--firmware/target/arm/tcc780x/cowond2/power-cowond2.c2
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/backlight-target.h8
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c12
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/backlight-target.h8
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c4
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c2
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c6
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c12
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/backlight-target.h8
-rw-r--r--firmware/target/coldfire/iaudio/m3/backlight-m3.c6
-rw-r--r--firmware/target/coldfire/iaudio/m3/backlight-target.h6
-rw-r--r--firmware/target/coldfire/iaudio/m5/backlight-m5.c12
-rw-r--r--firmware/target/coldfire/iaudio/m5/backlight-target.h10
-rw-r--r--firmware/target/coldfire/iaudio/x5/backlight-target.h12
-rw-r--r--firmware/target/coldfire/iaudio/x5/backlight-x5.c16
-rw-r--r--firmware/target/coldfire/iriver/h100/backlight-h100.c6
-rw-r--r--firmware/target/coldfire/iriver/h100/backlight-target.h23
-rw-r--r--firmware/target/coldfire/iriver/h300/backlight-h300.c12
-rw-r--r--firmware/target/coldfire/iriver/h300/backlight-target.h12
-rw-r--r--firmware/target/coldfire/mpio/backlight-mpio.c20
-rw-r--r--firmware/target/coldfire/mpio/backlight-target.h18
-rw-r--r--firmware/target/coldfire/mpio/hd300/button-hd300.c6
-rw-r--r--firmware/target/hosted/android/dx50/backlight-dx50.c8
-rw-r--r--firmware/target/hosted/android/dx50/backlight-target.h8
-rw-r--r--firmware/target/hosted/samsungypr/backlight-target.h8
-rw-r--r--firmware/target/hosted/samsungypr/ypr0/backlight-ypr0.c8
-rw-r--r--firmware/target/hosted/samsungypr/ypr1/backlight-ypr1.c12
-rw-r--r--firmware/target/mips/ingenic_jz47xx/backlight-target.h8
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c18
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c2
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx767/backlight-target.h8
-rw-r--r--firmware/target/mips/ingenic_jz47xx/system-jz4740.c2
-rw-r--r--firmware/target/sh/archos/fm_v2/backlight-target.h6
-rw-r--r--firmware/target/sh/archos/ondio/backlight-target.h6
-rw-r--r--firmware/target/sh/archos/ondio/power-ondio.c2
-rw-r--r--firmware/target/sh/archos/player/backlight-target.h6
-rw-r--r--firmware/target/sh/archos/recorder/backlight-target.h6
131 files changed, 624 insertions, 632 deletions
diff --git a/firmware/backlight-sw-fading.c b/firmware/backlight-sw-fading.c
index 2aff2f9c27..c336d40458 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 @@ static bool _backlight_fade_up(void)
{
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 @@ static bool _backlight_fade_down(void)
{
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 d24fc1342f..d6dbf3eec7 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -126,10 +126,10 @@ static void buttonlight_update_state(void)
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 @@ static void backlight_setup_fade_up(void)
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 @@ static void backlight_setup_fade_up(void)
{
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 @@ static void backlight_setup_fade_down(void)
{
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 @@ static inline void do_backlight_off(void)
#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 @@ static void backlight_update_state(void)
#if BACKLIGHT_FADE_IN_THREAD
backlight_setup_fade_up();
#else
- _backlight_on();
+ backlight_hw_on();
#endif
}
}
@@ -514,12 +514,12 @@ static void remote_backlight_update_state(void)
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 @@ void backlight_thread(void)
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 @@ void backlight_thread(void)
#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 @@ void backlight_thread(void)
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 @@ static void backlight_timeout_handler(void)
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 @@ static void backlight_timeout_handler(void)
buttonlight_timer -= BACKLIGHT_THREAD_TIMEOUT;
if (buttonlight_timer <= 0)
{
- _buttonlight_off();
+ buttonlight_hw_off();
}
}
#endif /* HAVE_BUTTON_LIGHT */
@@ -723,7 +723,7 @@ void backlight_init(void)
{
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 @@ void buttonlight_set_brightness(int val)
#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 ceeb979573..40efd63e17 100644
--- a/firmware/export/backlight.h
+++ b/firmware/export/backlight.h
@@ -65,8 +65,8 @@ void lcd_set_sleep_after_backlight_off(int index);
#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 91e1ef4d0c..26602fcee6 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 @@ void _backlight_on(void)
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
ascodec_write(AS3514_DCDC15, 0x0);
#ifdef HAVE_LCD_ENABLE
@@ -53,7 +53,7 @@ void _backlight_off(void)
#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 @@ void _buttonlight_on(void)
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 1da57de93a..6344eff593 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 @@ void _backlight_pwm(int on)
}
}
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
GPIOA_DIR |= 1<<5;
if (c200v2_variant == 1) {
@@ -109,14 +109,14 @@ bool _backlight_init(void)
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 @@ static void _pwm_off(void)
_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 @@ void _backlight_on(void)
backlight_is_on = 1;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
if (backlight_is_on == 0)
return;
@@ -159,7 +159,7 @@ void _backlight_off(void)
#endif
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
if (buttonlight_is_on == 1)
return;
@@ -169,7 +169,7 @@ void _buttonlight_on(void)
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 4a098f7f28..a6b07de6bf 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 00c6e5cc44..669f0f5939 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 e3b518b3f8..76df12c948 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 3dd9240bd8..9e8ff1ce8c 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 f4927ba5bf..65f69e8bcd 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 b2da63dbff..800b26d7fa 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 a47941bbd7..9fde68dd8a 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 @@ void _backlight_on(void)
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(false);
@@ -52,7 +52,7 @@ void _backlight_off(void)
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 bf58973ab6..00b925c22b 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 227a154197..0baaf2441a 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 df6df573b0..c4e95e9c4a 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 a01b168b71..71f0c1a3f2 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 @@ bool _backlight_init(void)
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 @@ void _backlight_on(void)
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 @@ void _backlight_off(void)
#endif
}
-void _buttonlight_on(void)
+void buttonlight_hw_on(void)
{
if (amsv2_variant == 0)
{
@@ -77,7 +77,7 @@ void _buttonlight_on(void)
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (amsv2_variant == 0)
{
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h b/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h
index f9d7005f79..4138ef7868 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 b5560bd037..f3ef1095e6 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 ead40eac3c..4530d5d763 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -969,7 +969,7 @@ void sd_enable(bool on)
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 @@ void sd_enable(bool on)
#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 f128ef68be..51b6755601 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -360,7 +360,7 @@ void system_init(void)
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 fabf8aa041..b60449417a 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 78a0a72d85..60a2fbe746 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 6d162817c8..ef2ab615a5 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 @@ void _backlight_set_brightness(int level)
#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 @@ bool _backlight_init(void)
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 e3766965d8..483272f804 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 b01dc36063..02e7a0f77e 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 @@ void _backlight_on(void)
/* 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 c7508c87a3..edc67ba816 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 7013696642..2b77a4d7ac 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 @@ void _backlight_on(void)
/* 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 5fa2ed38f9..e26f83811d 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 27a7ecedfc..b02c3a1d16 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 @@ static void aat3151_write(int addr, int data)
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 @@ void _backlight_set_brightness(int level)
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 @@ bool _backlight_init(void)
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 3ee9d0914a..f87dbddfc0 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 @@ void _backlight_set_brightness(int brightness)
}
}
-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 @@ void _backlight_on(void)
/* 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 e3766965d8..483272f804 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 d99d21386b..fecbeda15b 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 @@ void _backlight_set_brightness(int brightness)
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 @@ void _backlight_on(void)
/* 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 78a0a72d85..60a2fbe746 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 f34eab66e2..38865c47a3 100644
--- a/firmware/target/arm/imx233/system-imx233.c
+++ b/firmware/target/arm/imx233/system-imx233.c
@@ -105,7 +105,7 @@ void imx233_chip_reset(void)
void system_reboot(void)
{
- _backlight_off();
+ backlight_hw_off();
disable_irq();
@@ -119,8 +119,8 @@ void system_exception_wait(void)
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 60fcb4729d..29d8980d86 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 @@ static uint32_t backlight_pwm_bits; /* Final PWM setting for fade-in */
/* 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 @@ bool _backlight_init(void)
#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 @@ void backlight_set_fade_in(bool value)
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_on(void)
}
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
uint32_t ctrl0 = MC13783_LED_CONTROL0_BITS | MC13783_LEDEN;
@@ -173,7 +173,7 @@ void _backlight_off(void)
#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 2ae1372815..124fa87b17 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 d194a69ab1..5d89802bc9 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 @@ void power_off(void)
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 b7797813ec..7f1fa7ba42 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 22826054aa..e888aa7c3f 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 77088e32ec..fcc162310f 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 befb036eab..96ed387625 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 char log_brightness[32] = {
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 @@ void _backlight_on(void)
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 2f56f94225..e2e9bf0341 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 brightness = 1; /* 1 to 32 */
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 @@ void _backlight_hw_enable(bool on)
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 @@ void _backlight_led_off(void)
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 9b6a96b3cb..fef7ee8ce0 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 @@ void lcd_awake(void);
#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 045a0f6d8a..67aa7eb336 100644
--- a/firmware/target/arm/ipod/button-1g-3g.c
+++ b/firmware/target/arm/ipod/button-1g-3g.c
@@ -66,7 +66,7 @@ static void handle_scroll_wheel(int new_scroll)
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 @@ static void handle_scroll_wheel(int new_scroll)
}
/* 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 @@ static void handle_scroll_wheel(int new_scroll)
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 d4a75c90d8..a508958de1 100644
--- a/firmware/target/arm/ipod/button-mini1g.c
+++ b/firmware/target/arm/ipod/button-mini1g.c
@@ -60,7 +60,7 @@ static void handle_scroll_wheel(int new_scroll)
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 @@ static void handle_scroll_wheel(int new_scroll)
}
/* 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 @@ static void handle_scroll_wheel(int new_scroll)
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 c7676fa721..67d26aa862 100644
--- a/firmware/target/arm/ipod/lcd-color_nano.c
+++ b/firmware/target/arm/ipod/lcd-color_nano.c
@@ -122,7 +122,7 @@ void lcd_shutdown(void) {
#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 a27b489319..3882964207 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 db10f39057..80dfdd88c1 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 @@ void _backlight_on(void)
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 f3891c5000..b39010ff0e 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 @@ void _buttonlight_set_brightness(int brightness)
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 df25106d1a..725e1ad622 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 @@ void _remote_backlight_off(void);
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 34b114910a..22bc4fb0d8 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 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
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 7fd6d877fb..396fea3007 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 ab71012bdb..1d03ddddf0 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 @@ void _backlight_on(void)
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 @@ void _backlight_off(void)
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 @@ void _backlight_set_brightness(int brightness)
#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_on(void)
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (buttonlight_status)
{
@@ -78,7 +78,7 @@ void _buttonlight_off(void)
}
}
-void _buttonlight_set_brightness(int brightness)
+void buttonlight_hw_brightness(int brightness)
{
/* no brightness control, but lights stays on - for compatibility */
(void)brightness;
diff --git a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
index 95a9ad8b86..efa85723a1 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 @@ void _backlight_on(void)
GPO32_VAL |= 0x400;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPO32_ENABLE |= 0x400;
GPO32_VAL &=~0x400;
@@ -60,7 +60,7 @@ void _backlight_off(void)
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_on(void)
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (buttonlight_status)
{
@@ -78,7 +78,7 @@ void _buttonlight_off(void)
}
}
-void _buttonlight_set_brightness(int brightness)
+void buttonlight_hw_brightness(int brightness)
{
buttonight_brightness = brightness - 1;
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 63f3f5a8df..d79f09a8a6 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 46c03e712e..b6422a5aa9 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 @@ void _backlight_on(void)
GPO32_VAL |= 0x400;
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
GPO32_ENABLE |= 0x400;
GPO32_VAL &= ~0x400;
@@ -60,7 +60,7 @@ void _backlight_off(void)
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_on(void)
}
}
-void _buttonlight_off(void)
+void buttonlight_hw_off(void)
{
if (buttonlight_status)
{
@@ -89,7 +89,7 @@ void _buttonlight_off(void)
}
}
-void _buttonlight_set_brightness(int brightness)
+void buttonlight_hw_brightness(int brightness)
{
touchpad_set_parameter(0x01,0x21,0x01);
touchpad_set_parameter(0x00,0x22,0x15);
diff --git a/firmware/target/arm/philips/hdd6330/backlight-target.h b/firmware/target/arm/philips/hdd6330/backlight-target.h
index 63f3f5a8df..d79f09a8a6 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 a7f1302a7c..d38c6de2b4 100644
--- a/firmware/target/arm/philips/power-hdd.c
+++ b/firmware/target/arm/philips/power-hdd.c
@@ -111,7 +111,7 @@ bool ide_powered(void)
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 0de4c05df5..7046d09910 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 @@ void _backlight_on(void)
#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 @@ void _backlight_off(void)
#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_on(void)
}
}
-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 9d695e5a22..349f2e2b57 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 40152f1fda..7ebe85d66f 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 6cf2422d60..8be7a59de2 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 361d18c948..1756fcdb29 100644
--- a/firmware/target/arm/rk27xx/backlight-rk27xx.c
+++ b/firmware/target/arm/rk27xx/backlight-rk27xx.c
@@ -77,7 +77,7 @@ static const unsigned short lin_brightness[] = {
};
#endif
-bool _backlight_init(void)
+bool backlight_hw_init(void)
{
/* configure PD4 as output */
GPIO_PDCON |= (1<<4);
@@ -105,7 +105,7 @@ bool _backlight_init(void)
return true;
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true);
@@ -120,7 +120,7 @@ void _backlight_on(void)
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 @@ void _backlight_off(void)
#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 91579b080d..a436186791 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 f3d9aac168..c30eb8d812 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 char buttonlight_target;
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 @@ static void __backlight_dim(bool dim_now)
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 @@ void _backlight_on(void)
__backlight_dim(false);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
__backlight_dim(true);
}
@@ -373,12 +373,12 @@ static void __buttonlight_dim(bool dim_now)
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 @@ void _buttonlight_off(void)
__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 @@ void _buttonlight_set_brightness(int brightness)
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 8db2b11041..ef30babc2f 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 @@ void __buttonlight_trigger(void);
/* 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 ad9098dd8a..e31a633aca 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 @@ void power_off(void)
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 b39bfc4949..c4b93da9bc 100644
--- a/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c
+++ b/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c
@@ -46,7 +46,7 @@ static unsigned char backlight_target;
/* 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 @@ static void led_control_service(void)
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 @@ static void __backlight_dim(bool dim_now)
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 @@ void _backlight_on(void)
__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 c804f16bcc..ceb6824841 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 4eb6967b94..d5c9a22f82 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 @@ void _backlight_set_brightness(int brightness)
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 @@ bool _backlight_init(void)
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 91579b080d..a436186791 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 3e0e7460c4..b38e0f17f5 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_awake(void);
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 @@ void _backlight_on(void)
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 0507be4f76..74ea0aa035 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 7cf3a44805..ae3cc3b0a1 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 @@ void _backlight_set_brightness(int brightness)
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 @@ bool _backlight_init(void)
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 481a2643bb..7d1c8bde13 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_awake(void);
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 @@ void _backlight_on(void)
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 05a8addfea..21ff6c30e1 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 a27b489319..3882964207 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 0bbdb4f7d4..b24f8128c4 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 @@ void _backlight_on(void)
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 0bbdb4f7d4..b24f8128c4 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 @@ void _backlight_on(void)
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 5f29f9f770..8eb287b61b 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 @@ void _backlight_on(void)
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 0280604526..ad1a6d9e46 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 @@ void _backlight_on(void)
#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 @@ void _buttonlight_on(void)
#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 1f5e475a42..cbe26f54da 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 73279b44cf..0df71f4815 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 @@ void clickwheel_int(void)
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 @@ void clickwheel_int(void)
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 @@ void clickwheel_int(void)
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 545ee93677..c51875754d 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 c065ec3f2a..637e5b4269 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 @@ bool _backlight_init(void)
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 @@ void _buttonlight_off(void)
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 f82dc567ef..4a5e677599 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 87ec19fa80..d63387728b 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 @@ void _backlight_on(void)
#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 738a2f80ab..7ae71022f0 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 9a6182ff02..0b227cd11c 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 @@ static inline bool _backlight_init(void)
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 7630a8332e..202e118606 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 bbc9037075..d73ac78852 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 5668023f28..37ee0e57a1 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 @@ void _backlight_set_brightness(int brightness)
restore_irq(level);
}
-void _backlight_on(void)
+void backlight_hw_on(void)
{
if (get_pmu_type() == PCF50606)
{
@@ -70,7 +70,7 @@ void _backlight_on(void)
}
}
-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 dbb0baae43..6577f74474 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 df2ea1f307..6c8541ef62 100644
--- a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
@@ -92,7 +92,7 @@ int button_read_device(int *data)
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 09787289ac..6576afb09c 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_init(void)
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 c50ce6a128..4ebe3144cf 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 0cebc1bd5c..0b338c1640 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 @@ static void _backlight_write_brightness(int brightness)
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 @@ void _backlight_on(void)
#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 @@ bool _backlight_init(void)
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 ab8ceacbb1..5e91cd691a 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 b001032322..e21e1fa193 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 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
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 d9e0d52191..77348317a6 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 @@ bool ide_powered(void)
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 c8b2c9623c..611bdbfde5 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 void handle_wheel(unsigned char wheel)
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 4104c21e52..c65d806635 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 @@ static void _backlight_write_brightness(int brightness)
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 @@ void _backlight_on(void)
#endif
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
_backlight_write_brightness(0);
@@ -77,23 +77,23 @@ void _backlight_off(void)
}
/* 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 89bd837cee..3a6fc8cf11 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 0b4ee51275..1163d6acb7 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 @@ bool _backlight_init(void)
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 7c3ba979a3..fdc8438ea7 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 daa613810e..2738a327c9 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 @@ void _backlight_on(void)
restore_irq(level);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
int level = disable_irq_save();
@@ -49,12 +49,12 @@ void _backlight_off(void)
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 43e8a2cbe2..38acdd0e5f 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 2b5281c23e..1d9bee0545 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 8a06c7d653..de8b3d8e14 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 @@ void _backlight_on(void)
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 @@ void _backlight_off(void)
}
/* 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 @@ void _backlight_set_brightness(int val)
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 47c02cb351..1f582ec8df 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 @@ void _backlight_hw_off(void)
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 5cd6fa7133..64d0353ab0 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 64e09b9b40..9e44dfa80e 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 @@ bool _backlight_init(void)
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 @@ void _backlight_set_brightness(int val)
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 046a8fba8b..1ea9087a7b 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 1e40e9bb88..e04fa6d7dc 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 @@ bool _backlight_init(void)
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 @@ void _backlight_hw_off(void)
{
/* 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 @@ void _backlight_set_brightness(int val)
_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 93b1f309fb..b73bf27c89 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 fda26dd0df..e84b8d442b 100644
--- a/firmware/target/coldfire/mpio/hd300/button-hd300.c
+++ b/firmware/target/coldfire/mpio/hd300/button-hd300.c
@@ -80,7 +80,7 @@ void scrollstrip_isr(void)
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 @@ void scrollstrip_isr(void)
}
/* 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 98dbcb8abe..8eb4c58191 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 @@ void _backlight_on(void)
lcd_enable(true);
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
FILE * f;
@@ -62,7 +62,7 @@ void _backlight_off(void)
}
-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 67836aa790..0dc7ce387a 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 21db75c8c9..138c2ccd3c 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 5555b30473..353ab15c48 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_on(void)
}
-void _backlight_off(void)
+void backlight_hw_off(void)
{
if (backlight_on_status)
{
@@ -66,7 +66,7 @@ void _backlight_off(void)
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 e4f0457cf9..7f9cc1e729 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 67836aa790..0dc7ce387a 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 7f834129b3..aacfe36f82 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 @@ static void set_backlight(int val)
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 @@ bool _backlight_init(void)
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 @@ void _backlight_set_brightness(int brightness)
/* 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 d06cb28f40..a810fde704 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 @@ int button_read_device(int *data)
#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 67836aa790..0dc7ce387a 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 ab232baf65..5ef500a69b 100644
--- a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
@@ -272,7 +272,7 @@ void exception_handler(void* stack_ptr, unsigned int cause, unsigned int epc)
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 9eff09016a..c3dd395eca 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 9dd3eb1cf9..438c8c926a 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 @@ static inline bool _backlight_init(void)
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 86026777fa..d7bbc08f4f 100644
--- a/firmware/target/sh/archos/ondio/power-ondio.c
+++ b/firmware/target/sh/archos/ondio/power-ondio.c
@@ -70,7 +70,7 @@ void power_off(void)
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 71d6a935bc..b97d21a40f 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 @@ static inline bool _backlight_init(void)
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 9eff09016a..c3dd395eca 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,