diff options
Diffstat (limited to 'firmware/target/hosted/samsungypr/ypr1/gpio-target.h')
-rw-r--r-- | firmware/target/hosted/samsungypr/ypr1/gpio-target.h | 67 |
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 | |||
62 | void gpio_init(void); | ||
63 | void gpio_close(void); | ||
64 | int gpio_control_struct(int request, struct gpio_info pin); | ||
65 | int gpio_control(int request, int num, int mode, int val); | ||
66 | |||
67 | #endif /* GPIO_TARGET_H */ | ||