summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/android/dx50/backlight-dx50.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/android/dx50/backlight-dx50.c')
-rw-r--r--firmware/target/hosted/android/dx50/backlight-dx50.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/firmware/target/hosted/android/dx50/backlight-dx50.c b/firmware/target/hosted/android/dx50/backlight-dx50.c
deleted file mode 100644
index 8eb4c58191..0000000000
--- a/firmware/target/hosted/android/dx50/backlight-dx50.c
+++ /dev/null
@@ -1,76 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2011 by Lorenzo Miori
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20#include "config.h"
21#include "system.h"
22#include "backlight.h"
23#include "backlight-target.h"
24#include "lcd.h"
25#include "lcd-target.h"
26#include <fcntl.h>
27#include <stdio.h>
28#include "unistd.h"
29
30bool backlight_hw_init(void)
31{
32 /* We have nothing to do */
33 return true;
34}
35
36void backlight_hw_on(void)
37{
38 FILE *f = fopen("/sys/power/state", "w");
39 fputs("on", f);
40 fclose(f);
41 lcd_enable(true);
42}
43
44void backlight_hw_off(void)
45{
46 FILE * f;
47
48 /* deny the player to sleep deep */
49 f = fopen("/sys/power/wake_lock", "w");
50 fputs("player", f);
51 fclose(f);
52
53 /* deny the player to mute */
54 f = fopen("/sys/class/codec/wm8740_mute", "w");
55 fputc(0, f);
56 fclose(f);
57
58 /* turn off backlight */
59 f = fopen("/sys/power/state", "w");
60 fputs("mem", f);
61 fclose(f);
62
63}
64
65void backlight_hw_brightness(int brightness)
66{
67 /* Just another check... */
68 if (brightness > MAX_BRIGHTNESS_SETTING)
69 brightness = MAX_BRIGHTNESS_SETTING;
70 if (brightness < MIN_BRIGHTNESS_SETTING)
71 brightness = MIN_BRIGHTNESS_SETTING;
72
73 FILE *f = fopen("/sys/devices/platform/rk29_backlight/backlight/rk28_bl/brightness", "w");
74 fprintf(f, "%d", brightness);
75 fclose(f);
76}