linux/drivers/rtc/rtc-wm8350.c
<<
>>
Prefs
   1/*
   2 *      Real Time Clock driver for Wolfson Microelectronics WM8350
   3 *
   4 *      Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
   5 *
   6 *  Author: Liam Girdwood
   7 *          linux@wolfsonmicro.com
   8 *
   9 *  This program is free software; you can redistribute  it and/or modify it
  10 *  under  the terms of  the GNU General  Public License as published by the
  11 *  Free Software Foundation;  either version 2 of the  License, or (at your
  12 *  option) any later version.
  13 *
  14 */
  15
  16#include <linux/module.h>
  17#include <linux/kernel.h>
  18#include <linux/time.h>
  19#include <linux/rtc.h>
  20#include <linux/bcd.h>
  21#include <linux/interrupt.h>
  22#include <linux/ioctl.h>
  23#include <linux/completion.h>
  24#include <linux/mfd/wm8350/rtc.h>
  25#include <linux/mfd/wm8350/core.h>
  26#include <linux/delay.h>
  27#include <linux/platform_device.h>
  28
  29#define WM8350_SET_ALM_RETRIES  5
  30#define WM8350_SET_TIME_RETRIES 5
  31#define WM8350_GET_TIME_RETRIES 5
  32
  33#define to_wm8350_from_rtc_dev(d) container_of(d, struct wm8350, rtc.pdev.dev)
  34
  35/*
  36 * Read current time and date in RTC
  37 */
  38static int wm8350_rtc_readtime(struct device *dev, struct rtc_time *tm)
  39{
  40        struct wm8350 *wm8350 = dev_get_drvdata(dev);
  41        u16 time1[4], time2[4];
  42        int retries = WM8350_GET_TIME_RETRIES, ret;
  43
  44        /*
  45         * Read the time twice and compare.
  46         * If time1 == time2, then time is valid else retry.
  47         */
  48        do {
  49                ret = wm8350_block_read(wm8350, WM8350_RTC_SECONDS_MINUTES,
  50                                        4, time1);
  51                if (ret < 0)
  52                        return ret;
  53                ret = wm8350_block_read(wm8350, WM8350_RTC_SECONDS_MINUTES,
  54                                        4, time2);
  55                if (ret < 0)
  56                        return ret;
  57
  58                if (memcmp(time1, time2, sizeof(time1)) == 0) {
  59                        tm->tm_sec = time1[0] & WM8350_RTC_SECS_MASK;
  60
  61                        tm->tm_min = (time1[0] & WM8350_RTC_MINS_MASK)
  62                            >> WM8350_RTC_MINS_SHIFT;
  63
  64                        tm->tm_hour = time1[1] & WM8350_RTC_HRS_MASK;
  65
  66                        tm->tm_wday = ((time1[1] >> WM8350_RTC_DAY_SHIFT)
  67                                       & 0x7) - 1;
  68
  69                        tm->tm_mon = ((time1[2] & WM8350_RTC_MTH_MASK)
  70                                      >> WM8350_RTC_MTH_SHIFT) - 1;
  71
  72                        tm->tm_mday = (time1[2] & WM8350_RTC_DATE_MASK);
  73
  74                        tm->tm_year = ((time1[3] & WM8350_RTC_YHUNDREDS_MASK)
  75                                       >> WM8350_RTC_YHUNDREDS_SHIFT) * 100;
  76                        tm->tm_year += time1[3] & WM8350_RTC_YUNITS_MASK;
  77
  78                        tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon,
  79                                                    tm->tm_year);
  80                        tm->tm_year -= 1900;
  81
  82                        dev_dbg(dev, "Read (%d left): %04x %04x %04x %04x\n",
  83                                retries,
  84                                time1[0], time1[1], time1[2], time1[3]);
  85
  86                        return 0;
  87                }
  88        } while (retries--);
  89
  90        dev_err(dev, "timed out reading RTC time\n");
  91        return -EIO;
  92}
  93
  94/*
  95 * Set current time and date in RTC
  96 */
  97static int wm8350_rtc_settime(struct device *dev, struct rtc_time *tm)
  98{
  99        struct wm8350 *wm8350 = dev_get_drvdata(dev);
 100        u16 time[4];
 101        u16 rtc_ctrl;
 102        int ret, retries = WM8350_SET_TIME_RETRIES;
 103
 104        time[0] = tm->tm_sec;
 105        time[0] |= tm->tm_min << WM8350_RTC_MINS_SHIFT;
 106        time[1] = tm->tm_hour;
 107        time[1] |= (tm->tm_wday + 1) << WM8350_RTC_DAY_SHIFT;
 108        time[2] = tm->tm_mday;
 109        time[2] |= (tm->tm_mon + 1) << WM8350_RTC_MTH_SHIFT;
 110        time[3] = ((tm->tm_year + 1900) / 100) << WM8350_RTC_YHUNDREDS_SHIFT;
 111        time[3] |= (tm->tm_year + 1900) % 100;
 112
 113        dev_dbg(dev, "Setting: %04x %04x %04x %04x\n",
 114                time[0], time[1], time[2], time[3]);
 115
 116        /* Set RTC_SET to stop the clock */
 117        ret = wm8350_set_bits(wm8350, WM8350_RTC_TIME_CONTROL, WM8350_RTC_SET);
 118        if (ret < 0)
 119                return ret;
 120
 121        /* Wait until confirmation of stopping */
 122        do {
 123                rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL);
 124                schedule_timeout_uninterruptible(msecs_to_jiffies(1));
 125        } while (--retries && !(rtc_ctrl & WM8350_RTC_STS));
 126
 127        if (!retries) {
 128                dev_err(dev, "timed out on set confirmation\n");
 129                return -EIO;
 130        }
 131
 132        /* Write time to RTC */
 133        ret = wm8350_block_write(wm8350, WM8350_RTC_SECONDS_MINUTES, 4, time);
 134        if (ret < 0)
 135                return ret;
 136
 137        /* Clear RTC_SET to start the clock */
 138        ret = wm8350_clear_bits(wm8350, WM8350_RTC_TIME_CONTROL,
 139                                WM8350_RTC_SET);
 140        return ret;
 141}
 142
 143/*
 144 * Read alarm time and date in RTC
 145 */
 146static int wm8350_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
 147{
 148        struct wm8350 *wm8350 = dev_get_drvdata(dev);
 149        struct rtc_time *tm = &alrm->time;
 150        u16 time[4];
 151        int ret;
 152
 153        ret = wm8350_block_read(wm8350, WM8350_ALARM_SECONDS_MINUTES, 4, time);
 154        if (ret < 0)
 155                return ret;
 156
 157        tm->tm_sec = time[0] & WM8350_RTC_ALMSECS_MASK;
 158        if (tm->tm_sec == WM8350_RTC_ALMSECS_MASK)
 159                tm->tm_sec = -1;
 160
 161        tm->tm_min = time[0] & WM8350_RTC_ALMMINS_MASK;
 162        if (tm->tm_min == WM8350_RTC_ALMMINS_MASK)
 163                tm->tm_min = -1;
 164        else
 165                tm->tm_min >>= WM8350_RTC_ALMMINS_SHIFT;
 166
 167        tm->tm_hour = time[1] & WM8350_RTC_ALMHRS_MASK;
 168        if (tm->tm_hour == WM8350_RTC_ALMHRS_MASK)
 169                    tm->tm_hourtm->  77
 141}
 141}
 141}
tm->tass="sre=tmde=ret" class="1e0sref">WM8350_RTers/r0"+code=tm_minref="+code=dev_def"1/rtc/2>time[0] & )
tm_hourt1m-> 164        else
time1[3]17ine" name="L36">  36WM8350_RTC_MTH_MASK)
tm_hour == time1[3] 1amp; tm_hour  18#i+code7a href="drivers/rtc/rMINS_SHIFT" clas"sref">WM8350_RTC_MTH_MASK)
r1tc_ye1r_days(tm_min >>= tm_yea1r);
WM8350_RTC_MTH_MASK)
tm->timeet" clf">WM8350_RTers/r0"+code=tm_minref="+coderef="driv1ers/rtc/rtc-wm8350.c#L811" id=18"> 141}
dev_dbg(WM8350_RTC_ALMMINS_MASK;
  74<67""L74" clac-wm8350.c#L155" id="L155" class="line" namtring">&q1uot;Read (%d left): 1%18ALMMINS_MASK)
  74<67""L74" clac-wm850.c#L155" id="L155" class="line" namt"sref">t1ine" name="L84">  841     1                      INS_MASK" class="sref">WM8350_RTC_ALMMINS_MASK;
ti18ine" name="L36">  36WM8350_RTC_MTH_MASK)
tm_hour = retries--);18WM8350_RTC_ALMHRS_MASK" clas="+code=u16" class="sref">u16  127s="slac-wm8350.c#L155" id="L155" class="line" namt_RTC_ALMH89">  89
tm_mon = ((  88        } while (/*
  94, struct rtc_wkalrm *ctop_" cla="sreef="+code=dev" class="sref">dev);
wm8350 =  * S1et current time and date1 in R19 href="+code=ra>;
TIME_RETRIES" class="sref">WM8350_SET_TIME_RETRIES 588        } while (19e=WM8350_RTC_MINS_SHIFT" claa href="+code=ret" class="sref">ret, retries = ;
 157        tm *<1a href="+code=dev" class1="sre19y" class="sref">tm_yday = wm83510 *ret = wm8350_set_bits(dev_g1et_dr19="+code=WM8350_RTC_MTH_SHIFTNTROL" class="sref">WM8350_RTC_TIME_CONTROL, WM8350_RTC_SET);
 118        if (wm8350_set_bits(  71       [3] = ((ret;
WM2350_S204x %04x %04x id="L157" class="line" name="L157"> 157        t2time[2] = tm->2m_sec;
 123                 << wm8350_reg_2ss="sref"2tm_hour;
ret,  124                schedule_timeout_uninterruptible(tm_wday + 1) <&2t;  125        } while (--retries && !(rtc_ct2ss="sref"2tm_mday;
  90        <26" id="L126" class="line" name="L126"> 126
 127s="slac-wmf="+code=rtc_ctrl" class="sref">rtc_ct2s9="sref"2tdata" class="sref">dev_2 dev, "ti2lass="sre2">tm_year + 1900) / 200) &2t;<  126
 127s="slac-wmfv, "ti2lm8350.c#L">tm_year + 1900)  1021p; [3] = ((t2f">dev_db2(dev, "2Setting: 2#37;04x %04x %042 酔x\n"  88        } while (time[2], /*
 117    2   dev, struct rtc_wkalrm *cwm8p_" cla="sreef="+code=dev" class="sref">dev);
wm8350, wm8350 =                 2eturn2 157        t2" name="L220"> 120
TIME_RETRIES" class="sref">WM8350_SET_TIME_RETRIES 588        } while ( 151        int ret;
retries =  122    229-wm8350.c#L133" id="L133" class="line" n2=rtc_ctrl2 class="sref">rtc_ctrl = <2 href="+code=w50_RTC_MTH_SHIFTNTROL" class="sref">WM8350_RTC_TIME_CONTROL, a>,
 139                                WM8350_RTC_SET);
wm8350, [3] = ((ret;
 157        t2="sref">r2tries) {
 128            2   ret 123                "t2med out on set confirmat2on\n&2uot;);
m8350_reg_read" class="sref">wm8350_reg_2e" name="2130"> 130        }
<2 href2"drivers/rtc/rtc-wm835"sref">ret,  124                schedule_timeout_unin" class="sref">wm8350_reg_2c#L132" i2="L132" class="line" nam2="L13230="L71" class="line" rMINS_SHIFT" clrtc/rtc-wm8350.c#L125" id="L125" class="line" name="L125"> 125        } while (--retries && !(rtc_ct2e to RTC 2/
  90        <26" id="L126class="line" name="L126"> 126
 127s="slac-wm="+code=rtc_ctrl" class="sref">rtc_ct2ertc_ctrl2 133        dev, "2ref="+cod2=wm8350" class="sref">wm2350, re="L126"> 126
 127s="slac-wm>dev, "2rde=msecs2 135                2eturn2[3] = ((t2" name="L236"> 136

2a hre238" id="L88" c8"L88">  88        } while ( 138 2     2/*
wm8320238" class="sref">tm_mon = (( >dev, struct rtc_wkalrm _" cl_irq_"enabla="sreef="+code=dev" class=lrm)
tm_mon = (( 142}
  7777777777unsigneda>, struct dev, "2id="L143"2class="line" name="L143"2 143<2a>wm8350_reg_2rivers/rt2/rtc-wm8350.c#L144" id="2144" 24href="+code=wref="+code=dev" class="sref">dev);
 149        struct rtc_time *tm = & * Read alarm time and 2ate i24ef">tm-> 145denablea>, 4, "2i name="L2+code=wm8350_rtc_readala2m" cl24c/rtc-wm8350.c#L157" id="L157" class="line"+code=rtc_we=wm8p_" class="sref">rtc_wkalrm *cwm8p_" cla="sr/rtc/rtc-wm8350.c#L149" id="L149" class="line" ass="sref">tm = &tm_min >>=  *rtc_wkalrm *ctop_" cla="sr/rtc/rtc-wm8350.c#L149" id="L149" class="line" ass="sref">tm = &dev2get_d2vdata/*
alrm->2a hre24f">dev, "ti20.c#L151"2id="L151" class="line" n2me="L2"line", struct rtc_wkalrm *cl_" cla="sreef="+code=dev" class=lrm)
 147{
 148        struct  152
wm8350_reg_2et = 2a href="+code=wm8350_blo2k_rea25href="+code=wref="+code=dev" class="sref">dev);
 149        struct rtc_time *tm = &wm83202 time;
 150        u16 time[4];
                2eturn2ret;
 156
 157        t2->2a href="+code=tm_sec" cl2ss="s2ef">tm_sec = t2me[0] &  157rtc_timertc_timertc_ct2_RTC_ALMS2CS_MASK" class="sref">WM2350_R258" class="sref">tm_mon = (( 159     !50.r     struct ->2a href="+code=tm_min" cl2ss="s260="L71" class="line" rMINS_SHIFT" class="sref">WM8350_RTC_MINS_SHIFT;
tm->t2me[0] & tm_min >>= WM2350_R264x %04x %04x rMINS_SHIFT" class="sref">WM8350_RTC_MINS_SHIFT;
tm->tm_sec == tm->tm->ref="drivers/rtc/rtc-wm8350.c#L166" id="L166" class="line" name="L166"> 166!50.r     struct WM8350_RTC_ALMMINS_SHIFT;
WM8350_RTC_MINS_SHIFT;
 106         167        t2->2a href="+code=tm_hour" c2ass="268" id="L88" c s="sref">tm_min >>= [1] & WM8350_RTC_MINS_SHIFT;
tm->tm_min == W28350_268" class="sref">tm_mon = (( 141}
WM8350_RTC_MINS_S1IFT;
tm->tm_min >>= WM8350_RTC_MINS_S1IFT;
tm->tm_hour == 21m->tm->time1<21a>[327a href="+code=ret" class="sref">ref="drivers/rtc/rtc-wm8350.c#L166" id="L166" =rivers/rtc/;
WM8350_RTC_ALMMINS_SHIFT;
WM8350_RTC_MINS_S_DAY_SHIFT;
 108        tass="sre=tmde=ret"ef">tm_hour == time1[3]278" id="L88" c s="sref">tm_min >>=   18WM8350_RTC_MINS_S1IFT;
  74<67""Yclass="sref">tm_hour == 21tc_y278" class="sref">tm_mon = ((tm_ye21r);
WM8350_RTC_MINS_S2IFT;
tm->dev_dbg(tm_min >>= &21uot;Read (%d left):21醤x %04x %04x rMINS_SHIFT" class="sref">WM8350_RTC_MINS_S2IFT;
  74<67""L74" clac-w">tm->21ine" name="L84">  84tm->t28a href="+code=ret" class="sref">ref="drivers/rtc/rtc-wm8350.c#L166" id="L166" cers/rtc/rtc-wm8350.c#L70" id!50.r     struct WM8350_RTC_ALMMINS_SHIFT;
WM8350_RTC_MINS_STH_SHIFT;
 110        time[3] = ((timeet"">tm->->21f="drivers/rtc/rtc-wm83210.c#288" id="L88" c s="sref">tm_min >>= retries--)287a href="drivers/rtc/rMINS_SHIFT" class="sref">WM8350_RTC_MINS_S2IFT;
tm_hour ==   89
tm_mon = ((WM8350_RTC_TIME_CONTROL, tc_we=top_" class="sref">rtc_wkalrm *ctop_" cla="sr/rtc/rtc-wm8350.c#L149" id="L149" class="line" ass="sref">tm = &WM835rtc/rtc-wm8350.c#L156" id="L156" class="lin2r>  92 157        t2m" class=21line" name="L94">  94dev, "2m/rtc/rtc21wm8350.c#L95" id="L95" 21lass29ret = wm8350_block_write( * 21et current time and dat21 in 29a href="+code      int WM8350_RTC_SECONDS_MINUTES, 4, time);
 154        if (wm8350_block_write(WM8350_RTC_ALMMINS__________________3">ret < 0)
)
WM835rtc/rtc-wm8350.c#L156" id="L156" class="lin2r=retries21a href="+code=dev" clas21="sr297a href="drivers/rtc/id="L157" class="line"ers/e="L157"> 157        t2mt_RTC_AL210 *tm_mon = ((dev_21et_d29"line" name=")
u16 WM8350_RTC_TIME_CONTROL, tc_we=wm8p_" class="sref">rtc_wkalrm *cwm8p_" cla="sr/rtc/rtc-wm8350.c#L149" id="L149" class="line" ass="sref">tm = &WM3350_S304x %04x &id="L157" class="line"ers/e="L157"> 157        t3time[3] = th class="comment">/*
3m_sec;
  36 <<  157ret;
 _" cl_handlehref="+code=tm" wkalrm _" cl_handleha="sr=ra>;
 157wm8350_reg_3lass="sre3">tm_wday + 1) <&3t; dev);
 149t3t8ss="sre3"0 * lrm)
WM8350_RTC_TIME_CONTROL,9" id="L149" class="line"u16 WM83.a> WM83    t3t9ss="sre3"data" class="sref">dev_3 ;
 157        t3lass="sre3">tm_year + 1900) / 300) &318"> 141}
tm_year + 1900) % 103188350_RTC_ALMMINS_MASK" clas/a> up" id_irq/e="L157"> 157 up" id_irqa="sr/rtc/rtc-wm8350/a>>)
ret < 0)H_SHIRQF>)
tm = &dev_db3(dev, "3Setting: 3#37;04x %04x %043 ຓret = wm8350_block_write(time[2], WM8350_RTC_SECONDS_MWM8350_RTC_SET);
 118        if (wm8350_set_bits(WM8350_RTC_ALMMINS_______________a>;
 117    3   WM835!=rtc350_reg_read" class="sref">wm8350_reg_3code=wm8330" class="sref">wm8350, WM8350_RTC_SET);
>)
 * wm8350_set_bits( "Fai50. cladis8350146" i: %d\n"ef">wm88" id="L118" clas="sref">WM835!=rtc350_reg"L141" class="line" name=3ss="line"3namea" class=/*
3m_sn of stop3ing */
 13132te" name="3122"> 122    229-wm8350.c#32MINS_MASK" clss="line"ers/e="L157">tWM835!=rtctt3lass="sre3">tass="sref3>rtc_ctrl = <2 href=3+code3w50_RTent">/*
3m_sn04x %wm8350" cla2s="sr2f">wm8350 157ret;
 _" cl_handlehsr/rtc/code=tm" wkalrm _" cl_handlehsr/rtc/code=tm href="drivirq/e="L157"> 157wm8350_reg_3code=wm8330" es) {3)
dev);
 149t3t8ss="sre3"0<> 1283           2   devWM8350_RTC_TIME_CONTROL,9" id="L149" class="line"u16 WM83.a> WM83    t3t9ss="sre3"da out on s3t confirmat2on\n&2uot;)32f">tm_mon = (( 130 157 up" id_irqa="sr/rtc/rtc-wm8350/a>>)
ret < 0)H_SHIRQF>)
tm = &dev_db3tspan>
tWM835!=rtctt3lass="sre3">t3    3   /*
3m_s8350" cla3s="sref">wm2350,     3           2eturn2dev        <2a h     _op >;
 _" cl_handlehop 90        < cl_handlehop ME_CONTclass="sref">wm8350_reg_3code=wm8330" > 1363(  88>)
WM8/rtc/rtc-wm8350.c#L>WM8/rtcME_CONTROL, tc_we=wm8p_" classet/rtc/rtc-wm8350.c#Lwm8p_" classet/rtcm8350_set_bits( 138 2     2>)
rtc_wkalrm *c=eadsf">rtME_CONTROL, tc_we=wm8p_" clas1eadf">rtc_wkalrm *cwm8p_" cla=1eadf">rtm8350_set_bits(wm8320238" cl3ss="s338"L88">  88>)
WM8f">rtc_wkalrm *c>WM8f">rtME_CONTROL, tc_we=wm8p_" classetf">rtc_wkalrm *cl_" cla="sreef="+code=d0_set_bits( 3dev  88>)
rtc_wkalrm _"abla="sreef="+code=dONTROL, tc_we=wm8p_" clasablass="sref">rtc_wkalrm _" cl_irq_"enabla="sreef="+code=d0_set_bits(t3lass="sre3">tss="line"3name="L143"2 143<2a>, tc_we=CONFIG_PM_SLEEPc_wkalrm _"CONFIG_PM_SLEEP3" id="L133" class="line" n3_SET_TIME3RETc350" cla3m time and 2ate i24ef">t3-3gt;)
 156" id="L156" class="lin326="sref"3t=w 145<3pan class="2ommen24a hre3="+co3e=ret"class="sref">wm8350_reg_3code=wm8330" de=wm83503rtc_readala2m" cl24c/rtc3wm8353.c#L157" id="Lv" class=lrm)
 tm = &)
dev);
 149rtc_tim  wm835 = &3a href="+co2e=wm8247a hr3f="dr3vers/rtc/id="L="drivers/e="L157"> 157        dev2get_d2vdata<3 clas34e= class="srefvers/e="L157">" class="sref">ret;
t3lass="sre3">t="sref">a3rm->2a hre24f">de3,3"ti20.c#L151"2id3"L151" cl3ss="line" n2me="L2"line"3/a>, "L149"> _MTH_SHIFTNTROL" class=eg7         124                schedule_timeout_unin" class="sref">wm8350_reg_2c#L132" i2="3a href="d3ivers/rtc/r2c-wm825> WM83.a>  wm835lass="line"d="L133" class="line" n3_SET_TIME3RETr350" cla3"sref">wm83202 H_SHIFTNTROL" class=eg7         127s="slac-wm>dev, wm8350_reg_3code=wm8330" 5    3           2eturn2H_SHIFTNTROL" class=esref">WM8350_RTC_TIME_CONTROL, tc_we=top_" class="sref">rtc_wkalrm *ctop_" cla="sr/rtc/rtc-wm8350.c#L149" id="L149" class="line" ass="sref">tm = &WM835!=rtc350_reg_read"/a> = &tm3secretH_SHIFTNTROL" classcode=tm" de=rerhsref"50WM8350_RTC_cop/a> * wm83, c"Fai50. claits" ss="46" i: %d\n"ef">wm88/a> = &H_SHIFTNTROL" class=esref">WM8350_RTC_TIME_Cm = &WM2350_R258" cl3ss="s350.c#L90" id="L/a> = &a30" id="L1602 clas2="line3 name35span class="string">"ti20.c#L151"2id3ref="+cod3=tm_min" cl2ss="s260="L73" cla3s="line" rMINSss="line"ers/e="L157"> 157        t3time[3] =/a>[0] &a3p; WM2350_R264x %04x36, "3Setting: 3#378350.c#L134" id="L1642 clas26ef">t3-36t;)
 156" id="L156" class="lin326="sref"3t=wref">tm->wm8350_reg_3code=wm8330" TC_ALMMIN3_SHIFT" cla2s="sr2f">WM8350_RT36c#L157" id="Lv" class=lrm)
 tm = &)
dev);
 149rtc_tim  tm = &3amp;  157        W28350_268" cl3ss="s3ef">tm_mon = (()
 WM83.a> wm8350_reg_3code=wm8330" lass="lin3" n"line" n2me="L270="L73" cla3s="line" rMINS_SHIFT" class="sref">WM="sref">WM8350_RTC_TIME_CONTROL, tc_we=wm8p_" class="sref">rtc_wkalrm *cwm8p_" cla="sr/rtc/rtc-wm8350.c#L149" id="L149" class="line" ass="sref">tm = &WM835!=rtc350_reg_read"/a> = &H_SHIFTNTROL" classcode=tm" de=rerhsref"50WM8350_RTC_cop/a> * wm83,/a> = &t3-37 "Fai50. cla1essr/r ss="46" i: %d\n"ef">wm88HIFTNTROL" class=esref">WM8350_RTC_TIME_Cm = &time1<21a>[327a hre3="+co3e=ret" class="L/a> = &WM8350_RT37-wm8350.c#L117" id="L117" cl2_SET to s2ar3 class="s3ef">time1[3]278" id3"L88"3c s="sref">tm_a>        } while (  18/*
21tc_y278" cl3ss="s3ef">tm#endifnt">/*
"ti20.c#L151"2id3s/rtc/rtc3wm8350.c#L821" id280="L73" cla38ruct )
  = &dev_dbg3/a>(wm8350_reg_2et = 2a 3t;Read (&337;d left):21醤x %04x38ref="+code=dev" class="sref">dev);
 149        stplatfoa="    84t3-38class="sref">time;
 WM83.a> t28a hre3="+co3e=ret" class="s"drivers/e="L157"> 157        WM8350_RT3_ALMMINS_SHIFTfvers/e="L157">" class="sref">ret;
t2me3lass="sre3">retries--)287a hr3f="dr38SECS_MASK" clasmemsrs/e="L15/rtccta href="drivers//rtccta  );
 124                schedule_timeout_unin" class="sref">wm8350_reg_2c#L132" i2="3">  89ref="drivers/rrtccta href="drivers//rtccta  WM835!=rtc="slass="liBCD, wm8350_reg_3code=wm8330"  href="+c3de=dev" cla21s="s289="+c3de=WM38tc-wm835"sref">ret, WM8350_RTC_cop/a> * wm83, c"ss="BCD mref not supported\n"ef">wm8 class="sref">wm8350_reg_2c#L132" i2="3ing RTC t3me\n"<21span29;<3[3] INVAptible" class="s INVApef="  } while (/*
  94)
WM835!=rtc="slass="li12HR, wm8350_reg_3code=wm8330" 8350.c#L93" id="L95" 21lass29, WM8350_RTC_cop/a> * wm83, c"ss="12 /a>- mref not supported\n"ef">wm8 class="sref">wm8350_reg_2c#L132" i2="3i class="3ime and dat21 in 29a hre3="+co39      int H_SH"L131" clas"sreDOUs>[3] INVAptible" class="s INVApef="  } while (WM8350_RT3_ALMMINS______ent">/*
t2me3href="+co3e=dev" clas21="sr297a hr3f="dr39=ret" class="sref">retwm8350_block_write(power5odpe=tm" cu16);
 124                wm8350_reg_2c#L132" i2="3ta" class3"sref">dev_21et_d29"line3 name3")
scheduleCK_ENAnin" pTclass="sref">wm8350_reg_3code=wm8330"4"L101" cl4ss="line" n32e="L320="L74" cla4s="line" 50_RTC_MTH_SHIFTNTROL" class0 124                 *wm83, c"Ssr/ring ss=\n"ef">wm8 class="sref">wm8350_reg_2c#L132" i2="4" id="L104" class="li3s="sr309-wm8450.c#4133" id="L133" class="line" n3_SET_TIME3RE4RIES" cla4s="sref">WM3350_S304x /04x40#37;04x rMINS_SHIFT" class="sref">WM124" id="L1un">ti/rtc-wm8350.c#L124" id="L1un">ti-wm8350.c#L149" id="L149" class="line" ass="sref">tm = &t4 clas40t;;
<4 href="driv3rs/rt308ine"4name=40      int H_SHIFTNTROL" class=esref">WM8350_RTC_TIME_CONTROL, tc_we=top_" ce=WM8350_RTC_SET" class="sref">WM8350_RTC_SET);
 = &, 40ALMMINS__________________3">ret &l>H_SHIFTNTROL" classdule_timeout_CK_ENAtible" class="sref">scheduleCK_ENAnin"  = &retWM835rtc/rtc-wm8350.c#L15Tclass="sref">wm8350_reg_3code=wm8330"4"7n &4t=dev" clas21="sr297a hr4f="dr40ers/rtc/rMINS_SHIFT"  int , WM8350_RTC_cop/a> * wm83, c"fai50. cla wm88HIFTNTROL" class=esref">WM8350_RTC_TIME_Cm = &(;
 157        t3time[3] 4ta" class4"sref">dev_3 ret/*
 1414
4m_yearWM124" id="L1">ti/rtc-wm8350.c#L124" id="L1">ti-wm8350.c#L149" id="L149" class="line" ass="sref">tm = &/*
time4/a>[2],  127s="slac-wm>d/a>, wm8350_reg_3code=wm8330"4e clock *4
WM8450_RT4_ALMMINS______________s"drivers/e="L157"> 15rie 90        <215rie ef="+code=tm" class="sref">t3time[3] 4e="L117">4117    3   t2me4class="sr4f">wm8350, WM8350_RTC_TIME_CONTROL, tc_we=top_" cclearM8350_RTC_SET" class="sref"clearM8350class="line" name="L124"> 124                schedule_timeout_unin",/a> = & d/ href="+code=tm"="+-wm8350.c41" id="L141" class="line" name=3ss="line"3na4ea" class4retWM835rtc/rtc-wm8350.c#L15Tclass="sref">wm8350_reg_3code=wm8330"4n of stop4ing */
 14142="line" 50_RTC_MTH_SH_SHIFT" clde=rerhref="+code=tm" de=rerhsref"50WM8350_RTC_cop/a> * wm83, c"fai50. classr/r: %d\n"ef">wm88HIFTNTROL" class=esref">WM8350_RTC_TIME_Cm = & 122    229-wm8450.c#42code=WM80.c#L13;
 157        t3time[3] 4ass="sref4>rtc_ctrl = <2 href=4+code42#37;04x rMINS_SHIFT" ent">/*
wm8450H_SHIFTNTROL" class=esrie 90        <215rie ef="ONTROL, tc_we="+-wm8341"ule_tiRETRI    if (t3time[3] 4a clock *4ode=WM8350_2TC_ST22c/rtc4wm83542ALMMINS______________doTclass="sref">wm8350_reg_3code=wm8330"4n="L117">4retH_SHIFTNTROL" class/rtccta href="drivers//rtccta  );
 124                wm8350_reg_3code=wm8330"4nlass="sr4           2   H_SHef">retH_SHIFTNTROL" classdule_timeout_uninterruptible" class="sref">schedule_timeout_unin" class="sref">wm8350_reg_2c#L132" i2="4 out on s4t confirmat2on\n&2uot;)42de=ra>;
 127s="slac-wm>d/a>, [3]=esrie 90        <215rie ef=" class="sref">wm8350_reg_2c#L132" i2="4 a" class4        }
<2 href2"drive4s/rtc42span class="string">"ti20.c#L151"2id4132" clas4="line" nam2="L13230="L74" cla43="line" 50_RTC_MTH_SH="drivTNTROL" class="srie 90        <215rie ef="ONead" class="sref">wm8350_reg_3code=wm8330"4span>
WM8350_RTC_cop/a> * wm83, c"fai50. classr/r: /rtcout\n"ef">wm8 class="sref">wm8350_reg_2c#L132" i2="43    4   H_SH"L131" clas"sreDOUs>[3] NODEVtible" class="s NODEVef="+code=tm" class="sref">t3time[3] 48350" cla4s="sref">wm2350, /*
    4           2eturn2 1364
2a hre238" id4"L88"4c8"L88">  88 * wm83, 1 class="sref">wm8350_reg_2c#L132" i2="43lass="sr4"> 138 2     2wm8350_reg_2c#L132" i2="43out on s4"sref">wm8320238" cl4ss="s43e= class="srefvers/e="L157">L1 cla/rtc-wm8350.c#Lwm clac-wmef="+co/a>>)
 _"fucm cla"ref="dd="ListtmM8350_RTC_cop/a> * wm83, c"L132" "ef">wm88/a> = & 4devret        < cl_handlehop ME_C8HIFTNTROL" classTHIS_MODULE90        wm8350_reg_2c#L132" i2="4>}
WM835!=rtcIS_ERRclass="line" name="L12 cla/rtc-wm8350.c#Lwm clac-wmef="+co/a>>)
wm8350_reg_3code=wm8330"4ss="line"4name="L143"2 143<2a>WM=esref">WM8350_RTC_TIME_CONTROL, tc_we=PTR_ERRref">WM835!=rtcPTR_ERRclass="line" name="L12 cla/rtc-wm8350.c#Lwm clac-wmef="+co/a>>)
wm8350_reg_2c#L132" i2="4>    4#L144" id="2144" 24href=4+code44#37;04x rMINS_SHIFT" class="sref">WMcode=tm" de=rerhsref"50WM8350_RTC_cop/a> * wm83, c"fai50. cla="Listtm hed: %d\n"ef">wm88HIFTNTROL" class=esref">WM8350_RTC_TIME_Cm = &t4-44  157        t3time[3] 4 145<4pan class="2ommen24a hre4="+co44=ret" class="L/a> = &  88 * 124                 127s="slac-twm8350_reg_3code=wm8330"4  1284a href="+co2e=wm8247a hr4f="dr44ers/rtc/rMINS_SHIFT"  int ref="+code=u16"f="dri cla"sr/rtc/code=tm" wkalrm _" cl_handlehsr/rtc/code=tm hre, 0 lass="sref">wm8350_reg_3code=wm8330"4 out on s4="sref">dev2get_d2vdata<4 clas44de=ra>;
"ss="Seconds"ef">wm88HIFTNTROL" classL149" class="line" ass="sref">tm = &a4rm->2a hre24f">de4,4450_RTC_MTH_SHIFTNTROL" class cl_hanmask> 157 up" id_ir124" idmask> 15class="line" name="L124"> 124                 127s="slac-t = &, 454a href="d4ivers/rtc/r2c-wm825> up" id_ir124" id="Listtm> 157 up" id_ir124" id="Listtm> 15class="line" name="L124"> 124                 127s="slac-twm8350_reg_3code=wm8330"4ref="+cod4=wm8350_blo2k_rea25href=4+code45#37;04x rMINS_SHIFT" ef">H_SHef">ref="+code=u16"f="dri cla"ref="+code=tm" wkalrm _" cl_handleha="sr=ra>;
wm8350_reg_3code=wm8330"4r350" cla4"sref">wm83202 H_SHMINS_SHIFT" tc/rc"ss="A="sr"ef">wm88HIFTNTROL" classL149" class="line" ass="sref">tm = &  36 1564*tm4sec = &wm8350_reg_2c#L132" i2="4>ta" clas4s="sref">WM2350_R258" cl4ss="s450.c#L)
  = &a40" id="L1602 clas2="line4 name45span class="sref">wm8350_reg_3code=wm8330"4ref="+cod4=tm_min" cl2ss="s260="L74" cla4s="line" rMINSv" class="sref">dev);
 149        stplatfoa="  WM2350_R264x /04x462INS_MASK" clas/a> up" id_ir124" idfre"> 157 up" id_ir124" idfre"> 15class="line" name="L124"> 124                 127s="slac-ttm = &t4-463INS_MASK" clas/a> up" id_ir124" idfre"> 157 up" id_ir124" idfre"> 15class="line" name="L124"> 124                 127s="slac-ttm = &  36WM8450_RT46ALMMINS______a>        } while ( = &wm8350_reg_2c#L132" i2="4Tta" clas4ss="sref">W28350_268" cl4ss="s460.c#L 127sSIMPLE_DEV_PM_OPaclass="line" name="L124">  claspm"op 90        < cl_handlehpm"op   wm8350_reg_3code=wm8330"4wm8350.c#41         12ass="26"line4 name46tc-wm835"sref">ret = &4rivers/rt4/;
)
 14class="sref">wm8350_reg_3code=wm8330"4tc/2>time4/a>[0] &2  *, tc_we=wm8p_" clasprobc/rtc-wm8350.c#Lwm8p_" clasprobc-wm8 lass="sref">wm8350_reg_3code=wm8330"4t350.c#L14 href="+cod21=tm_27ef">t4-47 wm8350_reg_3code=wm8330"4t    4ref">time1<21a>[327a hre4="+co4e=ret" class="+co/a>>)
 14class="sref">wm8350_reg_3code=wm8330"4tC_ALMMIN4="drivers/r21c/rt27">WM8450_RT47ALMMINS______________+co/a>>)
rivers/rtc/rtc-27">clasONTR"L132" -_3c"ef">wm88/a> = &time1[3]278" id4"L88"47lass="li"sref">ret * *cptME_CONT         < cl_handlehpm"op    = &  1821tc_y278" cl4ss="s4ef">tm}+code=tm" class="sref">t3lass="sre3">4rm8350.c#4ref="driver21/rtc27"line4 name47span class="string">"ti20.c#L151"2id4s/rtc/rtc4wm8350.c#L821" id280="L74" cla48ruct ref="+code=u16"module_platfoa="r/rtc/rivers/rtc/rtc-module_platfoa="r/rtc/class="line" name="L124">  clasr/rtc/rivers/rtc/rtc-l_" class="r/rtc/49">m = &dev_dbg4/a>(WM835!=rtcMODULE_AUTHORclass="Mark Brown50.c#broonie@opensource.wolfsonmicro.comf="+"ef">wm8 class="sref">wm8350_reg_2c#L132" i2="4e" name="484">  84t4-48class="line" name="LMODULE_DESCRIPTIONref">WM835!=rtcMODULE_DESCRIPTIONclass="ss="">wm83 foa the ="slac"ef">wm8 class="sref">wm8350_reg_2c#L132" i2="4e    4" class="sr21f">t28a hre4="+co4e=ret"="line" name="LMODULE_LICENSE90        "GPL"ef">wm8 class="sref">wm8350_reg_2c#L132" i2="4eC_ALMMIN487" id="L8721 cla28">WM8450_RT4_ALMMI="line" name="LMODULE_ALIAame="L127"> 127sMODULE_ALIAaclass="platfoa=:L132" -_3c"ef">wm8 class="sref">wm8350_reg_2c#L132" i2="4eclass="s4tc/rtc-wm83210.c#288" id4"L88"48 = 


The original LXR software by the ass="srefhttp://sourcefoage.net/projects/lxm">LXR c#L1unity lxm@210ux.no lxm.210ux.no kindly hosted by ass="srefhttp://www.redpill-210pro.no">Redpill L10pro Aaclas, provid83 of L10uxnconsulring and oper hrons serf="ds since 1995.