hardware.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /* linux/include/asm-arm/arch-s3c2410/hardware.h
  2. *
  3. * Copyright (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. #ifndef __ASM_ARCH_HARDWARE_H
  13. #define __ASM_ARCH_HARDWARE_H
  14. #if defined (CONFIG_CPU_S3C6400) || defined (CONFIG_CPU_S3C6410)
  15. #ifndef __ASSEMBLY__
  16. /* external functions for GPIO support
  17. *
  18. * These allow various different clients to access the same GPIO
  19. * registers without conflicting. If your driver only owns the entire
  20. * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
  21. */
  22. /* s3c_gpio_cfgpin
  23. *
  24. * set the configuration of the given pin to the value passed.
  25. *
  26. * eg:
  27. * s3c_gpio_cfgpin(S3C2413_GPA0, S3C2413_GPA0_ADDR0);
  28. * s3c_gpio_cfgpin(S3C2413_GPE8, S3C2413_GPE8_SDDAT1);
  29. */
  30. extern void s3c_gpio_cfgpin(unsigned int pin, unsigned int function);
  31. extern unsigned int s3c_gpio_getcfg(unsigned int pin);
  32. /* s3c_gpio_getirq
  33. *
  34. * turn the given pin number into the corresponding IRQ number
  35. *
  36. * returns:
  37. * < 0 = no interrupt for this pin
  38. * >=0 = interrupt number for the pin
  39. */
  40. //extern int s3c_gpio_getirq(unsigned int pin);
  41. /* s3c_gpio_irqfilter
  42. *
  43. * set the irq filtering on the given pin
  44. *
  45. * on = 0 => disable filtering
  46. * 1 => enable filtering
  47. *
  48. * config = S3C2413_EINTFLT_PCLK or S3C2413_EINTFLT_EXTCLK orred with
  49. * width of filter (0 through 63)
  50. *
  51. *
  52. */
  53. //extern int s3c_gpio_irqfilter(unsigned int pin, unsigned int on,
  54. // unsigned int config);
  55. /* s3c_gpio_pullup
  56. *
  57. * configure the pull-up control on the given pin
  58. *
  59. * to = 1 => disable the pull-up
  60. * 0 => enable the pull-up
  61. *
  62. * eg;
  63. *
  64. * s3c_gpio_pullup(S3C_GPB0, 0);
  65. * s3c_gpio_pullup(S3C_GPE8, 0);
  66. */
  67. extern void s3c_gpio_pullup(unsigned int pin, unsigned int to);
  68. extern void s3c_gpio_setpin(unsigned int pin, unsigned int to);
  69. extern unsigned int s3c_gpio_getpin(unsigned int pin);
  70. //extern unsigned int s3c_modify_misccr(unsigned int clr, unsigned int chg);
  71. #endif /* __ASSEMBLY__ */
  72. #include <asm/sizes.h>
  73. #include <asm/arch/map.h>
  74. /* machine specific hardware definitions should go after this */
  75. /* currently here until moved into config (todo) */
  76. #define CONFIG_NO_MULTIWORD_IO
  77. #endif /*CPU_S3C6400*/
  78. #ifndef __ASM_HARDWARE_H
  79. #error "Do not include this directly, instead #include <asm/hardware.h>"
  80. #endif
  81. #ifndef __ASSEMBLY__
  82. /* external functions for GPIO support
  83. *
  84. * These allow various different clients to access the same GPIO
  85. * registers without conflicting. If your driver only owns the entire
  86. * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
  87. */
  88. /* s3c2410_gpio_cfgpin
  89. *
  90. * set the configuration of the given pin to the value passed.
  91. *
  92. * eg:
  93. * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
  94. * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
  95. */
  96. extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
  97. extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
  98. /* s3c2410_gpio_getirq
  99. *
  100. * turn the given pin number into the corresponding IRQ number
  101. *
  102. * returns:
  103. * < 0 = no interrupt for this pin
  104. * >=0 = interrupt number for the pin
  105. */
  106. extern int s3c2410_gpio_getirq(unsigned int pin);
  107. #ifdef CONFIG_CPU_S3C2400
  108. extern int s3c2400_gpio_getirq(unsigned int pin);
  109. #endif /* CONFIG_CPU_S3C2400 */
  110. /* s3c2410_gpio_irqfilter
  111. *
  112. * set the irq filtering on the given pin
  113. *
  114. * on = 0 => disable filtering
  115. * 1 => enable filtering
  116. *
  117. * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
  118. * width of filter (0 through 63)
  119. *
  120. *
  121. */
  122. extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
  123. unsigned int config);
  124. /* s3c2410_gpio_pullup
  125. *
  126. * configure the pull-up control on the given pin
  127. *
  128. * to = 1 => disable the pull-up
  129. * 0 => enable the pull-up
  130. *
  131. * eg;
  132. *
  133. * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
  134. * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
  135. */
  136. extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
  137. extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
  138. extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
  139. extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
  140. #ifdef CONFIG_CPU_S3C2440
  141. extern int s3c2440_set_dsc(unsigned int pin, unsigned int value);
  142. #endif /* CONFIG_CPU_S3C2440 */
  143. #endif /* __ASSEMBLY__ */
  144. #include <asm/sizes.h>
  145. #include <asm/arch/map.h>
  146. /* machine specific hardware definitions should go after this */
  147. /* currently here until moved into config (todo) */
  148. #define CONFIG_NO_MULTIWORD_IO
  149. #endif /* __ASM_ARCH_HARDWARE_H */