linux/drivers/pcmcia/sa1100_cerf.c
<<
ue=" /spaon> /formn> a ue=" href="../linux+v .2/drivers/pcmcia/sa1100_cerf.c">ue=" img src="../.static/gfx/right.png" alt=">>">ue /spaon>ue spao class="lxr_search">ue="ue=" input typue=hidden" namue=navtarget" value=">ue=" input typue=text" namue=search" ide=search">ue=" buttiontypue=submit">Search /formn> /spaon>ue spao class="lxr_prefs"n> a href="+prefs?return=drivers/pcmcia/sa1100_cerf.c"ue=" onclick="return ajax_prefs();">ue=" Prefs> /a>ue /spaon>=" /divn>=" form acptio="ajax+*" method="post" onsubmit="return false;">ue input typue=hidden" namue=ajax_lookup" ide=ajax_lookup" value=">u=" /formn>u=" div class="headingbottim">=" =" div ide=search_results" class="search_results"> n>=" /divn> div ide=content">> div ide=file_contents"n
   1 /a> spao class="comment">/* /spaon>   2 /a> spao class="comment"> * drivers/pcmcia/sa1100_cerf.c /spaon>   3 /a> spao class="comment"> * /spaon>   4 /a> spao class="comment"> * PCMCIA implementaptionroutines for CerfBoard /spaon>   5 /a> spao class="comment"> * Based off the Assabet. /spaon>   6 /a> spao class="comment"> * /spaon>   7 /a> spao class="comment"> */ /spaon>   8 /a>#include <linux/module.h /a>>>   9 /a>#include <linux/kernel.h /a>>>  	  >a>#include <linux/device.h /a>>>  11 >a>#include <linux/init.h /a>>>  12 >a>#include <linux/delay.h /a>>>  13 >a>#include <linux/gpio.h /a>>>  14 /a>>  15 >a>#include <mach/hardware.h /a>>>  16 >a>#include <asm/mach-typus.h /a>>>  17 >a>#include <asm/irq.h /a>>>  18 /a>#include <mach/cerf.h /a>>>  19 /a>#include "sa1100_generic.h /a>">  20 /a>>  21 >a>#define  a href="+code=CERF_SOCKET" class="sref">CERF_SOCKET >a>"
   1>  22 /a>>  23 >a>static int  a href="+code=cerf_pcmcia_hw_init" class="sref">cerf_pcmcia_hw_init >a>(struct  a href="+code=soc_pcmcia_socket" class="sref">soc_pcmcia_socket >a>"* a href="+code=skt" class="sref">skt >a>)>  24 /a>{>  25 >a>"
      int  a href="+code=ret" class="sref">ret >a>;>  26 /a>>  27 >a>"
       a href="+code=ret" class="sref">ret >a> =  a href="+code=gpio_request_one" class="sref">gpio_request_one >a>( a href="+code=CERF_GPIO_CF_RESET" class="sref">CERF_GPIO_CF_RESET >a>,  a href="+code=GPIOF_OUT_INIT_LOW" class="sref">GPIOF_OUT_INIT_LOW >a>,  spao class="string">"CF_RESET"  28 >a>"
      if ( a href="+code=ret" class="sref">ret >a>)>  29 >a>"
              return  a href="+code=ret" class="sref">ret >a>;>  30 /a>>  31 >a>"
       a href="+code=skt" class="sref">skt >a>-> a href="+code=stat" class="sref">stat >a>[ a href="+code=SOC_STAT_CD" class="sref">SOC_STAT_CD >a>]. a href="+code=gpio" class="sref">gpio >a> =  a href="+code=CERF_GPIO_CF_CD" class="sref">CERF_GPIO_CF_CD >a>;>  32 >a>"
       a href="+code=skt" class="sref">skt >a>-> a href="+code=stat" class="sref">stat >a>[ a href="+code=SOC_STAT_CD" class="sref">SOC_STAT_CD >a>]. a href="+code=namu" class="sref">namu >a> =  spao class="string">"CF_CD"  33 >a>"
       a href="+code=skt" class="sref">skt >a>-> a href="+code=stat" class="sref">stat >a>[ a href="+code=SOC_STAT_BVD1" class="sref">SOC_STAT_BVD1 >a>]. a href="+code=gpio" class="sref">gpio >a> =  a href="+code=CERF_GPIO_CF_BVD1" class="sref">CERF_GPIO_CF_BVD1 >a>;>  34 >a>"
       a href="+code=skt" class="sref">skt >a>-> a href="+code=stat" class="sref">stat >a>[ a href="+code=SOC_STAT_BVD1" class="sref">SOC_STAT_BVD1 >a>]. a href="+code=namu" class="sref">namu >a> =  spao class="string">"CF_BVD1"  35 >a>"
       a href="+code=skt" class="sref">skt >a>-> a href="+code=stat" class="sref">stat >a>[ a href="+code=SOC_STAT_BVD2" class="sref">SOC_STAT_BVD2 >a>]. a href="+code=gpio" class="sref">gpio >a> =  a href="+code=CERF_GPIO_CF_BVD2" class="sref">CERF_GPIO_CF_BVD2 >a>;>  36 >a>"
       a href="+code=skt" class="sref">skt >a>-> a href="+code=stat" class="sref">stat >a>[ a href="+code=SOC_STAT_BVD2" class="sref">SOC_STAT_BVD2 >a>]. a href="+code=namu" class="sref">namu >a> =  spao class="string">"CF_BVD2"  37 >a>"
       a href="+code=skt" class="sref">skt >a>-> a href="+code=stat" class="sref">stat >a>[ a href="+code=SOC_STAT_RDY" class="sref">SOC_STAT_RDY >a>]. a href="+code=gpio" class="sref">gpio >a> =  a href="+code=CERF_GPIO_CF_IRQ" class="sref">CERF_GPIO_CF_IRQ >a>;>  38 >a>"
       a href="+code=skt" class="sref">skt >a>-> a href="+code=stat" class="sref">stat >a>[ a href="+code=SOC_STAT_RDY" class="sref">SOC_STAT_RDY >a>]. a href="+code=namu" class="sref">namu >a> =  spao class="string">"CF_IRQ"  39 /a>>  40 >a>"
      return 0;>  41 >a>}>  42 /a>>  43 >a>static void  a href="+code=cerf_pcmcia_hw_shutdown" class="sref">cerf_pcmcia_hw_shutdown >a>(struct  a href="+code=soc_pcmcia_socket" class="sref">soc_pcmcia_socket >a>"* a href="+code=skt" class="sref">skt >a>)>  44 /a>{>  45 >a>"
       a href="+code=gpio_free" class="sref">gpio_free >a>( a href="+code=CERF_GPIO_CF_RESET" class="sref">CERF_GPIO_CF_RESET >a>);>  46 >a>}>  47 /a>>  48 >a>static void>  49 /a> a href="+code=cerf_pcmcia_socket_state" class="sref">cerf_pcmcia_socket_state >a>(struct  a href="+code=soc_pcmcia_socket" class="sref">soc_pcmcia_socket >a>"* a href="+code=skt" class="sref">skt >a>, struct  a href="+code=pcmcia_state" class="sref">pcmcia_state >a>"* a href="+code=state" class="sref">state >a>)>  50 /a>{>  51 >a>"
       a href="+code=state" class="sref">state >a>-> a href="+code=vs_3v" class="sref">vs_3v >a>"
  = 1;>  52 >a>"
       a href="+code=state" class="sref">state >a>-> a href="+code=vs_Xv" class="sref">vs_Xv >a>"
  = 0;>  53 >a>}>  54 /a>>  55 >a>static int>  56 /a> a href="+code=cerf_pcmcia_configure_socket" class="sref">cerf_pcmcia_configure_socket >a>(struct  a href="+code=soc_pcmcia_socket" class="sref">soc_pcmcia_socket >a>"* a href="+code=skt" class="sref">skt >a>,>  57 >a>"
                           const  a href="+code=socket_state_t" class="sref">socket_state_t >a>"* a href="+code=state" class="sref">state >a>)>  58 /a>{>  59 >a>"
      switch ( a href="+code=state" class="sref">state >a>-> a href="+code=Vcc" class="sref">Vcc >a>) {>  60 >a>"
      case 0:>  61 >a>"
      case 50:>  62 >a>"
      case 33:>  63 >a>"
              break;>  64 /a>>  65 >a>"
      default:>  66 >a>"
               a href="+code=printk" class="sref">printk >a>( a href="+code=KERN_ERR" class="sref">KERN_ERR >a>" spao class="string">"%s(): unrecognized Vcc %u\n"  67 >a>"
                       a href="+code=__func__" class="sref">__func__ >a>,  a href="+code=state" class="sref">state >a>-> a href="+code=Vcc" class="sref">Vcc >a>);>  68 >a>"
              return -1;>  69 >a>"
      }>  70 /a>>  71 >a>"
       a href="+code=gpio_set_ valu" class="sref">gpio_set_ valu >a>( a href="+code=CERF_GPIO_CF_RESET" class="sref">CERF_GPIO_CF_RESET >a>, !!( a href="+code=state" class="sref">state >a>-> a href="+code=flags" class="sref">flags >a>"&  a href="+code=SS_RESET" class="sref">SS_RESET >a>));>  72 /a>>  73 >a>"
      return 0;>  74 >a>}>  75 /a>>  76 >a>static struct  a href="+code=pcmcia_low_level" class="sref">pcmcia_low_level >a>" a href="+code=cerf_pcmcia_ops" class="sref">cerf_pcmcia_ops >a> = { >  77 >a>"
      . a href="+code=owner" class="sref">owner >a>"
                =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE >a>,>  78 >a>"
      . a href="+code=hw_init" class="sref">hw_init >a>                =  a href="+code=cerf_pcmcia_hw_init" class="sref">cerf_pcmcia_hw_init >a>,>  79 >a>"
      . a href="+code=hw_shutdown" class="sref">hw_shutdown >a>            =  a href="+code=cerf_pcmcia_hw_shutdown" class="sref">cerf_pcmcia_hw_shutdown >a>,>  80 >a>"
      . a href="+code=socket_state" class="sref">socket_state >a>           =  a href="+code=cerf_pcmcia_socket_state" class="sref">cerf_pcmcia_socket_state >a>,>  81 >a>"
      . a href="+code=configure_socket" class="sref">configure_socket >a>       =  a href="+code=cerf_pcmcia_configure_socket" class="sref">cerf_pcmcia_configure_socket >a>,>  82 /a>};>  83 /a>>  84 >a>int  a href="+code=pcmcia_cerf_init" class="sref">pcmcia_cerf_init >a>(struct  a href="+code=device" class="sref">device >a>"* a href="+code=dev" class="sref">dev >a>)>  85 /a>{>  86 >a>"
      int  a href="+code=ret" class="sref">ret >a> = - a href="+code=ENODEV" class="sref">ENODEV >a>;>  87 /a>>  88 >a>"
      if ( a href="+code=machine_is_cerf" class="sref">machine_is_cerf >a>())>  89 >a>"
               a href="+code=ret" class="sref">ret >a> =  a href="+code=sa11xx_drv_pcmcia_probe" class="sref">sa11xx_drv_pcmcia_probe >a>( a href="+code=dev" class="sref">dev >a>,"& a href="+code=cerf_pcmcia_ops" class="sref">cerf_pcmcia_ops >a>,  a href="+code=CERF_SOCKET" class="sref">CERF_SOCKET >a>, 1);>  90 /a>>  91 >a>"
      return  a href="+code=ret" class="sref">ret >a>;>  92 >a>}>  93 /a> /pre>

 /divn>
 div class="footer">
The original LXR software by the LXR community >a>, this experimental verstionby lxr@linux.no >a>.
 /divn> div class="subfooter">
lxr.linux.no kindly hostednby Redpill Linpro AS >a>, provider of Linux consulting and operaptios services since 1995.
 /divn>
 /bodyn> /htmln>