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/gpio_ypr.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/gpio_ypr.c')
-rw-r--r-- | firmware/target/hosted/samsungypr/gpio_ypr.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/target/hosted/samsungypr/gpio_ypr.c b/firmware/target/hosted/samsungypr/gpio_ypr.c index 40855fba41..1782d4cfe4 100644 --- a/firmware/target/hosted/samsungypr/gpio_ypr.c +++ b/firmware/target/hosted/samsungypr/gpio_ypr.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * | 8 | * |
9 | * Module wrapper for GPIO, using /dev/r0GPIO (r0Gpio.ko) of Samsung YP-R0 | 9 | * Module wrapper for GPIO, using kernel module of Samsung YP-R0/YP-R1 |
10 | * | 10 | * |
11 | * Copyright (c) 2011 Lorenzo Miori | 11 | * Copyright (c) 2011 Lorenzo Miori |
12 | * | 12 | * |
@@ -26,23 +26,23 @@ | |||
26 | #include <gpio-target.h> /* includes common ioctl device definitions */ | 26 | #include <gpio-target.h> /* includes common ioctl device definitions */ |
27 | #include <sys/ioctl.h> | 27 | #include <sys/ioctl.h> |
28 | 28 | ||
29 | static int r0_gpio_dev = 0; | 29 | static int gpio_dev = 0; |
30 | 30 | ||
31 | void gpio_init(void) | 31 | void gpio_init(void) |
32 | { | 32 | { |
33 | r0_gpio_dev = open("/dev/r0GPIO", O_RDONLY); | 33 | gpio_dev = open(GPIO_DEVICE, O_RDONLY); |
34 | if (r0_gpio_dev < 0) | 34 | if (gpio_dev < 0) |
35 | printf("/dev/r0GPIO open error!"); | 35 | printf("GPIO device open error!"); |
36 | } | 36 | } |
37 | 37 | ||
38 | void gpio_close(void) | 38 | void gpio_close(void) |
39 | { | 39 | { |
40 | if (r0_gpio_dev >= 0) | 40 | if (gpio_dev >= 0) |
41 | close(r0_gpio_dev); | 41 | close(gpio_dev); |
42 | } | 42 | } |
43 | 43 | ||
44 | int gpio_control(int request, int num, int mode, int val) | 44 | int gpio_control(int request, int num, int mode, int val) |
45 | { | 45 | { |
46 | struct gpio_info r = { .num = num, .mode = mode, .val = val, }; | 46 | struct gpio_info r = { .num = num, .mode = mode, .val = val, }; |
47 | return ioctl(r0_gpio_dev, request, &r); | 47 | return ioctl(gpio_dev, request, &r); |
48 | } | 48 | } |