aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-25 18:55:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-25 18:55:33 -0700
commitc13c81006314ad76c2b31824960a900385601b8b (patch)
tree749f71b07f252960775c42bd1141d21cb35a768d /include
parentMerge branch 'i2c/for-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux (diff)
parentrtc: remove useless I2C dependencies (diff)
downloadlinux-dev-c13c81006314ad76c2b31824960a900385601b8b.tar.xz
linux-dev-c13c81006314ad76c2b31824960a900385601b8b.zip
Merge tag 'rtc-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Core: - Coding style and whitespace fixes (interface, Makefile and Kconfig) - New rtc_tm_sub() helper - New CONFIG_RTC_SYSTOHC_DEVICE option - Removed rtc_set_mmss() New drivers: - Mediatek MT6397 - Cortina Gemini Drivers: - Year 2106 fixes for isl1208, pcf8563 and sunxi - update author email for at32ap700x and efi - ds1307: alarm fix - efi: use correct EFI 'epoch' - hym8563: make irq optional - imxdi: cleanups and better handling of the security/tamper monitoring - snvs: fix wakealarm - Compilation fixes or warning removal for gemini, mt6397, palmas, pfc8563 - Trivial cleanups for ab8500, ds1216, ds1286, ds1672, ep93xx, hid-sensor-time, max6900, max8998, max77686, max77802, mc13xxx, mv, mxc, s3c, spear, v3020 - Kconfig fixes for stmp3xxx and xgene" * tag 'rtc-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (48 commits) rtc: remove useless I2C dependencies rtc: whitespace fixes rtc: Properly sort Makefile MAINTAINERS: Add RTC subsystem repository rtc: pfc8563: fix uninitialized variable warning rtc: ds1307: Enable the mcp794xx alarm after programming time rtc: hym8563: make the irq optional rtc: gemini: fix cocci warnings rtc: mv: correct 24 hour error message rtc: mv: use BIT() rtc: efi: use correct EFI 'epoch' rtc: interface: Remove rtc_set_mmss() sparc: time: Replace update_persistent_clock() with CONFIG_RTC_SYSTOHC rtc: NTP: Add CONFIG_RTC_SYSTOHC_DEVICE for NTP synchronization rtc: sunxi: Replace deprecated rtc_tm_to_time() rtc: isl1208: Replace deprecated rtc_tm_to_time() rtc: Introduce rtc_tm_sub() helper function rtc: pcf8563: Replace deprecated rtc_time_to_tm() and rtc_tm_to_time() rtc: palmas: Initialise bb_charging flag before using it rtc: simplify use of devm_ioremap_resource ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/rtc.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 8dcf6825fa88..3359f0422c6b 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -24,6 +24,14 @@ extern void rtc_time64_to_tm(time64_t time, struct rtc_time *tm);
ktime_t rtc_tm_to_ktime(struct rtc_time tm);
struct rtc_time rtc_ktime_to_tm(ktime_t kt);
+/*
+ * rtc_tm_sub - Return the difference in seconds.
+ */
+static inline time64_t rtc_tm_sub(struct rtc_time *lhs, struct rtc_time *rhs)
+{
+ return rtc_tm_to_time64(lhs) - rtc_tm_to_time64(rhs);
+}
+
/**
* Deprecated. Use rtc_time64_to_tm().
*/
@@ -101,8 +109,7 @@ struct rtc_timer {
/* flags */
#define RTC_DEV_BUSY 0
-struct rtc_device
-{
+struct rtc_device {
struct device dev;
struct module *owner;
@@ -161,7 +168,6 @@ extern void devm_rtc_device_unregister(struct device *dev,
extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm);
extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm);
-extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs);
extern int rtc_set_ntp_time(struct timespec64 now);
int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm);
extern int rtc_read_alarm(struct rtc_device *rtc,
@@ -198,10 +204,10 @@ int rtc_register(rtc_task_t *task);
int rtc_unregister(rtc_task_t *task);
int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg);
-void rtc_timer_init(struct rtc_timer *timer, void (*f)(void* p), void* data);
-int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer* timer,
- ktime_t expires, ktime_t period);
-int rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer* timer);
+void rtc_timer_init(struct rtc_timer *timer, void (*f)(void *p), void *data);
+int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer *timer,
+ ktime_t expires, ktime_t period);
+void rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer *timer);
void rtc_timer_do_work(struct work_struct *work);
static inline bool is_leap_year(unsigned int year)