hardware.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. #ifdef CONFIG_CPU_S3C2400
  44. extern int s3c2400_gpio_getirq(unsigned int pin);
  45. #endif /* CONFIG_CPU_S3C2400 */
  46. /* s3c2410_gpio_irqfilter
  47. *
  48. * set the irq filtering on the given pin
  49. *
  50. * on = 0 => disable filtering
  51. * 1 => enable filtering
  52. *
  53. * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
  54. * width of filter (0 through 63)
  55. *
  56. *
  57. */
  58. extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
  59. unsigned int config);
  60. /* s3c2410_gpio_pullup
  61. *
  62. * configure the pull-up control on the given pin
  63. *
  64. * to = 1 => disable the pull-up
  65. * 0 => enable the pull-up
  66. *
  67. * eg;
  68. *
  69. * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
  70. * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
  71. */
  72. extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
  73. extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
  74. extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
  75. extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
  76. #ifdef CONFIG_CPU_S3C2440
  77. extern int s3c2440_set_dsc(unsigned int pin, unsigned int value);
  78. #endif /* CONFIG_CPU_S3C2440 */
  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 */