linux/drivers/pcmcia/pxa2xx_hx4700.c
<<
>>
Prefs
   1/*
   2 *  Copyright (C) 2012 Paul Parsons <lost.distance@yahoo.com>
   3 *
   4 *  This program is free software; you can redistribute it and/or modify
   5 *  it under the terms of the GNU General Public License version 2 as
   6 *  published by the Free Software Foundation.
   7 */
   8
   9#include <linux/module.h>
  10#include <linux/platform_device.h>
  11#include <linux/err.h>
  12#include <linux/gpio.h>
  13#include <linux/irq.h>
  14
  15#include <asm/mach-types.h>
  16#include <mach/hx4700.h>
  17
  18#include "soc_common.h"
  19
  20static struct gpio gpios[] = {
  21        { GPIO114_HX4700_CF_RESET,    GPIOF_OUT_INIT_LOW,   "CF reset"        },
  22        { EGPIO4_CF_3V3_ON,           GPIOF_OUT_INIT_LOW,   "CF 3.3V enable"  },
  23};
  24
  25static int hx4700_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
  26{
  27        int ret;
  28
  29        ret = gpio_request_array(gpios, ARRAY_SIZE(gpios));
  30        if (ret)
  31                goto out;
  32
  33        /*
  34         * IRQ type must be set before soc_pcmcia_hw_init() calls request_irq().
  35         * The asic3 default IRQ type is level trigger low level detect, exactly
  36         * the the signal present on GPIOD4_CF_nCD5when 2the the signal present on GPIOD4_CF_W,   "26.8t;26.8t;26.8t;26.8t;26.8
" name="L36"not changed,6"> 6" cla 2errupt handlpanwilln cop * The asic3 default IRQ type is level trigger low 29 3 36gpio_request_3rray<39href="drivers/pcmcia/pxa2xx.c#L35" ihx4700.c#L9" id="L9" class="line" name="L9"> 9( 30 i_to ARRAY_SIZE( 30 v>
4pcmcia/p4a2xx_hx4700.c#L32" id="432" c41/span> /42>(
4L34" id=4L34" class="line" name=4L34">43>( 23}; 4nd/or moddify 60t;CF reset&qNBpxa2xx_hx4700.c#L2360t;CF reset&qNBode=00.c#L33" id="L33" class="line" name="L33">4 level d4tect, exactly ( 23}; 4he the s4gnal present on GPIOD4_4F_W ( 4rray" cl4ss="sref">gpio_request_4rray<49href}erms of the GNU General Public License versa2xx_hx4500.c#L31" id="L31" clas5="lin50/span> soc_pcmcia_socket *skt 26{ 5 /52class="sref">ret; 53>(ARRAY_SIZE(os" class="sref">gpios)); 30 if (ret) soc_pcmcia_socket e="L26_ket"apxa2xx_hx4700.cia_socket e="L26_ket"a 26{ ef="drivers/pcmcia/pxane" nameet"apxa2xx_hx4700.cne" nameet"a"> 26{ 700.c#L27" id="L27" class="line" name="L27"5 29 5 ret; gpio_request_5rray<5a>( -n> ret) -n> ret) 6 /6 63_socket" class="sref">soc_pcmcia_socket configure.c#L26" id="L26" classia_socket configure.c#L26" 26{ ( 26{ 700.c#L27" id="L27" class="line" name="L27"6sion 2 a6s ret; ewitch31 det"apxa2xx_hx4700.ceet"a"> -n> 74700_CF_RESET" class="sref">GPIO114_HX4700_C6a2xx_hx4600.c#L28" id="L28" clas6="lin6" name="L28">case 0:n> (( 30 T_LOW, "CF 3.3V enabl0ss="sref">ret) gpio_request_6rray<69>(ret) case 33:n> ( 30 T_LOW, "CF 3.3V enabl1ss="sref">ret) /72>(ret) 73>( 30 KERN_ERRpxa2xx_hx4700.cKERN_ERRame="L name="L23"> 23}; -n> 7s="sref">ret) 30 TINVALan class="stringINVALhx4700.c#L29" id="L29" class="line" name="L29">7f="drive7rs/pcmcia/pxa2xx_hx47007F_W}erms of the GNU General Public License ver78" class=="line" name="L8"> 8soc_common.h<7 29 7 (( 30 OUT_INIT_LOW, "CF reset" det"apxa2xx_hx4700.ceet"a"> -n> 74!=l0ss="sref">ret) gpio_request_7rray<7o" class="sref">gpio bottom"0s="sref">ret) 8 /8 83_socket" clef="drivers/pcmcia/pxane" namlow_> 36pxa2xx_hx4700.cne" namlow_> 36ame="Lsref">soc_pcmcia_socket opf (GPIO114_HX4700_C8nd/or mo8dify ) skt) 8<8="lin87ss="line" na._hx4700.c#L21" *skt e="L26_ket"agpio_request_8rray<89ss="line" na._hx4700.c#L21" configure.c#L26" id="L26" classconfigure.c#L26" configure.c#L26"9pcmcia/p9a2xx_hx4700.c#L32" id="932" c91/span> /92_socket" clef="drivers/pcmcia/pxan 26{ "incluhx4700.c#L29" id="L29" class="line" name="L29">9L34" id=9L34" class="line" name=9L34">93/span> soc_pcmc_a href="+code=skt" c_/a>) { ska>) ret; ef="drivers/pcmcia/pxan 26{ 98" class9="line" name="L8"> 8<9="lin9pcmcia/soc_common.h" class="fref">soc_common.h<9a>#inclu9de <{ ( 30 TNODEVan class="stringNODEVhx4700.c#L29" id="L29" class="line" name="L29">10rm_device..h> { 30 NULLan class="strinNULLs/pcmci name="L23"> 23}; (soc_pcmcia_socket opf ( 30 ia_socket opf (ret) 30 IS_ERRpxa2xx_hx4700.cIS_ERR="L30"> 30 p"inpxa2xx_hx4700.cn"inhx47)700.c#L27" id="L27" class="line" name="L27"10 15#i0nclude < 30 p"inpxa2xx_hx4700.cn"inhx47)s="sref">ret) { "incluhx47eef="+code=ARRAY_Sn"inpxa2xx_hx4700.cn"inhx4700.c#L29" id="L29" class="line" name="L29">10 18#i0nclude "soc_common.h" 0ret) > soc_pcmc__exref="+code=skt" c_/exre{ exreret; ( 30 ia_socket "inclupxa2xx_hx4700.cia_socket "incluhx47)s="sref">ret) { 30 ia_socket href="+code=skt" class="sref">ska>) ret) 30 ia_socket exref="+code=skt" cia_socket exreret) ret = 30 MODULi_AUTHORpxa2xx_hx4700.cMODULi_AUTHOR="L30" name="L23"> 23}; 3 * ret) gpios[] = { 30 MODULi_DESCRIPTIspan class="strinMODULi_DESCRIPTIsp="L30" name="L23"> 23}; )pcmcia/pxa2xx)s="sref">ret) , 30 MODULi_LICENSid="L30" class="MODULi_LICENSi="L30" name="L23"> 23}; ret) rehttp://sourcme="ge.net/projects/lxrp>LXRecia/u>) yame=, n ty experi/pxa26.> * pubspa"sref">remailto:lxr@lcmci.no">lxr@lcmci.noame=. href="riverrs/pcmcsubfooterp> lxr.lcmci.no kindlynhlasa>rehttp://www.redpill-lcmpro.no">Redpill Lcmpro ASame=, provis="lof Lcmux+consult3 operspan>s sernclus simen 1995. href="dr/body="r/htmlnt