summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-08-27 15:53:22 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2017-08-27 17:33:29 +0200
commit7ce764cdc3fc8ce40c81097ca61602cfc61885f5 (patch)
tree26c40a0ee0ad5a1fed27beb40ce01a626eb31dd0
parentb13f6e5b67abda2e466731f39d221eec2c9eb576 (diff)
downloadrockbox-7ce764cdc3fc8ce40c81097ca61602cfc61885f5.tar.gz
rockbox-7ce764cdc3fc8ce40c81097ca61602cfc61885f5.tar.bz2
rockbox-7ce764cdc3fc8ce40c81097ca61602cfc61885f5.zip
zen/zenxfi: fix backlight white flash on backlight on
Change-Id: If028a208bd10f46dbe25e4aade085ba7ba13d7be
-rw-r--r--firmware/target/arm/imx233/creative-zen/backlight-zen.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/firmware/target/arm/imx233/creative-zen/backlight-zen.c b/firmware/target/arm/imx233/creative-zen/backlight-zen.c
index ef2ab615a5..7d99092e2f 100644
--- a/firmware/target/arm/imx233/creative-zen/backlight-zen.c
+++ b/firmware/target/arm/imx233/creative-zen/backlight-zen.c
@@ -27,6 +27,7 @@
#include "uartdbg-imx233.h"
#include "pinctrl-imx233.h"
#include "pwm-imx233.h"
+#include "kernel.h"
void backlight_hw_brightness(int level)
{
@@ -37,15 +38,9 @@ void backlight_hw_brightness(int level)
lcd_set_contrast(level);
#else
unsigned val = (level + 200) * level / 1000;
- if(level != 0)
- {
- for(unsigned mask = 0x10; mask; mask >>= 1)
- imx233_uartdbg_send((val & mask) ? 0xff : 0xf8);
- imx233_uartdbg_send(0);
- imx233_pinctrl_set_gpio(1, 12, true);
- }
- else
- imx233_pinctrl_set_gpio(1, 12, false);
+ for(unsigned mask = 0x10; mask; mask >>= 1)
+ imx233_uartdbg_send((val & mask) ? 0xff : 0xf8);
+ imx233_uartdbg_send(0);
#endif
}
@@ -64,7 +59,9 @@ void backlight_hw_on(void)
{
#ifdef HAVE_LCD_ENABLE
lcd_enable(true); /* power on lcd + visible display */
+ sleep(HZ / 10); /* make sure screen is not white anymore */
#endif
+ imx233_pinctrl_set_gpio(1, 12, true);
/* restore the previous backlight level */
backlight_hw_brightness(backlight_brightness);
}
@@ -73,6 +70,7 @@ void backlight_hw_off(void)
{
/* there is no real on/off but we can set to 0 brightness */
backlight_hw_brightness(0);
+ imx233_pinctrl_set_gpio(1, 12, false);
#ifdef HAVE_LCD_ENABLE
lcd_enable(false); /* power off visible display */
#endif