1
0
Fork 0
forked from nuttx/nuttx-update

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

View file

@ -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,
};

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
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

View file

@ -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;
}

View file

@ -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.
*/