summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/samsungypr/gpio_ypr.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/samsungypr/gpio_ypr.c')
-rw-r--r--firmware/target/hosted/samsungypr/gpio_ypr.c16
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
29static int r0_gpio_dev = 0; 29static int gpio_dev = 0;
30 30
31void gpio_init(void) 31void 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
38void gpio_close(void) 38void 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
44int gpio_control(int request, int num, int mode, int val) 44int 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}