summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ryabinin <ryabinin.a.a@gmail.com>2012-04-26 13:57:34 +0400
committerAndrew Ryabinin <ryabinin.a.a@gmail.com>2012-04-26 12:25:37 +0200
commit56e406d9b683a6e26b511a797b44ea30d677d32b (patch)
tree83588fa18ef49c4663b2ae668d4349b3474aa562
parentf40bfc9267b13b54e6379dfe7539447662879d24 (diff)
downloadrockbox-56e406d9b683a6e26b511a797b44ea30d677d32b.zip
rockbox-56e406d9b683a6e26b511a797b44ea30d677d32b.tar.gz
rockbox-56e406d9b683a6e26b511a797b44ea30d677d32b.tar.bz2
rockbox-56e406d9b683a6e26b511a797b44ea30d677d32b.tar.xz
hm60x/hm801: Increase backlight frequency. This will remove background hiss.
Change-Id: I3b51dc5592c069745a62f21f6f9004c79a1f3985 Reviewed-on: http://gerrit.rockbox.org/225 Tested-by: Andrew Ryabinin <ryabinin.a.a@gmail.com> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
-rw-r--r--firmware/target/arm/rk27xx/backlight-rk27xx.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/firmware/target/arm/rk27xx/backlight-rk27xx.c b/firmware/target/arm/rk27xx/backlight-rk27xx.c
index 06c9cc3..065b5ef 100644
--- a/firmware/target/arm/rk27xx/backlight-rk27xx.c
+++ b/firmware/target/arm/rk27xx/backlight-rk27xx.c
@@ -36,16 +36,32 @@ static int brightness = DEFAULT_BRIGHTNESS_SETTING;
* where Yn is luminance of reference white
*
* Actual function is lightly tweaked to account for the fact
- * that fill factor of the PWM below ~15% gives black.
+ * that fill factor of the PWM below some value gives black.
* So the function used to calculate the values in the matrix was:
- * f(x) = 42000 * ((100*x/31 + 16)/116)^3 + 8000
+ * f(x) = (PWM_FREQ_MAX - PWM_FREQ_MIN) * ((100*x/31 + 16)/116)^3 + PWM_FREQ_MIN
*/
+#ifdef RK27GENERIC
static const unsigned short lin_brightness[] = {
8110, 8191, 8304, 8455, 8649, 8892, 9189, 9545,
9966, 10457, 11024, 11671, 12406, 13232, 14156, 15182,
16316, 17565, 18932, 20423, 22045, 23801, 25699, 27742,
29937, 32289, 34803, 37485, 40340, 43374, 46592, 50000
};
+#elif defined(HM801)
+static const unsigned short lin_brightness[] = {
+ 541, 542, 543, 544, 547, 549, 553, 556,
+ 561, 566, 573, 580, 588, 597, 607, 618,
+ 631, 644, 659, 676, 693, 713, 733, 756,
+ 780, 806, 833, 862, 894, 927, 962, 1000
+};
+#elif defined(HM60X)
+static const unsigned short lin_brightness[] = {
+ 3, 5, 8, 11, 16, 22, 29, 37,
+ 47, 59, 72, 88, 105, 125, 147, 171,
+ 198, 228, 261, 296, 335, 376, 421, 470,
+ 522, 578, 638, 702, 770, 842, 918, 1000
+};
+#endif
bool _backlight_init(void)
{
@@ -61,9 +77,9 @@ bool _backlight_init(void)
/* DIV/2, PWM reset */
PWMT0_CTRL = (0<<9) | (1<<7);
- /* set pwm frequency to 500Hz - my lcd panel can't cope more reliably */
- /* (apb_freq/pwm_freq)/pwm_div = (50 000 000/500)/2 */
- PWMT0_LRC = 50000;
+ /* set pwm frequency */
+ /* (apb_freq/pwm_freq)/pwm_div = (50 000 000/pwm_freq)/2 */
+ PWMT0_LRC = lin_brightness[MAX_BRIGHTNESS_SETTING];
PWMT0_HRC = lin_brightness[brightness];
/* reset counter */