au1000_pcmcia.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *
  3.  * Alchemy Semi Au1000 pcmcia driver include file
  4.  *
  5.  * Copyright 2001 MontaVista Software Inc.
  6.  * Author: MontaVista Software, Inc.
  7.  *          ppopov@mvista.com or source@mvista.com
  8.  *
  9.  * ########################################################################
  10.  *
  11.  *  This program is free software; you can distribute it and/or modify it
  12.  *  under the terms of the GNU General Public License (Version 2) as
  13.  *  published by the Free Software Foundation.
  14.  *
  15.  *  This program is distributed in the hope it will be useful, but WITHOUT
  16.  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  17.  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  18.  *  for more details.
  19.  *
  20.  *  You should have received a copy of the GNU General Public License along
  21.  *  with this program; if not, write to the Free Software Foundation, Inc.,
  22.  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  23.  *
  24.  * ########################################################################
  25.  *
  26.  *
  27.  */
  28. #ifndef __ASM_AU1000_PCMCIA_H
  29. #define __ASM_AU1000_PCMCIA_H
  30. #define AU1000_PCMCIA_POLL_PERIOD    (2*HZ)
  31. #define AU1000_PCMCIA_IO_SPEED       (255)
  32. #define AU1000_PCMCIA_MEM_SPEED      (300)
  33. struct pcmcia_state {
  34.   unsigned detect: 1,
  35.             ready: 1,
  36.            wrprot: 1,
  37.      bvd1: 1,
  38.      bvd2: 1,
  39.             vs_3v: 1,
  40.             vs_Xv: 1;
  41. };
  42. struct pcmcia_configure {
  43.   unsigned sock: 8,
  44.             vcc: 8,
  45.             vpp: 8,
  46.          output: 1,
  47.         speaker: 1,
  48.           reset: 1;
  49. };
  50. struct pcmcia_irq_info {
  51. unsigned int sock;
  52. unsigned int irq;
  53. };
  54. typedef u_int memaddr_t; /* fix me */
  55. struct au1000_pcmcia_socket {
  56. socket_state_t        cs_state;
  57. struct pcmcia_state   k_state;
  58. unsigned int          irq;
  59. void                  (*handler)(void *, unsigned int);
  60. void                  *handler_info;
  61. pccard_io_map         io_map[MAX_IO_WIN];
  62. pccard_mem_map        mem_map[MAX_WIN];
  63. u32                   virt_io;
  64. memaddr_t             phys_attr, phys_mem; /*FIX ME*/
  65. unsigned short        speed_io, speed_attr, speed_mem;
  66. };
  67. struct pcmcia_init {
  68. void (*handler)(int irq, void *dev, struct pt_regs *regs);
  69. };
  70. struct pcmcia_low_level {
  71. int (*init)(struct pcmcia_init *);
  72. int (*shutdown)(void);
  73. int (*socket_state)(unsigned sock, struct pcmcia_state *);
  74. int (*get_irq_info)(struct pcmcia_irq_info *);
  75. int (*configure_socket)(const struct pcmcia_configure *);
  76. };
  77. #if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500)
  78. extern struct pcmcia_low_level pb1x00_pcmcia_ops;
  79. #else
  80. error unknown Au1000 board
  81. #endif
  82. #endif /* __ASM_AU1000_PCMCIA_H */