rtc: wm831x: use .set_time
Use .set_time instead of the deprecated .set_mmss. Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
d9aa5ca429
commit
498ce4e76b
|
@ -165,15 +165,17 @@ static int wm831x_rtc_readtime(struct device *dev, struct rtc_time *tm)
|
||||||
/*
|
/*
|
||||||
* Set current time and date in RTC
|
* Set current time and date in RTC
|
||||||
*/
|
*/
|
||||||
static int wm831x_rtc_set_mmss(struct device *dev, unsigned long time)
|
static int wm831x_rtc_settime(struct device *dev, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev);
|
struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev);
|
||||||
struct wm831x *wm831x = wm831x_rtc->wm831x;
|
struct wm831x *wm831x = wm831x_rtc->wm831x;
|
||||||
struct rtc_time new_tm;
|
struct rtc_time new_tm;
|
||||||
unsigned long new_time;
|
unsigned long time, new_time;
|
||||||
int ret;
|
int ret;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
time = rtc_tm_to_time64(tm);
|
||||||
|
|
||||||
ret = wm831x_reg_write(wm831x, WM831X_RTC_TIME_1,
|
ret = wm831x_reg_write(wm831x, WM831X_RTC_TIME_1,
|
||||||
(time >> 16) & 0xffff);
|
(time >> 16) & 0xffff);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -334,7 +336,7 @@ static irqreturn_t wm831x_alm_irq(int irq, void *data)
|
||||||
|
|
||||||
static const struct rtc_class_ops wm831x_rtc_ops = {
|
static const struct rtc_class_ops wm831x_rtc_ops = {
|
||||||
.read_time = wm831x_rtc_readtime,
|
.read_time = wm831x_rtc_readtime,
|
||||||
.set_mmss = wm831x_rtc_set_mmss,
|
.set_time = wm831x_rtc_settime,
|
||||||
.read_alarm = wm831x_rtc_readalarm,
|
.read_alarm = wm831x_rtc_readalarm,
|
||||||
.set_alarm = wm831x_rtc_setalarm,
|
.set_alarm = wm831x_rtc_setalarm,
|
||||||
.alarm_irq_enable = wm831x_rtc_alarm_irq_enable,
|
.alarm_irq_enable = wm831x_rtc_alarm_irq_enable,
|
||||||
|
|
Loading…
Reference in New Issue