rtc: Convert wm8350 use new alarm and update operations
Subsystems (2)
PATCH 1/1 rtc: Convert wm8350 use new alarm and update operations
These are the only two ioctls so the ioctl() function is also removed.
Signed-off-by Mark Brown <[email protected]>
--- drivers/rtc/rtc-wm8350.c | 39 ++++++++++++++++++--------------------- 1 files changed, 18 insertions(+), 21 deletions(-)
drivers/rtc/rtc-wm8350.c +18 -21
@@ -236,6 +236,17 @@ static int wm8350_rtc_start_alarm(struct wm8350 *wm8350)return 0 ; } +static int wm8350_rtc_alarm_irq_enable (struct device *dev, +unsigned int enabled) +{ +struct wm8350 *wm8350 =dev_get_drvdata (dev); + +if (enabled) +return wm8350_rtc_start_alarm (wm8350); +else +return wm8350_rtc_stop_alarm (wm8350); +} +static int wm8350_rtc_setalarm (struct device *dev,struct rtc_wkalrm *alrm) {struct wm8350 *wm8350 =dev_get_drvdata (dev);
@@ -291,30 +302,15 @@ static int wm8350_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)return ret; } -/* -* Handle commands from user-space -*/ -static int wm8350_rtc_ioctl (struct device *dev,unsigned int cmd, -unsigned long arg) +static int wm8350_rtc_update_irq_enable (struct device *dev, +unsigned int enabled) {struct wm8350 *wm8350 =dev_get_drvdata (dev); -switch (cmd) { -case RTC_AIE_OFF : -return wm8350_rtc_stop_alarm (wm8350); -case RTC_AIE_ON : -return wm8350_rtc_start_alarm (wm8350); - -case RTC_UIE_OFF : -wm8350_mask_irq (wm8350,WM8350_IRQ_RTC_SEC ); -break ; -case RTC_UIE_ON : +if (enabled)wm8350_unmask_irq (wm8350,WM8350_IRQ_RTC_SEC ); -break ; - -default : -return -ENOIOCTLCMD ; - } +else +wm8350_mask_irq (wm8350,WM8350_IRQ_RTC_SEC );return 0 ; }
@@ -345,11 +341,12 @@ static void wm8350_rtc_update_handler(struct wm8350 *wm8350, int irq, }static const struct rtc_class_ops wm8350_rtc_ops = { - .ioctl = wm8350_rtc_ioctl, .read_time = wm8350_rtc_readtime, .set_time = wm8350_rtc_settime, .read_alarm = wm8350_rtc_readalarm, .set_alarm = wm8350_rtc_setalarm, + .alarm_irq_enable = wm8350_rtc_alarm_irq_enable, + .update_irq_enable = wm8350_rtc_update_irq_enable, };#ifdef CONFIG_PM
Signature · 1 line
1.5.6.5
Quoted 3 lines · On Wed, 7 Jan 2009 13:14:29 +0000 Mark Brown…
These are the only two ioctls so the
ioctl()function is also removed.Signed-off-by Mark Brown <[email protected]>
Acked-by Alessandro Zummo <[email protected]>
Signature · 6 lines
Best regards, Alessandro Zummo, Tower Technologies - Torino, Italy http://www.towertech.it