summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2016-09-06 20:42:26 +0530
committerAmitesh Singh <amitesh.sh@samsung.com>2016-09-06 20:42:26 +0530
commita2e3b8ad134b7170dbd0ae585b331d87aa694cb6 (patch)
tree9fcac187b241db34ff0f94af5f61843a5ba3de50 /src/lib/eeze
parente14a11d9fa93c0958d3ae0892841be10b0f5e814 (diff)
eeze: add support of GPIO sysfs detection and watch.
This adds support for detection and watch of GPIO pins in /sys/class/gpio/* This detects both gpiochip<N> & gpio<N>. @feature
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/Eeze.h6
-rw-r--r--src/lib/eeze/eeze_udev_find.c3
-rw-r--r--src/lib/eeze/eeze_udev_watch.c8
3 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/eeze/Eeze.h b/src/lib/eeze/Eeze.h
index b44a1d0504..f5dab4230d 100644
--- a/src/lib/eeze/Eeze.h
+++ b/src/lib/eeze/Eeze.h
@@ -278,7 +278,11 @@ typedef enum
278 /** - Graphics 278 /** - Graphics
279 * @since 1.18 279 * @since 1.18
280 */ 280 */
281 EEZE_UDEV_TYPE_GRAPHICS 281 EEZE_UDEV_TYPE_GRAPHICS,
282 /** - GPIOS (includes gpioN and gpiochipN)
283 * @since 1.19
284 */
285 EEZE_UDEV_TYPE_GPIO
282} Eeze_Udev_Type; 286} Eeze_Udev_Type;
283/**@}*/ 287/**@}*/
284 288
diff --git a/src/lib/eeze/eeze_udev_find.c b/src/lib/eeze/eeze_udev_find.c
index 8850882938..8551d48bf2 100644
--- a/src/lib/eeze/eeze_udev_find.c
+++ b/src/lib/eeze/eeze_udev_find.c
@@ -249,6 +249,9 @@ eeze_udev_find_by_type(Eeze_Udev_Type etype,
249 case EEZE_UDEV_TYPE_GRAPHICS: 249 case EEZE_UDEV_TYPE_GRAPHICS:
250 udev_enumerate_add_match_subsystem(en, "graphics"); 250 udev_enumerate_add_match_subsystem(en, "graphics");
251 break; 251 break;
252 case EEZE_UDEV_TYPE_GPIO:
253 udev_enumerate_add_match_subsystem(en, "gpio");
254 break;
252 255
253 default: 256 default:
254 break; 257 break;
diff --git a/src/lib/eeze/eeze_udev_watch.c b/src/lib/eeze/eeze_udev_watch.c
index bc00618473..eccd61c3d1 100644
--- a/src/lib/eeze/eeze_udev_watch.c
+++ b/src/lib/eeze/eeze_udev_watch.c
@@ -262,6 +262,11 @@ _get_syspath_from_watch(void *data,
262 || (strcmp(test, "graphics"))) 262 || (strcmp(test, "graphics")))
263 goto error; 263 goto error;
264 break; 264 break;
265 case EEZE_UDEV_TYPE_GPIO:
266 if ((!(test = udev_device_get_subsystem(device)))
267 || (strcmp(test, "gpio")))
268 goto error;
269 break;
265 270
266 default: 271 default:
267 break; 272 break;
@@ -350,6 +355,9 @@ eeze_udev_watch_add(Eeze_Udev_Type type,
350 case EEZE_UDEV_TYPE_GRAPHICS: 355 case EEZE_UDEV_TYPE_GRAPHICS:
351 udev_monitor_filter_add_match_subsystem_devtype(mon, "graphics", NULL); 356 udev_monitor_filter_add_match_subsystem_devtype(mon, "graphics", NULL);
352 break; 357 break;
358 case EEZE_UDEV_TYPE_GPIO:
359 udev_monitor_filter_add_match_subsystem_devtype(mon, "gpio", NULL);
360 break;
353 361
354 default: 362 default:
355 break; 363 break;