forked from nuttx/nuttx-update
The RTC ioctl() method is now a configuration option
This commit is contained in:
parent
f94e601981
commit
e2336a07bb
4 changed files with 14 additions and 1 deletions
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue