scoop.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Definitions for the SCOOP interface found on various Sharp PDAs
  3. *
  4. * Copyright (c) 2004 Richard Purdie
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. */
  11. #define SCOOP_MCR 0x00
  12. #define SCOOP_CDR 0x04
  13. #define SCOOP_CSR 0x08
  14. #define SCOOP_CPR 0x0C
  15. #define SCOOP_CCR 0x10
  16. #define SCOOP_IRR 0x14
  17. #define SCOOP_IRM 0x14
  18. #define SCOOP_IMR 0x18
  19. #define SCOOP_ISR 0x1C
  20. #define SCOOP_GPCR 0x20
  21. #define SCOOP_GPWR 0x24
  22. #define SCOOP_GPRR 0x28
  23. #define SCOOP_GPCR_PA22 ( 1 << 12 )
  24. #define SCOOP_GPCR_PA21 ( 1 << 11 )
  25. #define SCOOP_GPCR_PA20 ( 1 << 10 )
  26. #define SCOOP_GPCR_PA19 ( 1 << 9 )
  27. #define SCOOP_GPCR_PA18 ( 1 << 8 )
  28. #define SCOOP_GPCR_PA17 ( 1 << 7 )
  29. #define SCOOP_GPCR_PA16 ( 1 << 6 )
  30. #define SCOOP_GPCR_PA15 ( 1 << 5 )
  31. #define SCOOP_GPCR_PA14 ( 1 << 4 )
  32. #define SCOOP_GPCR_PA13 ( 1 << 3 )
  33. #define SCOOP_GPCR_PA12 ( 1 << 2 )
  34. #define SCOOP_GPCR_PA11 ( 1 << 1 )
  35. struct scoop_config {
  36. unsigned short io_out;
  37. unsigned short io_dir;
  38. unsigned short suspend_clr;
  39. unsigned short suspend_set;
  40. int gpio_base;
  41. };
  42. /* Structure for linking scoop devices to PCMCIA sockets */
  43. struct scoop_pcmcia_dev {
  44. struct device *dev; /* Pointer to this socket's scoop device */
  45. int irq; /* irq for socket */
  46. int cd_irq;
  47. const char *cd_irq_str;
  48. unsigned char keep_vs;
  49. unsigned char keep_rd;
  50. };
  51. struct scoop_pcmcia_config {
  52. struct scoop_pcmcia_dev *devs;
  53. int num_devs;
  54. void (*pcmcia_init)(void);
  55. void (*power_ctrl)(struct device *scoop, unsigned short cpr, int nr);
  56. };
  57. extern struct scoop_pcmcia_config *platform_scoop_config;
  58. void reset_scoop(struct device *dev);
  59. unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
  60. void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);