linux/sound/core/rtctimer.c
<<
>>
Prefs
   1/*
   2 *  RTC based high-frequency timer
   3 *
   4 *  Copyright (C) 2000 Takashi Iwai
   5 *      based on rtctimer.c by Steve Ratcliffe
   6 *
   7 *   This program is free software; you can redistribute it and/or modify
   8 *   it under the terms of the GNU General Public License as published by
   9 *   the Free Software Foundation; either version 2 of the License, or
  10 *   (at your option) any later version.
  11 *
  12 *   This program is distributed in the hope that it will be useful,
  13 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15 *   GNU General Public License for more details.
  16 *
  17 *   You should have received a copy of the GNU General Public License
  18 *   along with this program; if not, write to the Free Software
  19 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  20 *
  21 */
  22
  23#include <linux/init.h>
  24#include <linux/interrupt.h>
  25#include <linux/module.h>
  26#include <linux/log2.h>
  27#include <sound/core.h>
  27#include < lue="v2.6.16.35"
	  >
  v2.6.16.35  19  20 dh_results">
  
def"> dlt;<(s?return=scode=CONFIG_RTCh_results">
  
CONFIG_RTClt;<) ||fs?return=scode=def"> dh_results">
  
def"> dlt;<(s?return=scode=CONFIG_RTC_MODULEh_results">
  
CONFIG_RTC_MODULElt;<)d/core/rtctimer.c#L23" id="L23" c3ass="lin3" name="L21">  21  22
<3 href32lt;linux/module.h>c146818" if"ue="v2ne" name="L28"> lue="v2.6.16.35"
	 3ss="line"" name="L3">   3  24#i3clude3< fs?return=scode=RTC_FREQh_results">
  
RTC_FREQlt;<        1024            omment">/*

fault r
  25#i3clude35lt; fs?return=scode=NANO_SECh_results">
  
NANO_SEClt;<        1000000000L     omment">/*
  26#i3clude36sound/core/rtctimer.c#L23" id="L23" c3ass="lin3" name="L27">  27#i3clude3ss="comment"> *   You shoulref="sound/core/rtctimer.c#L2" id="L2" cla3ass="lin3" name="L28">  27#i3clude3ss="comment"> *   along with tt, tonamesf="sound/core/rtctimer.c#L2" id="L2" cla3>
  v2.6316.35  19 *   Foundation,ef="sound/core/rtctimer.c#L22" id="L22" c4ass="lin4" name="L20">  20
  
" id="L2_ll nlt;<(structfs?return=scode=snd_d="L2h_results">
  
snd_d="L2lt;< *s?return=scode=th_results">
  
tlt;<)e" name="L28"> lue="v2.6.16.35"
	 4ass="lin4" name="L21">  21
  
" id="L2_closelt;<(structfs?return=scode=snd_d="L2h_results">
  
snd_d="L2lt;< *s?return=scode=th_results">
  
tlt;<)e" name="L28"> lue="v2.6.16.35"
	 4ass="lin4" name="L22">  22
<4 href42lt;
  
" id="L2_ht.rtlt;<(structfs?return=scode=snd_d="L2h_results">
  
snd_d="L2lt;< *s?return=scode=th_results">
  
tlt;<)e" name="L28"> lue="v2.6.16.35"
	 4ss="line4" name="L3">   3
  
" id="L2_htoplt;<(structfs?return=scode=snd_d="L2h_results">
  
snd_d="L2lt;< *s?return=scode=th_results">
  
tlt;<)e" name="L28"> lue="v2.6.16.35"
	 4ss="line"" name="L4">   4  25#i4clude45sound/core/rtctimer.c#L23" id="L23" c4ass="lin4" name="L26">  26#i4clude4ss="comment"> *
  27#i4clude4ss="comment"> *   You should hTt wiardn; eidel ndshoidescri2.6.11ls.  27#i4clude4ss="comment"> *   along with ef="sound/core/rtctimer.c#L22" id="L22" c4>
  v2.6416.35  19
  
snd_d="L2_iardn; elt;< s?return=scode=" i_hwh_results">
  
" i_hwlt;< = {d/core/rtctimer.c#L5" id="L5" clasass="lin5" name="L20">  20
  
flagslt;< =        o?return=scode=SNDRV_TIMER_HW_AUTOh_results">
  
SNDRV_TIMER_HW_AUTOlt;< |d/core/rtctimer.c#L5" id="L5" clasass="lin5" name="L21">  21
  
SNDRV_TIMER_HW_FIRSTlt;< |d/core/rtctimer.c#L5" id="L5" clasass="lin5" name="L22">  22
<5 href52lt;<                        o?return=scode=SNDRV_TIMER_HW_TASKLETh_results">
  
SNDRV_TIMER_HW_TASKLETlt;<,d/core/rtctimer.c#L5" id="L5" classs="line5" name="L3">   3
  
pngkslt;< =        100000000L,             omment">/*
   4
  
ll nlt;< =        fs?return=scode=" id="L2_ll nh_results">
  
" id="L2_ll nlt;<,d/core/rtctimer.c#L5" id="L5" classs="line"" name="L5">   5
  
closelt;< =        o?return=scode=" id="L2_closeh_results">
  
" id="L2_closelt;<,d/core/rtctimer.c#L5" id="L5" clasass="lin5" name="L26">  26#i5clude56lt;<        .s?return=scode=ht.rth_results">
  
ht.rtlt;< =        o?return=scode=" id="L2_ht.rth_results">
  
" id="L2_ht.rtlt;<,d/core/rtctimer.c#L5" id="L5" clasass="lin5" name="L27">  27#i5clude57lt;<        .s?return=scode=htoph_results">
  
htoplt;< =        fs?return=scode=" id="L2_htoph_results">
  
" id="L2_htoplt;<,d/core/rtctimer.c#L5" id="L5" clasass="lin5" name="L28">  27#i5clude5ss="c}e" name="L28"> lue="v2.6.16.35"
	 5>
  v2.6516.35  19  20
  
" id="L2_r
  
RTC_FREQlt;<;            omment">/*

  21
  
snd_d="L2lt;< *s?return=scode=" id="L2h_results">
  
" id="L2lt;<;d/core/rtctimer.c#L22" id="L22" c6ass="lin6" name="L22">  22
<6 href62lt;
  
pasklet_structlt;< s?return=scode=" i_paskleth_results">
  
" i_paskletlt;<;d/core/rtctimer.c#L22" id="L22" c6ss="line6" name="L3">   3
  
" i_pask_tlt;< s?return=scode=" i_paskh_results">
  
" i_pasklt;<;d/core/rtctimer.c#L22" id="L22" c6ss="line6" name="L4">   4   5   6  27#i6clude6ss="co?return=scode=" id="L2_ll nh_results">
  
" id="L2_ll nlt;<(structfs?return=scode=snd_d="L2h_results">
  
snd_d="L2lt;< *s?return=scode=th_results">
  
tlt;<)d/core/rtctimer.c#L23" id="L23" c6ass="lin6" name="L28">  27#i6clude6ss="c{d/core/rtctimer.c#L5" id="L5" cla6>
  v2.6616.35  19
  
er2lt;<;d/core/rtctimer.c#L22" id="L22" c7ass="lin7" name="L20">  20  21
  
er2lt;< = s?return=scode=" i_registL2h_results">
  
" i_registL2lt;<(&s?return=scode=" i_paskh_results">
  
" i_pasklt;<)e" name="L28"> lue="v2.6.16.35"
	 7ass="lin7" name="L22">  22
<7 href72lt;<        if (s?return=scode=er2h_results">
  
er2lt;< nclu 0)d/core/rtctimer.c#L23" id="L23" c7ss="line7" name="L3">   3
	
  
er2lt;<;d/core/rtctimer.c#L22" id="L22" c7ss="line7" name="L4">   4
  
tlt;<-v2nes?return=scode=private_datah_results">
  
private_datalt;< = &s?return=scode=" i_paskh_results">
  
" i_pasklt;<;d/core/rtctimer.c#L22" id="L22" c7ss="line7" name="L5">   5
	   6   7  27#i7clude78lt;
  v2.6716.35  19
  
" id="L2_closelt;<(structfs?return=scode=snd_d="L2h_results">
  
snd_d="L2lt;< *s?return=scode=th_results">
  
tlt;<)d/core/rtctimer.c#L8" id="L8" clasass="lin8" name="L20">  20  21
  
" i_pask_tlt;< *s?return=scode=" ih_results">
  
" ilt;< = s?return=scode=th_results">
  
tlt;<-v2nes?return=scode=private_datah_results">
  
private_datalt;<;d/core/rtctimer.c#L22" id="L22" c8ass="lin8" name="L22">  22
<8 href82lt;<        if (s?return=scode=" ih_results">
  
" ilt;<) {d/core/rtctimer.c#L5" id="L5" cla8ss="line8" name="L3">   3
  
" i_unregistL2lt;<(s?return=scode=" ih_results">
  
" ilt;<);d/core/rtctimer.c#L22" id="L22" c8ss="line8" name="L4">   4
  
pasklet_killlt;<(&s?return=scode=" i_paskleth_results">
  
" i_paskletlt;<);d/core/rtctimer.c#L22" id="L22" c8ss="line8" name="L5">   5
  
tlt;<-v2nes?return=scode=private_datah_results">
  
private_datalt;< = s?return=scode=NULLh_results">
  
NULLlt;<;d/core/rtctimer.c#L22" id="L22" c8ss="line8" name="L6">   6   7
	   8
  v2.6816.35  19  20  21
  
" id="L2_ht.rtlt;<(structfs?return=scode=snd_d="L2h_results">
  
snd_d="L2lt;< *s?return=scode=t="L2h_results">
  
d="L2lt;<)d/core/rtctimer.c#L8" id="L8" cla9ass="lin9" name="L22">  22
<9 href92s="c{d/core/rtctimer.c#L5" id="L5" cla9ss="line9" name="L3">   3
  
" i_pask_tlt;< *s?return=scode=" ih_results">
  
" ilt;< = s?return=scode=t="L2h_results">
  
d="L2lt;<-v2nes?return=scode=private_datah_results">
  
private_datalt;<;d/core/rtctimer.c#L22" id="L22" c9ss="line9" name="L4">   4
  
snd_BUG_ONlt;<(!s?return=scode=" ih_results">
  
" ilt;<))d/core/rtctimer.c#L8" id="L8" cla9ss="line9" name="L5">   5
	
  
EINVALlt;<;d/core/rtctimer.c#L22" id="L22" c9ss="line9" name="L6">   6
  
" i_ clarollt;<(s?return=scode=" ih_results">
  
" ilt;<, s?return=scode=RTC_IRQP_SETh_results">
  
RTC_IRQP_SETlt;<, s?return=scode=" id="L2_r
  
" id="L2_r   7
  
" i_ clarollt;<(s?return=scode=" ih_results">
  
" ilt;<, s?return=scode=RTC_PIE_ONh_results">
  
RTC_PIE_ONlt;<, 0);d/core/rtctimer.c#L22" id="L22" c9ss="line9" name="L8">   8
	   9  10  11  12
  
" id="L2_htoplt;<(structfs?return=scode=snd_d="L2h_results">
  
snd_d="L2lt;< *s?return=scode=t="L2h_results">
  
d="L2lt;<)d/core/rtctimer.c#L8" id="L8" cla10ass="line0" name="L13">  13  14
  
" i_pask_tlt;< *s?return=scode=" ih_results">
  
" ilt;< = s?return=scode=t="L2h_results">
  
d="L2lt;<-v2nes?return=scode=private_datah_results">
  
private_datalt;<;d/core/rtctimer.c#L22" id="L22" c10ass="line0" name="L15">  15
  
snd_BUG_ONlt;<(!s?return=scode=" ih_results">
  
" ilt;<))d/core/rtctimer.c#L8" id="L8" cla10ass="line0" name="L16">  16
	
  
EINVALlt;<;d/core/rtctimer.c#L22" id="L22" c10ass="line0" name="L17">  17
  
" i_ clarollt;<(s?return=scode=" ih_results">
  
" ilt;<, s?return=scode=RTC_PIE_OFFh_results">
  
RTC_PIE_OFFlt;<, 0);d/core/rtctimer.c#L22" id="L22" c10ass="line0" name="L18">  18
	  19  10  11
  
" id="L2_paskletlt;<(unsigned  progs?return=scode=datah_results">
  
datalt;<)d/core/rtctimer.c#L8" id="L8" cla1lass="linee" name="L12">  12  13>

  
snd_d="L2_>>

  
snd_d="L2lt;< *)s?return=scode=datah_results">
  
datalt;<, 1);d/core/rtctimer.c#L22" id="L22" c1lass="linee" name="L14">  14  15  16 *
  17 *   You should h>>
  18 *   along with ef="sound/core/rtctimer.c#L22" id="L22" c1lass="linee" name="L19">  19
  
" id="L2_>>

  
private_datalt;<)d/core/rtctimer.c#L8" id="L8" cla1lass="lin1e" name="L20">  20  21
  
pasklet_sche

  
private_datalt;<);d/core/rtctimer.c#L22" id="L22" c1lass="lin1e" name="L22">  22
<1a hre1="soun}d/core/rtctimer.c#L22" id="L22" c1lass="lin1e" name="L23">  23#i1nclud123sound/core/rtctimer.c#L23" id="L23" c1lass="lin1e" name="L24">  24#i1nclud124sound/core/rtctimer.c#L23" id="L23" c1lass="lin1e" name="L25">  25#i1nclud12ss="comment"> *   GNU Generref="sound/core/rtctimer.c#L2" id="L2" cla1lass="lin1e" name="L26">  26#i1nclud12ss="comment"> *
  27#i1nclud12ss="comment"> *   You should ef="sound/core/rtctimer.c#L22" id="L22" c1lass="lin1e" name="L28">  27#i1nclud128lt;
  
__

  
" id="L2_>&a lt;<(void)d/core/rtctimer.c#L8" id="L8" cla1lass="line.16.35  19  20
  
er2lt;<;d/core/rtctimer.c#L22" id="L22" c13ass="lin13" name="L21">  21
  
snd_d="L2lt;< *s?return=scode=t="L2h_results">
  
d="L2lt;<;d/core/rtctimer.c#L22" id="L22" c13ass="lin13" name="L22">  22
<13 hre13"sound/core/rtctimer.c#L23" id="L23" c13ss="line1"" name="L3">   3
  
" id="L2_r
  
" id="L2_r  24#i13clud134lt;<            !s?return=scode=is_powL2_lf_2h_results">
  
is_powL2_lf_2lt;<(s?return=scode=" id="L2_r
  
" id="L2_r  25#i13clud135lt;<                s?return=scode=snd_printkh_results">
  
snd_printklt;<(s?return=scode=KERN_ERRh_results">
  
KERN_ERRlt;< smment"> *   he hng">" id="L5": atvalid r
<%d\n"f="soun,d/core/rtctimer.c#L5" id="L5" cla13ass="lin13" name="L26">  26#i13clud136lt;<                           s?return=scode=" id="L2_r
  
" id="L2_r  27#i13clud137lt;<                >
	
  
EINVALlt;<;d/core/rtctimer.c#L22" id="L22" c13ass="lin13" name="L28">  27#i13clud138lt;<        }d/core/rtctimer.c#L22" id="L22" c13>
  v2.61316.35  19  20/*
  21
  
er2lt;< = s?return=scode=snd_d="L2_global_newh_results">
  
snd_d="L2_global_newlt;<(smment"> *   he hng">" id"f="soun, o?return=scode=SNDRV_TIMER_GLOBAL_RTCh_results">
  
SNDRV_TIMER_GLOBAL_RTClt;<, &s?return=scode=t="L2h_results">
  
d="L2lt;<);d/core/rtctimer.c#L22" id="L22" c14ass="lin14" name="L22">  22
<14 hre142lt;<        if (s?return=scode=er2h_results">
  
er2lt;< nclu 0)d/core/rtctimer.c#L23" id="L23" c14ss="line14" name="L3">   3
	
  
er2lt;<;d/core/rtctimer.c#L22" id="L22" c14ss="line1"" name="L4">   4  25#i14clud145lt;<        s?return=scode=t="L2h_results">
  
d="L2lt;<-v2nes?return=scode=t;

  
t;

  
THIS_MODULElt;<;d/core/rtctimer.c#L22" id="L22" c14ass="lin14" name="L26">  26#i14clud146lt;<        s?return=scode=he cpyh_results">
  
se cpylt;<(s?return=scode=t="L2h_results">
  
d="L2lt;<-v2nes?return=scode=6
  
6 *   he hng">"-fred="L2"f="soun);d/core/rtctimer.c#L22" id="L22" c14ass="lin14" name="L27">  27#i14clud147lt;<        s?return=scode=t="L2h_results">
  
d="L2lt;<-v2nes?return=scode=hwh_results">
  
hwlt;< = s?return=scode=" i_hwh_results">
  
" i_hwlt;<;d/core/rtctimer.c#L22" id="L22" c14ass="lin14" name="L28">  27#i14clud148lt;<        s?return=scode=t="L2h_results">
  
d="L2lt;<-v2nes?return=scode=hwh_results">
  
hwlt;<.s?return=scode=resolu.6.1h_results">
  
"esolu.6.1lt;< = s?return=scode=NANO_SECh_results">
  
NANO_SEClt;< / s?return=scode=" id="L2_r
  
" id="L2_r
  v2.61416.35  19  20&a h_results">
  
pasklet_>&a lt;<(&s?return=scode=" i_paskleth_results">
  
" i_paskletlt;<, s?return=scode=" id="L2_paskleth_results">
  
" id="L2_paskletlt;<, (unsigned  pro)s?return=scode=t="L2h_results">
  
d="L2lt;<);d/core/rtctimer.c#L22" id="L22" c1sass="lin15" name="L21">  21  22
<15 hre152lt;<        omment">/*
   3
  
" i_pasklt;<.s?return=scode=funch_results">
  
funclt;< = s?return=scode=" id="L2_>>

  
" id="L2_>>
   4
  
" i_pasklt;<.s?return=scode=private_datah_results">
  
private_datalt;< = &s?return=scode=" i_paskleth_results">
  
" i_paskletlt;<;d/core/rtctimer.c#L22" id="L22" c1sss="line1"" name="L5">   5  26#i15clud156lt;<        s?return=scode=er2h_results">
  
er2lt;< = s?return=scode=snd_d="L2_global_registL2h_results">
  
snd_d="L2_global_registL2lt;<(s?return=scode=t="L2h_results">
  
d="L2lt;<);d/core/rtctimer.c#L22" id="L22" c1sass="lin15" name="L27">  27#i15clud157lt;<        if (s?return=scode=er2h_results">
  
er2lt;< nclu 0) {d/core/rtctimer.c#L5" id="L5" cla1sass="lin15" name="L28">  27#i15clud158lt;<                s?return=scode=hnd_d="L2_global_ youh_results">
  
snd_d="L2_global_ yoult;<(s?return=scode=t="L2h_results">
  
d="L2lt;<);d/core/rtctimer.c#L22" id="L22" c1s>
  v2.61516.35  19
	
  
er2lt;<;d/core/rtctimer.c#L22" id="L22" c16ass="lin16" name="L20">  20  21
  
" it="L2lt;< = s?return=scode=t="L2h_results">
  
d="L2lt;<; omment">/*
  22
<16 hre16"sound/core/rtctimer.c#L23" id="L23" c16ss="line16" name="L3">   3
	   4   5  16
  
__exa lt;< s?return=scode=" id="L2_exa h_results">
  
" id="L2_exa lt;<(void)d/core/rtctimer.c#L8" id="L8" cla16ass="lin16" name="L27">  27#i16clud16ss="c{d/core/rtctimer.c#L5" id="L5" cla16ass="lin16" name="L28">  27#i16clud168lt;<        if (s?return=scode=" it="L2h_results">
  
" it="L2lt;<) {d/core/rtctimer.c#L5" id="L5" cla16>
  v2.61616.35  19
  
snd_d="L2_global_ yoult;<(s?return=scode=" it="L2h_results">
  
" it="L2lt;<);d/core/rtctimer.c#L22" id="L22" c17ass="lin17" name="L20">  20
  
" it="L2lt;< = s?return=scode=NULLh_results">
  
NULLlt;<;d/core/rtctimer.c#L22" id="L22" c17ass="lin17" name="L21">  21  22
<17 hre17"soun}d/core/rtctimer.c#L22" id="L22" c17ss="line17" name="L3">   3   4   5 *   GNU Generref="sound/core/rtctimer.c#L2" id="L2" cla17ss="line17" name="L6">   6 *
   7 *   You should ef="sound/core/rtctimer.c#L22" id="L22" c17ass="lin17" name="L28">  27#i17clud178lt;&a h_results">
  
t;
&a lt;<(s?return=scode=" id="L2_>&a h_results">
  
" id="L2_>&a lt;<)d/core/rtctimer.c#L8" id="L8" cla17>
  v2.61716.35  19
  
t;

  
" id="L2_exa lt;<)d/core/rtctimer.c#L8" id="L8" cla1sass="lin18" name="L20">  20  21
  
t;

  
" id="L2_r  22
<18 hre182s="co?return=scode=MODULE_PARM_DESCh_results">
  
MODULE_PARM_DESClt;<(s?return=scode=" id="L2_r
  
" id="L2_r *   he hng">"="L2"
   3   4
  
MODULE_LICENSElt;<(smment"> *   he hng">"GPL"f="soun);d/core/rtctimer.c#L22" id="L22" c18ss="line18" name="L5">   5   6
  
MODULE_ALIASlt;<(smment"> *   he hng">"snd-d="L2-"f="soun s?return=scode=__he hngifyh_results">
  
__he hngifylt;<(s?return=scode=SNDRV_TIMER_GLOBAL_RTCh_results">
  
SNDRV_TIMER_GLOBAL_RTClt;<));d/core/rtctimer.c#L22" id="L22" c18ss="line18" name="L7">   7   8/*

  v2.61816.35  19
   

d="content">
35
Tt woriginal LXR can rediliffarerceforge.net/projects/lx2h>LXR pan>u&a ylt;<, if noexperi>
&.no">lx2@l/a>&.nolt;<.
d="contnt">
35
lx2.l/a>&.no kindly hosta hreRedpill L/apro ASlt;<,tt, viof tof L/aux pan