pinctrl-exynos.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Exynos specific definitions for Samsung pinctrl and gpiolib driver.
  3. *
  4. * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  5. * http://www.samsung.com
  6. * Copyright (c) 2012 Linaro Ltd
  7. * http://www.linaro.org
  8. *
  9. * This file contains the Exynos specific definitions for the Samsung
  10. * pinctrl/gpiolib interface drivers.
  11. *
  12. * Author: Thomas Abraham <[email protected]>
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. */
  19. /* External GPIO and wakeup interrupt related definitions */
  20. #define EXYNOS_GPIO_ECON_OFFSET 0x700
  21. #define EXYNOS_GPIO_EFLTCON_OFFSET 0x800
  22. #define EXYNOS_GPIO_EMASK_OFFSET 0x900
  23. #define EXYNOS_GPIO_EPEND_OFFSET 0xA00
  24. #define EXYNOS_WKUP_ECON_OFFSET 0xE00
  25. #define EXYNOS_WKUP_EMASK_OFFSET 0xF00
  26. #define EXYNOS_WKUP_EPEND_OFFSET 0xF40
  27. #define EXYNOS7_WKUP_ECON_OFFSET 0x700
  28. #define EXYNOS7_WKUP_EMASK_OFFSET 0x900
  29. #define EXYNOS7_WKUP_EPEND_OFFSET 0xA00
  30. #define EXYNOS_SVC_OFFSET 0xB08
  31. #define EXYNOS_EINT_FUNC 0xF
  32. /* helpers to access interrupt service register */
  33. #define EXYNOS_SVC_GROUP_SHIFT 3
  34. #define EXYNOS_SVC_GROUP_MASK 0x1f
  35. #define EXYNOS_SVC_NUM_MASK 7
  36. #define EXYNOS_SVC_GROUP(x) ((x >> EXYNOS_SVC_GROUP_SHIFT) & \
  37. EXYNOS_SVC_GROUP_MASK)
  38. /* Exynos specific external interrupt trigger types */
  39. #define EXYNOS_EINT_LEVEL_LOW 0
  40. #define EXYNOS_EINT_LEVEL_HIGH 1
  41. #define EXYNOS_EINT_EDGE_FALLING 2
  42. #define EXYNOS_EINT_EDGE_RISING 3
  43. #define EXYNOS_EINT_EDGE_BOTH 4
  44. #define EXYNOS_EINT_CON_MASK 0xF
  45. #define EXYNOS_EINT_CON_LEN 4
  46. #define EXYNOS_EINT_MAX_PER_BANK 8
  47. #define EXYNOS_EINT_NR_WKUP_EINT
  48. #define EXYNOS_PIN_BANK_EINTN(pins, reg, id) \
  49. { \
  50. .type = &bank_type_off, \
  51. .pctl_offset = reg, \
  52. .nr_pins = pins, \
  53. .eint_type = EINT_TYPE_NONE, \
  54. .name = id \
  55. }
  56. #define EXYNOS_PIN_BANK_EINTG(pins, reg, id, offs) \
  57. { \
  58. .type = &bank_type_off, \
  59. .pctl_offset = reg, \
  60. .nr_pins = pins, \
  61. .eint_type = EINT_TYPE_GPIO, \
  62. .eint_offset = offs, \
  63. .name = id \
  64. }
  65. #define EXYNOS_PIN_BANK_EINTW(pins, reg, id, offs) \
  66. { \
  67. .type = &bank_type_alive, \
  68. .pctl_offset = reg, \
  69. .nr_pins = pins, \
  70. .eint_type = EINT_TYPE_WKUP, \
  71. .eint_offset = offs, \
  72. .name = id \
  73. }
  74. /**
  75. * struct exynos_weint_data: irq specific data for all the wakeup interrupts
  76. * generated by the external wakeup interrupt controller.
  77. * @irq: interrupt number within the domain.
  78. * @bank: bank responsible for this interrupt
  79. */
  80. struct exynos_weint_data {
  81. unsigned int irq;
  82. struct samsung_pin_bank *bank;
  83. };
  84. /**
  85. * struct exynos_muxed_weint_data: irq specific data for muxed wakeup interrupts
  86. * generated by the external wakeup interrupt controller.
  87. * @nr_banks: count of banks being part of the mux
  88. * @banks: array of banks being part of the mux
  89. */
  90. struct exynos_muxed_weint_data {
  91. unsigned int nr_banks;
  92. struct samsung_pin_bank *banks[];
  93. };