summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/samsungypr/ypr1/gpio-target.h
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/gpio-target.h
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/gpio-target.h')
-rw-r--r--firmware/target/hosted/samsungypr/ypr1/gpio-target.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/firmware/target/hosted/samsungypr/ypr1/gpio-target.h b/firmware/target/hosted/samsungypr/ypr1/gpio-target.h
new file mode 100644
index 0000000000..f439e786de
--- /dev/null
+++ b/firmware/target/hosted/samsungypr/ypr1/gpio-target.h
@@ -0,0 +1,67 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Module wrapper for GPIO, using /dev/r1GPIO (r1Gpio.ko) of Samsung YP-R1
10 *
11 * Copyright (c) 2013 Lorenzo Miori
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#ifndef GPIO_TARGET_H
24#define GPIO_TARGET_H
25
26#include "ioctl-ypr1.h"
27
28/* Some meaningful pins used in the YP-R1 */
29
30#define GPIO_HEADPHONE_SENSE GPIO1_31
31/* I2C bus for the SI4079 FM, WM1808 codec and RTC radio chip */
32#define GPIO_I2C_CLK1 GPIO1_0
33#define GPIO_I2C_DAT1 GPIO1_1
34/* I2C bus for the fuel gauge MAX17040 */
35#define GPIO_I2C_CLK2 GPIO2_12
36#define GPIO_I2C_DAT2 GPIO2_13
37/* SI4079 pins - powerup and interrupt */
38#define GPIO_FM_SEARCH GPIO1_4
39#define GPIO_FM_BUS_EN GPIO1_10
40#define GPIO_MUTE GPIO2_17
41#define EXT_POWER_DET GPIO1_26
42/* Low disabled, high enabled */
43#define TV_OUT_ENABLE GPIO1_17
44/* Battery charging */
45#define CHARGE_ENABLE GPIO1_18
46#define CHARGE_STATUS GPIO_D13
47/* This should be high when connecting a special port to the board... */
48#define PBA_CHECK_ENABLED GPIO2_1
49/* TODO see if this is the source of massive battery drain
50 * touchscreen and usb 3.3v power control line
51 */
52#define POWER_3V3_LINE_CONTROL GPIO1_16
53
54/* Keypad */
55
56#define GPIO_VOL_UP_KEY GPIO1_20
57#define GPIO_VOL_DOWN_KEY GPIO1_21
58#define GPIO_POWER_KEY GPIO2_16
59
60#define GPIO_DEVICE "/dev/r1Gpio"
61
62void gpio_init(void);
63void gpio_close(void);
64int gpio_control_struct(int request, struct gpio_info pin);
65int gpio_control(int request, int num, int mode, int val);
66
67#endif /* GPIO_TARGET_H */