diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-02-18 08:23:10 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-02-18 08:23:10 -0600 |
commit | c875dcfd8a753cd131d39e1efa5f34642200e52c (patch) | |
tree | c7bc9abc91fc3aa5ad3ef5ceb01ca0510713776b | |
parent | 1aa475c18f1aa490ed96555f848a617f80feede8 (diff) | |
download | nuttx-c875dcfd8a753cd131d39e1efa5f34642200e52c.tar.gz nuttx-c875dcfd8a753cd131d39e1efa5f34642200e52c.tar.bz2 nuttx-c875dcfd8a753cd131d39e1efa5f34642200e52c.zip |
The RTC ioctl() method is now a configuration option
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_rtc_lowerhalf.c | 2 | ||||
-rw-r--r-- | nuttx/drivers/timers/Kconfig | 7 | ||||
-rw-r--r-- | nuttx/drivers/timers/rtc.c | 2 | ||||
-rw-r--r-- | nuttx/include/nuttx/rtc.h | 4 |
4 files changed, 14 insertions, 1 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_rtc_lowerhalf.c b/nuttx/arch/arm/src/stm32/stm32_rtc_lowerhalf.c index 7c4aaf221..c56970b0c 100644 --- a/nuttx/arch/arm/src/stm32/stm32_rtc_lowerhalf.c +++ b/nuttx/arch/arm/src/stm32/stm32_rtc_lowerhalf.c @@ -118,7 +118,9 @@ static const struct rtc_ops_s g_rtc_ops = .rdwkalm = NULL, .setwkalm = NULL, #endif +#ifdef CONFIG_RTC_IOCTL .ioctl = NULL, +#endif .destroy = NULL, }; diff --git a/nuttx/drivers/timers/Kconfig b/nuttx/drivers/timers/Kconfig index af0fb3e42..ee4698d88 100644 --- a/nuttx/drivers/timers/Kconfig +++ b/nuttx/drivers/timers/Kconfig @@ -107,6 +107,13 @@ config RTC_EPOCHYEAR With some RTCs, these operations can be used to read or to set the RTC's Epoch, respectively. +config RTC_IOCTL + bool "RTC IOCTLs" + default n + ---help--- + Support the RTC interface ioctl() method. This allows you to add + architecture-specific RTC operations to the RTC interface + endif # RTC_DRIVER endif # RTC diff --git a/nuttx/drivers/timers/rtc.c b/nuttx/drivers/timers/rtc.c index f3231ded1..6550131e4 100644 --- a/nuttx/drivers/timers/rtc.c +++ b/nuttx/drivers/timers/rtc.c @@ -509,10 +509,12 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) default: { ret = -ENOTTY; +#ifdef CONFIG_RTC_IOCTL if (ops->ioctl) { ret = ops->ioctl(upper->lower, cmd, arg); } +#endif } break; } diff --git a/nuttx/include/nuttx/rtc.h b/nuttx/include/nuttx/rtc.h index d9a4e45d7..ba8add61a 100644 --- a/nuttx/include/nuttx/rtc.h +++ b/nuttx/include/nuttx/rtc.h @@ -416,11 +416,13 @@ struct rtc_ops_s FAR const struct rtc_wkalrm *wkalrm); #endif +#ifdef CONFIG_RTC_IOCTL /* Support for architecture-specific RTC operations */ CODE int (*ioctl)(FAR struct rtc_lowerhalf_s *lower, int cmd, unsigned long arg); - +#endif + /* The driver has been unlinked and there are no further open references * to the driver. */ |