msm-spmi.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. * SPMI
  2. The SPMI Device Tree support interprets up to three levels of Device Tree
  3. topology. The first level is required and specifies only a slave address.
  4. The second level is optional and allows for the specification of different
  5. device nodes within the same 16-bit address space underneath a particular
  6. SPMI slave ID. Within the second level, any number of address ranges can be
  7. associated with a particular device within that 16-bit range. An additional
  8. flag allows for the possiblity to specify that all device nodes should
  9. have their resources dedicated to only one spmi_device. This flag can
  10. be specified at the second level, or an optional third level. By default
  11. without this flag, one spmi_device is created for each device_node.
  12. [Root Node]
  13. Recommended properties :
  14. - interrupt-controller : Used to specify the root node as the
  15. interrupt controller for SPMI devices.
  16. - #interrupt-cells : The number of cells used to express one interrupt.
  17. Notes :
  18. - It is considered an error to include either spmi-container-dev or
  19. spmi-slave-dev in the Root Node.
  20. [First Level Nodes]
  21. Required properites :
  22. - reg: SPMI Slave ID (0-15) with no size cell.
  23. - compatible : "qcom," prefixed string to match against the driver.
  24. Recommended properties :
  25. - interrupts : <a b c> where a is the slave ID, b is the peripheral ID,
  26. c is the device interrupt number (0-7). Each device supports any arbitrary
  27. number of interrupts.
  28. - interrupt-parent : the phandle for the interrupt controller that
  29. services interrupts for this device.
  30. - reg-names : a list of strings that map in order to the list of addresses
  31. specified above in the 'reg' property.
  32. - interrupt-names : a list of strings that map in order to the list of
  33. interrupts specified in the 'interrupts' property.
  34. [Second Level Nodes]
  35. Required properties :
  36. - spmi-slave-container: Used by the parser to understand that this is the
  37. second level of the tree that includes device nodes associated with the
  38. same slave_id.
  39. - reg: <a b> where a is < 65536 and b is a size. Each device supports an
  40. arbitrary number of address ranges.
  41. - compatible : "qcom," prefixed string to match against the driver.
  42. Recommended properties :
  43. - interrupts : <a b c> where a is the slave ID, b is the peripheral ID,
  44. c is the device interrupt number (0-7). Each device supports any arbitrary
  45. number of interrupts.
  46. - interrupt-parent : the phandle for the interrupt controller that
  47. services interrupts for this device.
  48. Optional properties :
  49. - spmi-dev-container: This specifies that all the device nodes specified for
  50. this slave_id should have their resources coalesced into only one
  51. spmi_device.
  52. - reg-names : a list of strings that map in order to the list of addresses
  53. specified above in the 'reg' property.
  54. - interrupt-names : a list of strings that map in order to the list of
  55. interrupts specified in the 'interrupts' property.
  56. [Third Level Nodes]
  57. Required properties :
  58. - spmi-dev-container: This specifies that all the device nodes specified for
  59. this slave_id should have their resources coalesced into only one
  60. spmi_device.
  61. - reg: <a b> where a is < 65536 and b is a size. Each device supports an
  62. arbitrary number of address ranges.
  63. - compatible : "qcom," prefixed string to match against the driver.
  64. Recommended properties :
  65. - interrupts : <a b c> where a is the slave ID, b is the peripheral ID,
  66. c is the device interrupt number (0-7). Each device supports any arbitrary
  67. number of interrupts.
  68. - interrupt-parent : the phandle for the interrupt controller that
  69. services interrupts for this device.
  70. - reg-names : a list of strings that map in order to the list of addresses
  71. specified above in the 'reg' property.
  72. - interrupt-names : a list of strings that map in order to the list of
  73. interrupts specified in the 'interrupts' property.
  74. - label: A single name that names the device. This name can be looked up
  75. with spmi_get_node_byname(). This is mostly useful in spmi-dev-container
  76. configurations where multiple device_nodes are associated with one spmi
  77. device.
  78. Notes :
  79. - It is considered an error to include spmi-slave-dev at this level.
  80. [Example]
  81. / {
  82. qpnp: qcom,spmi@fc4c0000 {
  83. #address-cells = <1>;
  84. #size-cells = <0>;
  85. interrupt-controller;
  86. #interrupt-cells = <3>;
  87. testint@f {
  88. interrupt-parent = <&qpnp>;
  89. compatible = "qcom,qpnp-testint";
  90. reg = <0xf>;
  91. interrupts = <0x3 0x15 0x0 0x3 0x15 0x02 0x1 0x47 0x0>;
  92. interrupt-names = "testint_0", "testint_1", "testint_err";
  93. };
  94. pm8941@0 {
  95. spmi-slave-container;
  96. reg = <0x0>;
  97. #address-cells = <1>;
  98. #size-cells = <1>;
  99. pm8941_gpios: gpios {
  100. spmi-dev-container;
  101. compatible = "qcom,qpnp-pin";
  102. gpio-controller;
  103. #gpio-cells = <1>;
  104. #address-cells = <1>;
  105. #size-cells = <1>;
  106. pm8941_gpio1@0xc000 {
  107. compatible = "qcom,qpnp-pin";
  108. reg = <0xc000 0x100>;
  109. qcom,qpnp_gpio = <1>;
  110. interrupt-parent = <&qpnp>;
  111. interrupts = <0x3 0x15 0x02 0x1 0x47 0x0>;
  112. label = "foo-dev";
  113. };
  114. pm8941_gpio2@0xc100 {
  115. compatible = "qcom,qpnp-pin";
  116. reg = <0xc100 0x100>;
  117. qcom,qpnp_gpio = <2>;
  118. interrupt-parent = <&qpnp>;
  119. interrupts = <0x3 0x15 0x0>;
  120. };
  121. };
  122. testgpio@0x1000 {
  123. compatible = "qcom,qpnp-testgpio";
  124. reg = <0x1000 0x1000 0x2000 0x1000>;
  125. reg-names = "foo", "bar";
  126. qpnp-gpios = <&pm8941_gpios 0x0>;
  127. };
  128. };
  129. pm8841@2 {
  130. spmi-slave-container;
  131. reg = <0x2>;
  132. #address-cells = <1>;
  133. #size-cells = <1>;
  134. spmi-dev-container;
  135. compatible = "qcom,qpnp-pin";
  136. pm8841_gpio1@0xc000 {
  137. reg = <0xc000 0x100>;
  138. qcom,qpnp_gpio = <1>;
  139. };
  140. pm8841_gpio2@0xc100 {
  141. reg = <0xc100 0x100>;
  142. qcom,qpnp_gpio = <2>;
  143. };
  144. };
  145. };
  146. };