diff options
author | Lorenzo Miori <memorys60@gmail.com> | 2013-02-23 16:59:49 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2013-03-06 00:21:22 +0100 |
commit | 60592165ca998875e4bc46c4396c5a123a7e9dbb (patch) | |
tree | 60b53e6b733fd49bef249761789e97a4bedbef03 /firmware/target/hosted/samsungypr/ypr0/gpio-target.h | |
parent | 3e4be68f8b596cf3467f993dc9a210a3d901ca1c (diff) | |
download | rockbox-60592165ca998875e4bc46c4396c5a123a7e9dbb.tar.gz rockbox-60592165ca998875e4bc46c4396c5a123a7e9dbb.zip |
Samsung YP-R0 hosted target code refactoring
As per title this patch aims at splitting common target
code and specific target code in a better way to
support future ports within the same environment
(e.g. Samsung YP-R1 where the Linux and the SoC
are the same, with differences in hardware devices
handling)
Change-Id: I67b4918c46403b184d3d8f42ab5aae7d01037fd0
Reviewed-on: http://gerrit.rockbox.org/409
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'firmware/target/hosted/samsungypr/ypr0/gpio-target.h')
-rw-r--r-- | firmware/target/hosted/samsungypr/ypr0/gpio-target.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/firmware/target/hosted/samsungypr/ypr0/gpio-target.h b/firmware/target/hosted/samsungypr/ypr0/gpio-target.h new file mode 100644 index 0000000000..3c2033baff --- /dev/null +++ b/firmware/target/hosted/samsungypr/ypr0/gpio-target.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Module wrapper for GPIO, using /dev/r0GPIO (r0Gpio.ko) of Samsung YP-R0 | ||
10 | * | ||
11 | * Copyright (c) 2011 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_YPR0_H | ||
24 | #define GPIO_YPR0_H | ||
25 | |||
26 | #include "r0GPIOIoctl.h" | ||
27 | |||
28 | /* Some meaningful pins used in the R0 */ | ||
29 | |||
30 | #define GPIO_HEADPHONE_SENSE GPIO1_5 | ||
31 | #define GPIO_EXT_PWR_SENSE GPIO1_26 | ||
32 | #define GPIO_SD_SENSE GPIO2_27 | ||
33 | #define GPIO_AS3543_INTERUPT GPIO1_25 | ||
34 | #define GPIO_PCB_VER_DETECT GPIO_10 | ||
35 | /* I2C bus for AS3543 codec */ | ||
36 | #define GPIO_I2C_CLK0 GPIO_1_0 | ||
37 | #define GPIO_I2C_DAT0 GPIO_1_1 | ||
38 | /* I2C bus for the SI4079 FM radio chip */ | ||
39 | #define GPIO_I2C_CLK1 GPIO_2_12 | ||
40 | #define GPIO_I2C_DAT1 GPIO_2_13 | ||
41 | #define GPIO_FM_SEARCH GPIO1_4 | ||
42 | #define GPIO_FM_BUS_EN GPIO2_19 | ||
43 | |||
44 | /* Keypad */ | ||
45 | |||
46 | #define GPIO_BACK_KEY GPIO2_29 | ||
47 | #define GPIO_USER_KEY GPIO2_30 | ||
48 | #define GPIO_MENU_KEY GPIO2_31 | ||
49 | #define GPIO_POWER_KEY GPIO2_16 | ||
50 | #define GPIO_CENTRAL_KEY GPIO3_5 | ||
51 | #define GPIO_UP_KEY GPIO3_9 | ||
52 | #define GPIO_DOWN_KEY GPIO3_8 | ||
53 | #define GPIO_LEFT_KEY GPIO2_28 | ||
54 | #define GPIO_RIGHT_KEY GPIO3_7 | ||
55 | |||
56 | |||
57 | void gpio_init(void); | ||
58 | void gpio_close(void); | ||
59 | int gpio_control_struct(int request, R0GPIOInfo pin); | ||
60 | int gpio_control(int request, int num, int mode, int val); | ||
61 | |||
62 | #endif | ||