summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/android/dx50/backlight-dx50.c
diff options
context:
space:
mode:
authorUdo Schläpfer <rockbox-2014.10@desktopwarrior.net>2015-02-02 21:44:29 +0100
committerUdo Schläpfer <rockbox-2014.10@desktopwarrior.net>2015-02-02 21:57:55 +0100
commitdbabd0d9c34a33bc0c51243ec37f230d117db955 (patch)
tree46de348929ce739702a230a2587fdb5539585753 /firmware/target/hosted/android/dx50/backlight-dx50.c
parentcef17e3d59ad93f766e8ee23b1610540a33dfe5e (diff)
downloadrockbox-dbabd0d9c34a33bc0c51243ec37f230d117db955.tar.gz
rockbox-dbabd0d9c34a33bc0c51243ec37f230d117db955.zip
iBasso DX50/DX90: Major code cleanup and reorganization.
Reorganization - Separated iBasso devices from PLATFORM_ANDROID. These are now standlone hosted targets. Most device specific code is in the firmware/target/hosted/ibasso directory. - No dependency on Android SDK, only the Android NDK is needed. 32 bit Android NDK and Android API Level 16. - Separate implementation for each device where feasible. Code cleanup - Rewrite of existing code, from simple reformat to complete reimplementation. - New backlight interface, seperating backlight from touchscreen. - Rewrite of device button handler, removing unneeded code and fixing memory leaks. - New Debug messages interface logging to Android adb logcat (DEBUGF, panicf, logf). - Rewrite of lcd device handler, removing unneeded code and fixing memory leaks. - Rewrite of audiohw device handler/pcm interface, removing unneeded code and fixing memory leaks, enabling 44.1/48kHz pthreaded playback. - Rewrite of power and powermng, proper shutdown, using batterylog results (see http://gerrit.rockbox.org/r/#/c/1047/). - Rewrite of configure (Android NDK) and device specific config. - Rewrite of the Android NDK specific Makefile. Misc - All plugins/games/demos activated. - Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa. Includes - http://gerrit.rockbox.org/r/#/c/993/ - http://gerrit.rockbox.org/r/#/c/1010/ - http://gerrit.rockbox.org/r/#/c/1035/ Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight interface and new option for hold switch, touchscreen, physical button interaction. Rockbox needs the iBasso DX50/DX90 loader for startup, see http://gerrit.rockbox.org/r/#/c/1099/ The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If /mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit gracefully and the loader will restart Rockbox on USB disconnect. Tested on iBasso DX50. Compiled (not tested) for iBasso DX90. Compiled (not tested) for PLATFORM_ANDROID. Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7
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}