drivers: rtc: add system calls

rtc_set_config() omitted since it registers a callback.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-10-25 13:26:14 -07:00 committed by Andrew Boie
commit 9ca42fb033
3 changed files with 41 additions and 6 deletions

View file

@ -1 +1,2 @@
obj-$(CONFIG_RTC_QMSI) += rtc_qmsi.o
obj-$(CONFIG_USERSPACE) += rtc_handlers.o

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <syscall_handler.h>
#include <rtc.h>
_SYSCALL_HANDLER1_SIMPLE(rtc_read, K_OBJ_DRIVER_RTC, struct device *);
_SYSCALL_HANDLER1_SIMPLE_VOID(rtc_enable, K_OBJ_DRIVER_RTC, struct device *);
_SYSCALL_HANDLER1_SIMPLE_VOID(rtc_disable, K_OBJ_DRIVER_RTC, struct device *);
_SYSCALL_HANDLER(rtc_set_alarm, dev, alarm_val)
{
_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RTC);
return _impl_rtc_set_alarm((struct device *)dev, alarm_val);
}
_SYSCALL_HANDLER1_SIMPLE(rtc_get_pending_int, K_OBJ_DRIVER_RTC,
struct device *);