summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/samsungypr/ypr1/pmu-ypr1.c
diff options
context:
space:
mode:
authorLorenzo Miori <memoryS60@gmail.com>2013-09-10 22:48:34 +0200
committerThomas Martitz <kugel@rockbox.org>2014-02-05 09:56:21 +0100
commite876f4df6d240bd2e319b1e63be95a625f049a97 (patch)
treece2fe1b24650e3be7a6cd2d346d29090a5422a8c /firmware/target/hosted/samsungypr/ypr1/pmu-ypr1.c
parentb828b9d99bff2acc0e1f543f3176fd4b632cba68 (diff)
downloadrockbox-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.c51
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
28static int pmu_dev = -1;
29
30void 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
37void pmu_close(void)
38{
39 if (pmu_dev >= 0)
40 close(pmu_dev);
41}
42
43int pmu_get_dev(void)
44{
45 return pmu_dev;
46}
47
48int pmu_ioctl(int request, int *data)
49{
50 return ioctl(pmu_dev, request, data);
51}