hardware.h 3.0 KB

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