hardware.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. #ifndef __ASM_HARDWARE_H
  15. #error "Do not include this directly, instead #include <asm/hardware.h>"
  16. #endif
  17. #ifndef __ASSEMBLY__
  18. /* external functions for GPIO support
  19. *
  20. * These allow various different clients to access the same GPIO
  21. * registers without conflicting. If your driver only owns the entire
  22. * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
  23. */
  24. /* s3c2410_gpio_cfgpin
  25. *
  26. * set the configuration of the given pin to the value passed.
  27. *
  28. * eg:
  29. * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
  30. * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
  31. */
  32. extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
  33. extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
  34. /* s3c2410_gpio_getirq
  35. *
  36. * turn the given pin number into the corresponding IRQ number
  37. *
  38. * returns:
  39. * < 0 = no interrupt for this pin
  40. * >=0 = interrupt number for the pin
  41. */
  42. extern int s3c2410_gpio_getirq(unsigned int pin);
  43. /* s3c2410_gpio_irq2pin
  44. *
  45. * turn the given irq number into the corresponding GPIO number
  46. *
  47. * returns:
  48. * < 0 = no pin
  49. * >=0 = gpio pin number
  50. */
  51. extern int s3c2410_gpio_irq2pin(unsigned int irq);
  52. #ifdef CONFIG_CPU_S3C2400
  53. extern int s3c2400_gpio_getirq(unsigned int pin);
  54. #endif /* CONFIG_CPU_S3C2400 */
  55. /* s3c2410_gpio_irqfilter
  56. *
  57. * set the irq filtering on the given pin
  58. *
  59. * on = 0 => disable filtering
  60. * 1 => enable filtering
  61. *
  62. * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
  63. * width of filter (0 through 63)
  64. *
  65. *
  66. */
  67. extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
  68. unsigned int config);
  69. /* s3c2410_gpio_pullup
  70. *
  71. * configure the pull-up control on the given pin
  72. *
  73. * to = 1 => disable the pull-up
  74. * 0 => enable the pull-up
  75. *
  76. * eg;
  77. *
  78. * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
  79. * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
  80. */
  81. extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
  82. /* s3c2410_gpio_getpull
  83. *
  84. * Read the state of the pull-up on a given pin
  85. *
  86. * return:
  87. * < 0 => error code
  88. * 0 => enabled
  89. * 1 => disabled
  90. */
  91. extern int s3c2410_gpio_getpull(unsigned int pin);
  92. extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
  93. extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
  94. extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
  95. #ifdef CONFIG_CPU_S3C2440
  96. extern int s3c2440_set_dsc(unsigned int pin, unsigned int value);
  97. #endif /* CONFIG_CPU_S3C2440 */
  98. #ifdef CONFIG_CPU_S3C2412
  99. extern int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state);
  100. #endif /* CONFIG_CPU_S3C2412 */
  101. #endif /* __ASSEMBLY__ */
  102. #include <asm/sizes.h>
  103. #include <asm/arch/map.h>
  104. /* machine specific hardware definitions should go after this */
  105. /* currently here until moved into config (todo) */
  106. #define CONFIG_NO_MULTIWORD_IO
  107. #endif /* __ASM_ARCH_HARDWARE_H */