diff options
author | Lorenzo Miori <memoryS60@gmail.com> | 2013-09-10 22:48:34 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-02-05 09:56:21 +0100 |
commit | e876f4df6d240bd2e319b1e63be95a625f049a97 (patch) | |
tree | ce2fe1b24650e3be7a6cd2d346d29090a5422a8c /firmware/target/hosted/samsungypr/ypr1/pmu-ypr1.c | |
parent | b828b9d99bff2acc0e1f543f3176fd4b632cba68 (diff) | |
download | rockbox-e876f4df6d240bd2e319b1e63be95a625f049a97.tar.gz rockbox-e876f4df6d240bd2e319b1e63be95a625f049a97.zip |
Samsung YP-R1 target port
This is the basic port to the new target Samsung
YP-R1, which runs on a similar platform as YP-R0.
Port is usable, although there are still
some optimizations that have to be done.
Change-Id: If83a8e386369e413581753780c159026d9e41f04
Diffstat (limited to 'firmware/target/hosted/samsungypr/ypr1/pmu-ypr1.c')
-rw-r--r-- | firmware/target/hosted/samsungypr/ypr1/pmu-ypr1.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/firmware/target/hosted/samsungypr/ypr1/pmu-ypr1.c b/firmware/target/hosted/samsungypr/ypr1/pmu-ypr1.c new file mode 100644 index 0000000000..8a2a724ca4 --- /dev/null +++ b/firmware/target/hosted/samsungypr/ypr1/pmu-ypr1.c | |||
@@ -0,0 +1,51 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2013 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 | |||
21 | #include <stdio.h> | ||
22 | #include <unistd.h> | ||
23 | #include <fcntl.h> | ||
24 | |||
25 | #include "pmu-ypr1.h" | ||
26 | #include "panic.h" | ||
27 | |||
28 | static int pmu_dev = -1; | ||
29 | |||
30 | void pmu_init(void) | ||
31 | { | ||
32 | pmu_dev = open("/dev/r1Pmu", O_RDONLY); | ||
33 | if (pmu_dev < 0) | ||
34 | panicf("/dev/r1Pmu open error!"); | ||
35 | } | ||
36 | |||
37 | void pmu_close(void) | ||
38 | { | ||
39 | if (pmu_dev >= 0) | ||
40 | close(pmu_dev); | ||
41 | } | ||
42 | |||
43 | int pmu_get_dev(void) | ||
44 | { | ||
45 | return pmu_dev; | ||
46 | } | ||
47 | |||
48 | int pmu_ioctl(int request, int *data) | ||
49 | { | ||
50 | return ioctl(pmu_dev, request, data); | ||
51 | } | ||