mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
The RTC ioctl() method is now a configuration option
This commit is contained in:
@@ -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,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user