linux/drivers/rtc/rtc-ab8500.c
<<
>>
Prefs
   1/*
   2 * Copyright (C) ST-Ericsson SA 2010
   3 *
   4 * License terms: GNU General Public License (GPL) version 2
   5 * Author: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
   6 *
   7 * RTC clock driver for the RTC part of the AB8500 Power management chip.
   8 * Based on RTC clock driver for the AB3100 Analog Baseband Chip by
   9 * Linus Walleij <linus.walleij@stericsson.com>
  10 */
  11
  12#include <linux/module.h>
  13#include <linux/kernel.h>
  14#include <linux/init.h>
  15#include <linux/platform_device.h>
  16#include <linux/rtc.h>
  17#include <linux/mfd/abx500.h>
  18#include <linux/mfd/abx500/ab8500.h>
  19#include <linux/delay.h>
  20#include <linux/of.h>
  21
  22#define AB8500_RTC_SOFF_STAT_REG        0x00
  23#define AB8500_RTC_CC_CONF_REG          0x01
  24#define AB8500_RTC_READ_REQ_REG         0x02
  25#define AB8500_RTC_WATCH_TSECMID_REG    0x03
  26#define AB8500_RTC_WATCH_TSECHI_REG     0x04
  27#define AB8500_RTC_WATCH_TMIN_LOW_REG   0x05
  28#define AB8500_RTC_WATCH_TMIN_MID_REG   0x06
  29#define AB8500_RTC_WATCH_TMIN_HI_REG    0x07
  30#define AB8500_RTC_ALRM_MIN_LOW_REG     0x08
  31#define AB8500_RTC_ALRM_MIN_MID_REG     0x09
  32#define AB8500_RTC_ALRM_MIN_HI_REG      0x0A
  33#define AB8500_RTC_STAT_REG             0x0B
  34#define AB8500_RTC_BKUP_CHG_REG         0x0C
  35#define AB8500_RTC_FORCE_BKUP_REG       0x0D
  36#define AB8500_RTC_CALIB_REG            0x0E
  37#define AB8500_RTC_SWITCH_STAT_REG      0x0F
  38
  39/* RtcReadRequest bits */
  40#define RTC_READ_REQUEST                0x01
  41#define RTC_WRITE_REQUEST               0x02
  42
  43/* RtcCtrl bits */
  44#define RTC_ALARM_ENA                   0x04
  45#define RTC_STATUS_DATA                 0x01
  46
  47#define COUNTS_PER_SEC                  (0xF000 / 60)
  48#define AB8500_RTC_EPOCH                2000
  49
  50static const u8 ab8500_rtc_time_regs[] = {
  51        AB8500_RTC_WATCH_TMIN_HI_REG, AB8500_RTC_WATCH_TMIN_MID_REG,
  52        AB8500_RTC_WATCH_TMIN_LOW_REG, AB8500_RTC_WATCH_TSECHI_REG,
  53        AB8500_RTC_WATCH_TSECMID_REG
  54};
  55
  56static const u8 ab8500_rtc_alarm_regs[] = {
  57        AB8500_RTC_ALRM_MIN_HI_REG, AB8500_RTC_ALRM_MIN_MID_REG,
  58        AB8500_RTC_ALRM_MIN_LOW_REG
  59};
  60
  61/* Calculate the seconds from 1970 to 01-01-2000 00:00:00 */
  62static unsigned long get_elapsed_seconds(int year)
  63{
  64        unsigned long secs;
  65        struct rtc_time tm = {
  66                .tm_year = year - 1900,
  67                .tm_mday = 1,
  68        };
  69
  70        /*
  71         * This function calculates secs from 1970 and not from
  72         * 1900, even if we supply the offset from year 1900.
  73         */
  74        rtc_tm_to_time(&tm, &secs);
  75        return secs;
  76}
 *
  77
	    Prefs
	  r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" cla">  65        struct year)
  63{
  64        unsigned lo claout;tm_yearjiffietm_yearHZa href="+code=sHZ class="sref">secs;
 valef="+code=rtc_ti> valTC_ALRM_MIN_HI_REGsecs;
  64        unsigned lominsecs;
  64  58      RRAY_SIZEC_ALRM_MIN_LOW_RRRAY_SIZEef">rass="sref">u8 ab8500)]ss="sref">secs;
  74     st u8secs;
  55
  43a data read"comment">         */
8ne" name="L57">  57     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="fref"srtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"srtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl         */
  57     REG" classC_ALRM_MIN_LOW_REG" classTC_ALRM_MIN_HI_REG, AB8500_RTLRM_MIN_HI_REGRTss="sref">secs);
u8 valef="+code=rtc_ti> valTC_A">  2        (0xF000 / 60)
  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  21
  43         */
u8rass="sref">u8tm = {
  57     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="fref"grtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"grtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl         */
  57     REG" classC_ALRM_MIN_LOW_REG" classTC_ALRM_MIN_HI_REG, AB8500_RTLRss="sref">tm, &a id=" secs);
  66u8 valef="+code=rtc_ti> valTC_A">  2        (0xF000 / 60)
9ne" name="L67">  67  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  38
  66u8RTs      (0xF000 / 60)
  67>
  11
  57     usleep_rang" rass0, riv0ss="sref">secs);
  76}
  11
  43ai<nt">/* RtcCtrl bits */
u8  2 ">  58      RRAY_SIZEC_ALRM_MIN_LOW_RRRAY_SIZEef">rass="sref">u8 ab8500)sRM_MIN_HI_REGtm = {
  67  57     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="fref"grtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"grtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl         */
  67  57     REG" classC_ALRM_MIN_LOW_REG" classTC_ALRM_MIN_HI_REG ab8500_M_MIN_HI_REGtm, &a id=" secs);
  66u8 valef="+code=rtc_ti> valTC_A">  2        (0xF000 / 60)
  67  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  67  57     bufa href="+code=sbuf500_r">  58     ief="+code=rtc_ti cla]"sref">tm_year id=" secs;
  76}
  76}
  74     minu8  2>  2 16) |rrass="sref">u8  2>  2 8) |rass="sref">u8secs;
  55
  74     rn u8  2>  2 8) |rass="sref">u8secs;
  57     rn   57     rn   47#define ss="sref">secs;
  58     rn   57     rn u8secs;
  69
  70        /* Calc">/* RtcCtrl bits */
  51     rn tm_yearng get_elM_MIN_HI_REG, AB ss="sref">secs;
  42
  53     ass="srefass=p;secs;
  75        retu"ss= idids=p;secs;
  76}
  46
r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" cla">  65        struct year)
tm = {
 valef="+code=rtc_ti> valTC_ALRM_MIN_HI_REGsecs;
  64  58      RRAY_SIZEC_ALRM_MIN_LOW_RRRAY_SIZEef">rass="sref">u8 ab8500)]ss="sref">secs;
  64        unsigned lononsu secs;
  42
u8u8ABss="sre))ss="sref">tm = {
  57     f">_dbgode=rtc_tm_to_tf">_dbgef">rass="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"y theshould be equal secor greaser th 70%d\n"/* RtcCl         */
  57     >, AB ss="sref">secs;
  66  75<-">  57     EINVALe=AB8500_RTC_EPEINVAL class="sref">secs;
  76}
  38
  70        /* Calcsincelculat">/* RtcCtrl bits */
        struct rass="sref">u8tm, &secs);
  11
  43
  43  66/* Calcsincelonds from 1970 to 0,csince/* RtcCtrl bits */
   4  66
   5  66/* RtcCtrl bits */
  74     rn tm_yearng get_elM_MIN_HI_REG, AB ss="sref">secs;
  77
	    Prefs
	  <1rtc/rtc-a1b8500.c#L48" id="L48" cl1ass="14ne" name="L58">  58     nonmintm_yearrn secs;
  49
        strunonsu tm_yearrn secs;
  70        /* Calccoups as peTC clock dresolu      >/* RtcCtrl bits */
  52     nonsu tm_yearnonsu   47#define ss="sref">secs;
  76}
  74     bufa href="+code=sbuf500_r4]"sref">tm_yearnonsu secs;
  74     bufa href="+code=sbuf500_r3]"srrass="sref">u8secs;
  46
  57     bufa href="+code=sbuf500_r2]"sref">tm_yearnonminsecs;
  58     bufa href="+code=sbuf500_r1]"srrass="sref">u8secs;
  58     bufa href="+code=sbuf500_r0]"srrass="sref">u8secs;
  60
u8  2 ">  58      RRAY_SIZEC_ALRM_MIN_LOW_RRRAY_SIZEef">rass="sref">u8 ab8500)sRM_MIN_HI_REGtm = {
  57     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="fref"srtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"srtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     REG" classC_ALRM_MIN_LOW_REG" classTC_AL="sref">tm = {
  57     a> ab8500_M_MIN_HI_REG  58     ief="+code=rtc_ti cla] ss="sref">secs;
u8 valef="+code=rtc_ti> valTC_A">  2        (0xF000 / 60)
  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  76}
  77
	    Prefs
	  <1rtc/rtc-a1b8500.c#L68" id="L68" cl1ass="1ine" name="L68ame="L43">  43a data write  >/* RtcCtrl bits */
  75        retu="fref"srtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"srtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     REG" classC_ALRM_MIN_LOW_REG" classTC_AL="sref">tm = {
  67, AB8500_RTLRM_MIN_HI_REGRTC ss="sref">secs;
  76}
  42
r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" cla">  65        struct         stru"sref8500_rtc_time_resrefef">      (0xF000 / 60)
tm = {
 valef="+code=rtc_ti> valTC_ALRM_MIN_HI_REGsecs;
  74     st u8secs;
  64  58      RRAY_SIZEC_ALRM_MIN_LOW_RRRAY_SIZEef">rass="sref">u8 ab8500_)]ss="sref">secs;
  64        unsigned long secs;
  49
  70          51     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="fref"grtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"grtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     REG" classC_ALRM_MIN_LOW_REG" classTC_AL="sref">tm = {
  57     ne AB850lass="sref">tm, &act secs;
u8 valef="+code=rtc_ti> valTC_A">  2        (0xF000 / 60)
  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  55
u8  67  57     "sref8500_rtc_time_resrefef">-eij@sss="sref">u8secs);
secs);
  66  57     "sref8500_rtc_time_resrefef">-eij@sss="sref">u8secs;
  60
  51     "sref8500_rtc_time_resrefef">-eij@sss="sref">u8secs;
  42
u8  2 ">  58      RRAY_SIZEC_ALRM_MIN_LOW_RRRAY_SIZEef">rass="sref">u8 ab8500_)sRM_MIN_HI_REGtm = {
  57     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="fref"grtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"grtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     REG" classC_ALRM_MIN_LOW_REG" classTC_AL="sref">tm = {
  57     a> ab8500__M_MIN_HI_REGtm, &a id=" secs);
  66u8 valef="+code=rtc_ti> valTC_A">  2        (0xF000 / 60)
  67  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  57     bufa href="+code=sbuf500_r">  58     ief="+code=rtc_ti cla]"sref">tm_year id=" secs;
  76}
  60
  51     minu8  2>  2 16) |rrass="sref">u8  2>  2 8) |rrass="sref">u8secs;
  52     rn   51     minsecs;
  76}
  70        /* Calc">/* RtcCtrl bits */
  74     rn tm_yearng get_elM_MIN_HI_REG, AB ss="sref">secs;
  46
  57     "ss="srefass=p;tm, &a"sref8500_rtc_time_resrefef">-eij@sss="sref">u8 ss="sref">secs;
  38
  75        returss= idids=p;tm, &a"sref8500_rtc_time_resrefef">-eij@sss="sref">u8 ss="sref">secs;
  76}
  11
r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" cla">  64(ienab"s=8500_rtc_time_renab"s=TC_A      (0xF000 / 60)
  63{
  75        retuegfref"mask_and"srtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"mask_and"srtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     REG" classC_ALRM_MIN_LOW_REG" classTC_AL="sref">tm = {
  57     ne AB850laM_MIN_HI_REGtm = {
  66u8secs;
  76}
  38
r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" cla">  65        struct         stru"sref8500_rtc_time_resrefef">      (0xF000 / 60)
  63{
 valef="+code=rtc_ti> valTC_ALRM_MIN_HI_REGsecs;
  64  58      RRAY_SIZEC_ALRM_MIN_LOW_RRRAY_SIZEef">rass="sref">u8 ab8500_)]ss="sref">secs;
  64        unsigned lominsecs;
  65        struct rtc_timesecs;
  55
u8-eij@sss="sref">u8a>                .ABss="sre))ss="sref">tm = {
  67  57     f">_dbgode=rtc_tm_to_tf">_dbgef">rass="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"y theshould be equal secor greaser th 70%d\n"/* RtcCl         */
  67  57     ne AB ss="sref">secs;
  66  75<-">  57     EINVALe=AB8500_RTC_EPEINVAL class="sref">secs;
  76}
  11
  43/* Calcsincelculat">/* RtcCtrl bits */
rtc_tm_to_time(&a"sref8500_rtc_time_resrefef">-eij@sss="sref">u8lass="sref">tm, &secs);
  11
  43
  43  66
  43  66
  43  66  75<-EINVALla"o UIE EMUL c="Ltakmmit up,1apcasen i UIE_ONet from year 1900.
   5  66/* RtcCtrl bits */
        struegs" class=readf="+code=rtc_tm_to_tegs" class=readf="+cef">rass="sref">u8ode=rtc_tm_to_tf">m" cl0ss="sref">tm, &acur=p;  43  51     "t rtc_tm_to_time(&acur=p;tm, &acurecsa href="+code=scurecsTC_Ass="sref">secs);
tm, &acurecsa href="+code=scurecsTC_As">  2 59)ss="sref">tm = {
  57     f">_dbgode=rtc_tm_to_tf">_dbgef">rass="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"Asref less th 701 minutesecs  190orted\r\n"/* RtcCss="sref">secs);
  75<-">  57     EINVALe=AB8500_RTC_EPEINVAL class="sref">secs;
  76}
  46
  43
  43  66/* Calcsincelonds from 1970 to 0,csince/* RtcCtrl bits */
   5  66
   5  66/* RtcCtrl bits */
  51     rn tm_yearng get_elM_MIN_HI_REG, AB ss="sref">secs;
  42
  51     rn secs;
  11
  74     bufa href="+code=sbuf500_r2]"sref">tm_yearminsecs;
  74     bufa href="+code=sbuf500_r1]"srrass="sref">u8secs;
  57     bufa href="+code=sbuf500_r0]"srrass="sref">u8secs;
  38
  70        /* RtcCtrl bits */
u8  2 ">  58      RRAY_SIZEC_ALRM_MIN_LOW_RRRAY_SIZEef">rass="sref">u8 ab8500_)sRM_MIN_HI_REGtm = {
  67  57     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="fref"srtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"srtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     REG" classC_ALRM_MIN_LOW_REG" classTC_AL="sref">tm = {
  67  57     a> ab8500__M_MIN_HI_REG  58     ief="+code=rtc_ti cla] ss="sref">secs;
u8 valef="+code=rtc_ti> valTC_A">  2        (0xF000 / 60)
  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  76}
  46
  75        retuegs" class=irq_enab"s500_rtc_alarm_regs" class=irq_enab"sef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     "sref8500_rtc_time_resrefef">-eij@sss="sref">u8secs;
  76}
  49
  60
r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" claapsed_seconds(icalibra    8500_rtc_time_rcalibra    ef">      (0xF000 / 60)
tm = {
 valef="+code=rtc_ti> valTC_Ass="sref">secs;
  74     st   51     "t calef="+code=rtc_tit calTC_A"sr0ss="sref">secs;
  55
  43
  43  66
  43  66
   5  66ai<. -128 (0x80) is ecs permitted because evenREG" c usesef RtcCtrl bits */
   5  66aecsveref RtcCtrl bits */
   5  66pres>
   5  66/* RtcCtrl bits */
u8">  2 -127) ||rrass="sref">u8">ht. 127))ss="sref">tm = {
  57     f">_errode=rtc_tm_to_tf">_erref">rass="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"RtcCalibra      id=" outside permitted rang"\n"/* RtcCss="sref">secs);
  75<-">  57     EINVALe=AB8500_RTC_EPEINVAL class="sref">secs;
  76}

  77
	    Prefs
	  <28tc/rtc-a288500.c#L18" id="L18" cl2sss="28ne" name="L68ame="L43">  43
   5  66
   5  66pres>
   5  66ai<..set from year 1900.
   5  66/* RtcCtrl bits */
u8">ht.=        (0xF000 / 60)
  57     "t calef="+code=rtc_tit calTC_A"sr0x7FRss="sRM_MIN_HI_REGss="sref">secs;
secs);
  66  57     "t calef="+code=rtc_tit calTC_A"sr~rass="sref">u8"- 1) |r0x80ss="sref">secs;

  77
	    Prefs
	  <29rtc/rtc-29ab8500.c#L8" id="L8" cl29ss="29ne" name="L58">  58     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="fref"srtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"srtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     REG" classC_ALRM_MIN_LOW_REG" classTC_AL="sref">tm = {
<29tc/rtc-a2aab8500.c#L9" id="L9" cl2ass="299e" name="L66">  66  58     OCH" class=CALIBde=AB8500_RTC_STAT_REG" class=CALIBde=Am" cl/">  57     "t calef="+code=rtc_tit calTC_Ass="sref">secs);
  60
  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  76}
  76}
r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" claapse*/a>        strucalibra    8500_rtc_time_rcalibra    ef">      (0xF000 / 60)
tm = {
 valef="+code=rtc_ti> valTC_Ass="sref">secs;
  57     st   51     "t calef="+code=rtc_tit calTC_A"sr0ss="sref">secs;
  38
  58     "> valef="+code=rtc_ti> valTC_A"srref">tm_year="fref"grtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"grtf">ai<_apserruptiblcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     REG" classC_ALRM_MIN_LOW_REG" classTC_AL="sref">tm = {
  67  58     OCH" class=CALIBde=AB8500_RTC_STAT_REG" class=CALIBde=Am" cl/ss="sref">tm, &act calef="+code=rtc_tit calTC_Ass="sref">secs);
u8 valef="+code=rtc_ti> valTC_A">ht.=   ss="sref">tm = {
  43
  43  66
   4  66ai<capso/* RtcCtrl bits */
   5  66  43  66/* RtcCtrl bits */
  67u8  67        strucalibra    8500_rtc_time_rcalibra    ef">"sr0"- rass="sref">u8secs);
  66secs);
  67        strucalibra    8500_rtc_time_rcalibra    ef">"sr0x7FRss="sRM_MIN_HI_REGsecs);
  76}
  42
  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  76}
  55
(iegs" clsysfs_storelass=calibra    8500_rtc_time_regs" clsysfs_storelass=calibra    ef">r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" clame="L55">  55
  67  65        struf">lin_attributnode=rtc_tm_to_tf">lin_attributne" na*/a>        struattr8500_rtc_time_rettrm" clame="L55">  55
  67        strubufa href="+code=sbuf500_LRM_MIN_HI_REG(icoups8500_rtc_time_rcoupsef">      (0xF000 / 60)
tm = {
 valef="+code=rtc_ti> valTC_Ass="sref">secs;
"sr0ss="sref">secs;
  42
u8rass="sref">u8 ing">"0%i "/* RtcCl0ss="sref">tm, &acalibra    8500_rtc_time_rcalibra    ef">  != 1) s="sref">tm = {
  57     f">_errode=rtc_tm_to_tf">_erref">rass="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"Failed to storeock dcalibra     attributn\n"/* RtcCss="sref">secs);
  75<-">  57     EINVALe=AB8500_RTC_EPEINVAL class="sref">secs;
  76}
  77
	    Prefs
	  <3rtc/rtc-a3b8500.c#L38" id="L38" cl3ass="33ne" name="L58">  58     "> valef="+code=rtc_ti> valTC_A"sref">tm_year="s" class=srtfcalibra    8500_rtc_time_regs" class=srtfcalibra    ef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/">  57     calibra    8500_rtc_time_rcalibra    ef"> ss="sref">secs;
  49
  75        retu"> valef="+code=rtc_ti> valTC_A"?aM_MIN_HI_REG valef="+code=rtc_ti> valTC_A":ad_seconds(icoups8500_rtc_time_rcoupsef">ss="sref">secs;
  76}
  42
(iegs" clsysfs_showlass=calibra    8500_rtc_time_regs" clsysfs_showlass=calibra    ef">r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" clame="L55">  55
  65        struf">lin_attributnode=rtc_tm_to_tf">lin_attributne" na*/a>        struattr8500_rtc_time_rettrm" clachthe*/a>        strubufa href="+code=sbuf500_      (0xF000 / 60)
tm = {
  58     "> valef="+code=rtc_ti> valTC_A"sr0ss="sref">secs;
  58     calibra    8500_rtc_time_rcalibra    ef">"sr0ss="sref">secs;
  38
  58     "> valef="+code=rtc_ti> valTC_A"srd_seconds(iegs" class=grtfcalibra    8500_rtc_time_regs" class=grtfcalibra    ef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/ss="sref">tm, &acalibra    8500_rtc_time_rcalibra    ef"> ss="sref">secs;
u8 valef="+code=rtc_ti> valTC_A">  2    s="sref">tm = {
  67  57     f">_errode=rtc_tm_to_tf">_erref">rass="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"Failed to readock dcalibra     attributn\n"/* RtcCss="sref">secs);
  57     sp intfa href="+code=ssp intfef">rass="sref">u8 ing">"0\n"/* RtcCss="sref">secs);
  75        retu"> valef="+code=rtc_ti> valTC_As="sref">secs);
  76}
  55
  75        retusp intfa href="+code=ssp intfef">rass="sref">u8 ing">"%d\n"/* RtcCl/">  57     calibra    8500_rtc_time_rcalibra    ef"> ss="sref">secs;
  76}
  38
  57     DEVICE_ATTR8500_rtc_time_rDEVICE_ATTRef">rass="sref">u8l/">  57     S_IRUGO8500_rtc_time_rS_IRUGOe" na|/">  57     S_IWUSR8500_rtc_time_rS_IWUSRm" clame="L55">  55
  67(iegs" clsysfs_showlass=calibra    8500_rtc_time_regs" clsysfs_showlass=calibra    ef">lame="L55">  55
  67(iegs" clsysfs_storelass=calibra    8500_rtc_time_regs" clsysfs_storelass=calibra    ef"> ss="sref">secs;
  42
r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" c      (0xF000 / 60)
tm = {
  75        retuf">lin_crease_filcode=rtc_tm_to_tf">lin_crease_filcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/ss="sref">tm, &af">_attrlass=calibra    8500_rtc_time_rf">_attrlass=calibra    ef"> ss="sref">secs;
  76}
  77
	    Prefs
	  <3rtc/rtc-a3b8500.c#L68" id="L68" cl3ass="3ine" name="L6voided_seconds(iegs" clsysfs_rss=unreai<8500_rtc_time_regs" clsysfs_rss=unreai<ef">r">  65        struf">linode=rtc_tm_to_tf">line" na*/a>        struf">ode=rtc_tm_to_tf">m" c      (0xF000 / 60)
tm = {
        struf">lin_remove_filcode=rtc_tm_to_tf">lin_remove_filcef">rass="sref">u8ode=rtc_tm_to_tf">m" cl/ss="sref">tm, &af">_attrlass=calibra    8500_rtc_time_rf">_attrlass=calibra    ef"> ss="sref">secs;
  76}
  42
  75_tef="+code=rtc_tirq">  75_te" nad_seconds(irss="sref"handlt;8500_rtc_time_rrss="sref"handlt;ef">rapsed_seconds(iirqef="+code=rtc_tirqm" cl/voide*/a>        strufata8500_rtc_time_rfatam" c      (0xF000 / 60)
tm = {
  65        struct linode=rtc_tm_to_tct line" na*/a>        struct ode=rtc_tm_to_tct TC_A"srd_seconds(ifata8500_rtc_time_rfatam" css="sref">secs;
  64        unsigned loevent8500_rtc_alarm_revent8TC_A"srd_seconds(iass=IRQF500_rtc_alarm_rass=IRQFe" na|/">  57     ENA" F500_rtc_alarm_rass=AFm" css="sref">secs;

  77
	    Prefs
	  <3rtc/rtc-a3s8500.c#L68" id="L68" cl37ss="37ne" name="L58">  58     f">_dbgode=rtc_tm_to_tf">_dbgef">rss="sref">tm, &act ode=rtc_tm_to_tct TC_A-eij@sss="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"%s\n"/* RtcCl/">  57     __func__ode=rtc_tm_to_t__func__ef"> ss="sref">secs;
  58     "ss=updase_irqef="+code=rtc_t"ss=updase_irqef">rass="sref">u8  57     event8500_rtc_alarm_revent8TC_A ss="sref">secs;
  60
  75        retuIRQ_HANDLED500_rtc_alarm_rIRQ_HANDLEDm" css="sref">secs;
  76}
  76}
  65        struct <0.c#L_op8500_rtc_alarm_rct <0.c#L_op8e" nad_seconds(iegs" clct tm = {
L67">  67(iegs" class=readf="+code=rtc_tm_to_tegs" class=readf="+cef">lame="L55">  55
  67tm_year="s" class=srtf="+code=rtc_tm_to_tegs" class=srtf="+ce" nlame="L55">  55
  6srd_seconds(iegs" class=readf"sref8500_rtc_time_regs" class=readf"srefe" nlame="L55">  55
me="L67">  67tm_year="s" class=srtf"sref8500_rtc_time_regs" class=srtf"srefef">lame="L55">  55
tm_year="s" class=irq_enab"s500_rtc_alarm_regs" class=irq_enab"sef">lame="L55">  55
secs;
  11
lnitef="+code=rtc_t_lnite" nad_seconds(iegs" clct r">  65        struplatfoef"f">linode=rtc_tm_to_tplatfoef"f">line" na*/a>        strupf">ode=rtc_tm_to_tpf">m" c      (0xF000 / 60)
  63{
ss="sref">secs;
  65        struct linode=rtc_tm_to_tct line" na*/a>        struct ode=rtc_tm_to_tct TC_Ass="sref">secs;
        struct <0trlef="+code=rtc_tit <0trlTC_Ass="sref">secs;
secs;
  38
  58     irqef="+code=rtc_tirqm" c6sref">tm_yearplatfoef"grtfirq_by"L9"ode=rtc_tm_to_tplatfoef"grtfirq_by"L9"ef">rass="sref">u8ode=rtc_tm_to_tpf">m" cl0">  70   "> ing">"Aclas"/* RtcCss="sref">secs);
u8  2        (0xF000 / 60)
  67  75        retuirqef="+code=rtc_tirqm" css="sref">secs;
  42
  74     errode=rtc_tm_to_terref">"sref">tm_year="fref"mask_and"srtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"mask_and"srtf">ai<_apserruptiblcef">rss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" cl0"ss="sref">u8tm = {
u8u8u8secs);
u8">  2        (0xF000 / 60)
  67  75        retuerrode=rtc_tm_to_terref">ss="sref">secs;
  38
  70        t by evenPorRtca >/* RtcCtrl bits */
        struusleep_rang" r10 0,criv0ss="sref">secs);
  11
  74     errode=rtc_tm_to_terref">"sref">tm_year="fref"grtf">ai<_apserruptiblcode=rtc_tm_to_tegfref"grtf">ai<_apserruptiblcef">rss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" cl0"ss="sref">u8tm = {
  57     REG" class_STATde=AB8500_RTC_STAT_REG" class=STATde=Am" cl0ss="sref">tm, &act <0trlef="+code=rtc_tit <0trlTC_Ass="sref">secs);
u8">  2        (0xF000 / 60)
  75        retuerrode=rtc_tm_to_terref">ss="sref">secs;
  46
  43/* RtcCtrl bits */
u8tm = {
  66  58     f">_errode=rtc_tm_to_tf">_erref">rss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"Rk d 190ly failurn\n"/* RtcCss="sref">secs);
  67  75<-">  57     ENODEVode=rtc_tm_to_tENODEVef">ss="sref">secs;
  76}
  42
        struf">lin_lnit_wakeupode=rtc_tm_to_tf">lin_lnit_wakeupef">rss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" cl0"ss="sref">u8secs);
  11
  74     ct ode=rtc_tm_to_tct TC_A"sref">tm_yearct lin=reai<8500_rtc_time_rct lin=reai<ef">ra>  70   "> ing">"="driv-ct "/* RtcCl0ss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" cl0ss="sref">tm, &aegs" clct tm = {
  66  74     THIS_MODULE500_rtc_alarm_rTHIS_MODULETC_Ass="sref">secs);
u8rass="sref">u8tm = {
  58     f">_errode=rtc_tm_to_tf">_erref">rss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"Reai&lra     failed\n"/* RtcCss="sref">secs);
  66  58     errode=rtc_tm_to_terref">"sref">tm_yearPTR_ERR8500_rtc_time_rPTR_ERRef">rass="sref">u8secs);
  67  75        retuerrode=rtc_tm_to_terref">ss="sref">secs;
  76}
  42
        struerrode=rtc_tm_to_terref">"sref">tm_yearrequest_threaded_irqef="+code=rtc_t"equest_threaded_irqef">rass="sref">u8u8u8L="sref">tm = {
  57     IRQF_NO_SUSPEND500_rtc_alarm_rIRQF_NO_SUSPENDe" na|/">  57     IRQF_ONESHOT500_rtc_alarm_rIRQF_ONESHOTm" cl0">  70   "> ing">"="driv-ct "/* RtcCl0ass="sref">u8secs);
u8">  2    s="sref">tm = {
  66tm_yearct lin=unreai<8500_rtc_time_rct lin=unreai<ef">rass="sref">u8secs);
  67  75        retuerrode=rtc_tm_to_terref">ss="sref">secs;
  76}
  49
        struplatfoef"srtfdrvfata8500_rtc_time_rplatfoef"srtfdrvfataef">rass="sref">u8ode=rtc_tm_to_tpf">m" cl0"ss="sref">u8secs);
  11
  74     errode=rtc_tm_to_terref">"sref">tm_year="s" clsysfs_rss=reai<8500_rtc_time_regs" clsysfs_rss=reai<ef">rss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" css="sref">secs);
u8  s="sref">tm = {
  58     f">_errode=rtc_tm_to_tf">_erref">rss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" cl0">  70   "> ing">"sysfsock  failed to reai<\n"/* RtcCss="sref">secs);
  75        retuerrode=rtc_tm_to_terref">ss="sref">secs;
  76}
  77
	    Prefs
	  <4rtc/rtc-a4b8500.c#L48" id="L48" cl4ass="44ne" name="L58">  75<0ss="sref">secs;
  76}
  60
exitef="+code=rtc_t_exite" naref">tm, &aegs" clct r">  65        struplatfoef"f">linode=rtc_tm_to_tplatfoef"f">line" na*/a>        strupf">ode=rtc_tm_to_tpf">m" c      (0xF000 / 60)
tm = {
  65        struct linode=rtc_tm_to_tct line" na*/a>        struct ode=rtc_tm_to_tct TC_A"srd_seconds(iplatfoef"grtfdrvfata8500_rtc_time_rplatfoef"grtfdrvfataef">rass="sref">u8ode=rtc_tm_to_tpf">m" css="sref">secs);
tm_yearplatfoef"grtfirq_by"L9"ode=rtc_tm_to_tplatfoef"grtfirq_by"L9"ef">rass="sref">u8ode=rtc_tm_to_tpf">m" cl0">  70   "> ing">"Aclas"/* RtcCss="sref">secs);
  55
rss="sref">tm, &apf">ode=rtc_tm_to_tpf">m" c-eij@sss="sref">u8ode=rtc_tm_to_tf">m" css="sref">secs);
  77
	    Prefs
	  <4rtc/rtc-a4b8500.c#L58" id="L58" cl4ass="45ne" name="L58">  58     free_irqef="+code=rtc_tfree_irqef">rass="sref">u8u8secs);
  58     "ss=f">lin=unreai<8500_rtc_time_rct lin=unreai<ef">rass="sref">u8secs);
        struplatfoef"srtfdrvfata8500_rtc_time_rplatfoef"srtfdrvfataef">rass="sref">u8ode=rtc_tm_to_tpf">m" cl0"ss="sref">u8secs);
  11
  75<0ss="sref">secs;
  76}
  11
  65        struoflin=ide=AB8500_RTC_EPoflin=ide" naref">tm, &aegs" clct tm = {
  70   "> ing">"slt;icsson,="driv-ct "/* RtcCl0}L="sref">tm = {
  76}
secs;
  49
  65        struplatfoef"f 49tm, &aegs" clct tm = {
tm = {
              "L9"ode=rtc_tm_to_t"L9"ef">6sre>  70   "> ing">"="driv-ct "/* RtcCl="sref">tm = {
              owntm_yearTHIS_MODULE500_rtc_alarm_rTHIS_MODULETC_Al="sref">tm = {
              of"sref">tm_year="s" clct tm = {
tm = {
L6sref">tm_year="s" class=probs500_rtc_alarm_regs" class=probsef">L="sref">tm = {
6sref">tm_year_exit_pode=rtc_tm_to_t_exit_pef">rass="sref">u8)L="sref">tm = {
secs;
  49
u8rass="sref">u8secs);
  11
u8ra>  70   "> ing">"Virupax Sadashivpetimath">  2virupax.sadashivpetimath@slt;icsson.5secs);
u8ra>  70   "> ing">"REG" c ck  Ds"/* RtcCss="sref">secs);
u8ra>  70   "> ing">"GPL v2"/* RtcCss="sref">secs);



Tvenoriginal LXR software by even"sref">sehttp://sourcefoege.net/projects/lx;8>LXR 3) by "sref">semailto:lx;@" iux.no">lx;@" iux.nom" c.
lx;." iux.no kindly hosltd by "sref">sehttp://www.redpill-" ipro.no">Redpill L ipro ASm" cl0provider of L iux65lins since 1995.