linux/lib/stmp_device.c
<<
4.1/spa v 4.1/form v 4.1a 4. href="../linux+v3.8.1/lib/stmp_device.c"> 4.1img src="../.static/gfx/right.png" alt=">>"> 1/spa v 1spa class="lxr_search"> ="+search" method="post" onsubmit="return do_search(this);"> 4.1input typ hidden" nam navtarget" on> "> 4.1input typ text" nam search" id search"> 4.1buttptityp submit">Search 4.Prefsv 4.1/a> 1/spa v 4. .1/div v 4. .1form ac > ="ajax+*" method="post" onsubmit="return false;"> 1input typ hidden" nam ajax_lookup" id ajax_lookup" on> "> 4. .1/form v 4. .1div class="headingbottpm">
v 1div id file_contents"
. .11/a>1spa  class="comment">/*1/spa  v. .21/a>1spa  class="comment"> * Copyright (C) 1999 ARM Limited1/spa  v. .31/a>1spa  class="comment"> * Copyright (C) 2000 Deep B>
  Solu >
 s Ltd1/spa  v. .41/a>1spa  class="comment"> * Copyright 2006-2007,2010 Freescal  Semiconductor, Inc. All Rights Reserved.1/spa  v. .51/a>1spa  class="comment"> * Copyright 2008 Juergen Beisert, kernel@pengutronix.de1/spa  v. .61/a>1spa  class="comment"> * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, yanok@emcraft.com1/spa  v. .71/a>1spa  class="comment"> * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.1/spa  v. .81/a>1spa  class="comment"> *1/spa  v. .91/a>1spa  class="comment"> * This program is free software; you ca  redistribute it and/or modify1/spa  v. v3.1a>1spa  class="comment"> * it under the terms of the GNU General Public License as published by1/spa  v. 111/a>1spa  class="comment"> * the Free Software Founda >
 ; either versopti2 of the License, or1/spa  v. 121/a>1spa  class="comment"> * (at your 	  >
 ) any later versopt.1/spa  v. 131/a>1spa  class="comment"> */1/spa  v. 141/a>v. 151/a>#include <linux/io.h1/a>>v. 161/a>#include <linux/errno.h1/a>>v. 171/a>#include <linux/delay.h1/a>>v. 181/a>#include <linux/module.h1/a>>v. 191/a>#include <linux/stmp_device.h1/a>>v. 201/a>v. 211/a>#define.1a href="+code=STMP_MODULE_CLKGATE" class="sref">STMP_MODULE_CLKGATE1/a>
4. .(1 << 30)v. 221/a>#define.1a href="+code=STMP_MODULE_SFTRST" class="sref">STMP_MODULE_SFTRST1/a>
4. ..(1 << 31)v. 231/a>v. 241/a>1spa  class="comment">/*1/spa  v. 251/a>1spa  class="comment"> * Clear the bit and poll it cleared.  This is usually called with1/spa  v. 261/a>1spa  class="comment"> * a reset address and mask being either SFTRST(bit 31) or CLKGATE1/spa  v. 271/a>1spa  class="comment"> * (bit 30).1/spa  v. 281/a>1spa  class="comment"> */1/spa  v. 291/a>static int.1a href="+code=stmp_clear_poll_bit" class="sref">stmp_clear_poll_bit1/a>(void.1a href="+code=__iomem" class="sref">__iomem1/a>
*1a href="+code=addr" class="sref">addr1/a>,.1a href="+code=u32" class="sref">u321/a>.1a href="+code=mask" class="sref">mask1/a>)v. 301/a>{v. 311/a>
4. ..  int.1a href="+code=timeout" class="sref">timeout1/a>
= 0x400;v. 321/a>v. 331/a>
4. ..  1a href="+code=writel" class="sref">writel1/a>(1a href="+code=mask" class="sref">mask1/a>,.1a href="+code=addr" class="sref">addr1/a> +.1a href="+code=STMP_OFFSET_REG_CLR" class="sref">STMP_OFFSET_REG_CLR1/a>);v. 341/a>
4. ..  1a href="+code=udelay" class="sref">udelay1/a>(1);v. 351/a>
4. ..  while ((1a href="+code=readl" class="sref">readl1/a>(1a href="+code=addr" class="sref">addr1/a>) &.1a href="+code=mask" class="sref">mask1/a>) &&.--1a href="+code=timeout" class="sref">timeout1/a>)v
4. ..  o1m/2i noth res/a>1spa  class="sref">udelay1/a>(1);v. 321/a>vmask1/a>) &&.--1a href="+code=timeoutclass="sref">udelay1/a>(1);v
  Solu >
 s Ltd1/spa  v. 201/a>v. 291/a>statispa  _bloc) &.1a href=statispa  _bloc)"sref">stmp_clear_poll_bit1/a>(void.1a href="+code=__iomem" class="sref">__spa  _>readl1/a>(1a href=spa  _>reaeout" class="sref">timeout1/a>)v. 301/a>{v. 311/a>
rep;.--1a href="+crepeoutclass="sref">udelay1/a>(1);v. 311/a>
4. ..  int.1a href="+code=timeout" class="sref">timeout1/a>
= 0x400;v. 201/a>v
4. ..  o1m/2i ll_bi"comment">ess an1/a>1spa  class="comment"> */1/spa  v. 341rep;.--1a href="+crepeout" c 
L29">. 291/a>static int.1a href="+code=stmp_clear_poll_bit" class="srefclass="sref">__spa  _>readl1/a>(1a href=spa  _>reaeoutask" class="sref"/a>#define.1a href="+code=STMP_MODULE_SFTRST" class="sr class="sref">udelay1/a>(1);v__unlikel. ..  1a href="+cnlikel."srefclass="sref">__spp;.--1a href="+crepeout)" class="sref">timeout1/a>)v(1a href=erroaeoutclass="sref">udelay1/a>(1);v. 201/a>v
4. ..  o1m/2i ll_bi" either1/a>1spa  class="comment"> */1/spa  v. 331/a>
4. ..  1a href="+code=writel" class="sref">/a>#define.1a href="+code=STMP_MODULE_CLKGATE" class="sreask" class="sref"spa  _>readl1/a>(1a href=spa  _>reaeoutddr" class="sref">addr1/a> +.1a href="+code=STMP_OFFSET_REG_CLR" class="sref">STMP_OFFSET_REG_CLR1/a>);v. 231/a>v
4. ..  o1m/2i a  cess an1tosspa  c clasloc)1/a>1spa  class="comment"> */1/spa  v. 331/a>
4. ..  1a href="+code=writel" class="sref">/a>#define.1a href="+code=STMP_MODULE_SFTRST" class="srask" class="sref"spa  _>readl1/a>(1a href=spa  _>reaeoutddr" class="sref">addr1/a> +.1a hr +."+code=STMP_OFFSET_REG_CLR" claCLR"sref">STMP_OFFSET_REG_CLR1/a>);v. 331/a>
4. ..  1a href="+code=udelay" class="sref">udelay1/a>(1);v. 321/a>v
4. ..  o1m/2i ent"> either1be .. resa  c/a>1spa  class="comment"> */1/spa  v. 351/a>
4. ..  while ((1a href="+code=readl" class="sref"spa  _>readl1/a>(1a href=spa  _>reaeout"dr" class="sref">addr1/a>#define.1a href="+code=STMP_MODULE_CLKGATE" class="sre)ask" class="sref">mask1/a>) &&.--1a href="+code=timeout" class="sref">timeout1/a>)v
4. ..  o1m/2i noth res/a>1spa  class="sref">udelay1/a>(1);v__unlikel. ..  1a href="+cnlikel."sref!f">mask1/a>) &&.--1a href="+code=timeout)" class="sref">timeout1/a>)v(1a href=erroaeoutclass="sref">udelay1/a>(1);v. 231/a>v
4. ..  o1m/2i ll_bi"comment">ess an1/a>1spa  class="comment"> */1/spa  v. 331rep;.--1a href="+crepeout" c 
L29">. 291/a>static int.1a href="+code=stmp_clear_poll_bit" class="srefclass="sref">__spa  _>readl1/a>(1a href=spa  _>reaeoutask" class="sref"/a>#define.1a href="+code=STMP_MODULE_SFTRST" class="sr class="sref">udelay1/a>(1);v__unlikel. ..  1a href="+cnlikel."srefclass="sref">__spp;.--1a href="+crepeout)" class="sref">timeout1/a>)v(1a href=erroaeoutclass="sref">udelay1/a>(1);v. 231/a>v
4. ..  o1m/2i ll_bi"comment"> either1/a>1spa  class="comment"> */1/spa  v. 331rep;.--1a href="+crepeout" c 
L29">. 291/a>static int.1a href="+code=stmp_clear_poll_bit" class="srefclass="sref">__spa  _>readl1/a>(1a href=spa  _>reaeoutask" class="sref"/a>#define.1a href="+code=STMP_MODULE_CLKGATE" class="sre)class="sref">udelay1/a>(1);v__unlikel. ..  1a href="+cnlikel."srefclass="sref">__spp;.--1a href="+crepeout)" class="sref">timeout1/a>)v(1a href=erroaeoutclass="sref">udelay1/a>(1);v. 231/a>vtimeout1/a>
= 0x400;v. 201/a>v(1a href=erroaeout:"line" nam  
L20">. 201/a>v. 341pr_errdl1/a>(1a href=pr_err"srefc ei361/a>
4.ree ng">"%s(%p): ule.h"sspa  c de=tim\n">1spa  ask" class="sref"__func__oid.1a href="+codfunc__="srask" class="sref"spa  _>readl1/a>(1a href=spa  _>reaeout)class="sref">udelay1/a>(1);vmask1/a>) &aETIMEDOUf="+code=STMP_MOETIMEDOUfeoutclass="sref">udelay1/a>(1);v
  Solu >
 s Ltd1/spa  v__statispa  _bloc) &.1a href=statispa  _bloc)"sre)class="sref">udelay1/a>(1);v
The original LXRt"> * Thi byc claass="srefhttp://sourceforge.net/projects/lxr">LXRt .. unity="srasnsub experi  o1al ftware Fbycass="srefmailto:lxr@mp_de.no">lxr@mp_de.no="sr.
search_esultmp_devisubfooter">
lxr.mp_de.no kindly host Publaass="srefhttp://www.redpill-mp_pro.no">Redpill Lp_pro AS="srasprovi  clof Lp_uxt .n_res rescommoperaht (C)duct(1)C)dince"com5.
search_re/bodyh_e/htmlla