hardware.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* linux/include/asm-arm/arch-s3c2410/hardware.h
  2. *
  3. * (c) 2003 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * S3C2410 - hardware
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * Changelog:
  13. * 21-May-2003 BJD Created file
  14. * 06-Jun-2003 BJD Added CPU frequency settings
  15. * 03-Sep-2003 BJD Linux v2.6 support
  16. * 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars
  17. * 14-Sep-2004 BJD Added misccr and getpin to gpio
  18. * 01-Oct-2004 BJD Added the new gpio functions
  19. * 16-Oct-2004 BJD Removed the clock variables
  20. */
  21. #ifndef __ASM_ARCH_HARDWARE_H
  22. #define __ASM_ARCH_HARDWARE_H
  23. #ifndef __ASSEMBLY__
  24. /* external functions for GPIO support
  25. *
  26. * These allow various different clients to access the same GPIO
  27. * registers without conflicting. If your driver only owns the entire
  28. * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
  29. */
  30. /* s3c2410_gpio_cfgpin
  31. *
  32. * set the configuration of the given pin to the value passed.
  33. *
  34. * eg:
  35. * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
  36. * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
  37. */
  38. extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
  39. extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
  40. /* s3c2410_gpio_getirq
  41. *
  42. * turn the given pin number into the corresponding IRQ number
  43. *
  44. * returns:
  45. * < 0 = no interrupt for this pin
  46. * >=0 = interrupt number for the pin
  47. */
  48. extern int s3c2410_gpio_getirq(unsigned int pin);
  49. /* s3c2410_gpio_irqfilter
  50. *
  51. * set the irq filtering on the given pin
  52. *
  53. * on = 0 => disable filtering
  54. * 1 => enable filtering
  55. *
  56. * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
  57. * width of filter (0 through 63)
  58. *
  59. *
  60. */
  61. extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
  62. unsigned int config);
  63. /* s3c2410_gpio_pullup
  64. *
  65. * configure the pull-up control on the given pin
  66. *
  67. * to = 1 => disable the pull-up
  68. * 0 => enable the pull-up
  69. *
  70. * eg;
  71. *
  72. * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
  73. * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
  74. */
  75. extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
  76. extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
  77. extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
  78. extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
  79. #endif /* __ASSEMBLY__ */
  80. #include <asm/sizes.h>
  81. #include <asm/arch/map.h>
  82. /* machine specific hardware definitions should go after this */
  83. /* currently here until moved into config (todo) */
  84. #define CONFIG_NO_MULTIWORD_IO
  85. #endif /* __ASM_ARCH_HARDWARE_H */