The RTC ioctl() method is now a configuration option

This commit is contained in:
Gregory Nutt
2015-02-18 08:23:10 -06:00
parent f94e601981
commit e2336a07bb
4 changed files with 14 additions and 1 deletions
+2
View File
@@ -118,7 +118,9 @@ static const struct rtc_ops_s g_rtc_ops =
.rdwkalm = NULL, .rdwkalm = NULL,
.setwkalm = NULL, .setwkalm = NULL,
#endif #endif
#ifdef CONFIG_RTC_IOCTL
.ioctl = NULL, .ioctl = NULL,
#endif
.destroy = NULL, .destroy = NULL,
}; };
+7
View File
@@ -107,6 +107,13 @@ config RTC_EPOCHYEAR
With some RTCs, these operations can be used to read or to set the RTC's With some RTCs, these operations can be used to read or to set the RTC's
Epoch, respectively. 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_DRIVER
endif # RTC endif # RTC
+2
View File
@@ -509,10 +509,12 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
default: default:
{ {
ret = -ENOTTY; ret = -ENOTTY;
#ifdef CONFIG_RTC_IOCTL
if (ops->ioctl) if (ops->ioctl)
{ {
ret = ops->ioctl(upper->lower, cmd, arg); ret = ops->ioctl(upper->lower, cmd, arg);
} }
#endif
} }
break; break;
} }
+2
View File
@@ -416,10 +416,12 @@ struct rtc_ops_s
FAR const struct rtc_wkalrm *wkalrm); FAR const struct rtc_wkalrm *wkalrm);
#endif #endif
#ifdef CONFIG_RTC_IOCTL
/* Support for architecture-specific RTC operations */ /* Support for architecture-specific RTC operations */
CODE int (*ioctl)(FAR struct rtc_lowerhalf_s *lower, int cmd, CODE int (*ioctl)(FAR struct rtc_lowerhalf_s *lower, int cmd,
unsigned long arg); unsigned long arg);
#endif
/* The driver has been unlinked and there are no further open references /* The driver has been unlinked and there are no further open references
* to the driver. * to the driver.