hardware.h 2.6 KB

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