pc2.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /***************************************************************************
  2. nec7210/pc2.h
  3. -------------------
  4. begin : Jan 2002
  5. copyright : (C) 2002 by Frank Mori Hess
  6. email : fmhess@users.sourceforge.net
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. #ifndef _PC2_H
  17. #define _PC2_H
  18. #include "nec7210.h"
  19. #include "gpibP.h"
  20. // struct which defines private_data for pc2 driver
  21. typedef struct
  22. {
  23. nec7210_private_t nec7210_priv;
  24. unsigned int irq;
  25. // io address that clears interrupt for pc2a (0x2f0 + irq)
  26. unsigned int clear_intr_addr;
  27. } pc2_private_t;
  28. // interfaces
  29. extern gpib_interface_t pc2_interface;
  30. extern gpib_interface_t pc2a_interface;
  31. // pc2 uses 8 consecutive io addresses
  32. static const int pc2_iosize = 8;
  33. static const int pc2a_iosize = 8;
  34. static const int pc2_2a_iosize = 16;
  35. // offset between io addresses of successive nec7210 registers
  36. static const int pc2a_reg_offset = 0x400;
  37. static const int pc2_reg_offset = 1;
  38. //interrupt service routine
  39. irqreturn_t pc2_interrupt(int irq, void *arg PT_REGS_ARG);
  40. irqreturn_t pc2a_interrupt(int irq, void *arg PT_REGS_ARG);
  41. // pc2 specific registers and bits
  42. // interrupt clear register address
  43. static const int pc2a_clear_intr_iobase = 0x2f0;
  44. inline static unsigned int CLEAR_INTR_REG( unsigned int irq )
  45. {
  46. return pc2a_clear_intr_iobase + irq;
  47. }
  48. #endif // _PC2_H