Rohit Vaswani | b1cc493 | 2012-07-23 21:30:11 -0700 | [diff] [blame] | 1 | MSM GPIO controller bindings |
| 2 | |
| 3 | Required properties: |
| 4 | - compatible: |
| 5 | - "qcom,msm-gpio" for MSM controllers |
| 6 | - #gpio-cells : Should be two. |
| 7 | - first cell is the pin number |
| 8 | - second cell is used to specify optional parameters (unused) |
| 9 | - gpio-controller : Marks the device node as a GPIO controller. |
| 10 | - #interrupt-cells : Should be 2. |
| 11 | - interrupt-controller: Mark the device node as an interrupt controller |
| 12 | |
| 13 | Example: |
| 14 | |
| 15 | msmgpio: gpio@fd510000 { |
| 16 | compatible = "qcom,msm-gpio"; |
| 17 | gpio-controller; |
| 18 | #gpio-cells = <2>; |
| 19 | interrupt-controller; |
| 20 | #interrupt-cells = <2>; |
| 21 | reg = <0xfd510000 0x4000>; |
| 22 | }; |
| 23 | |
| 24 | To specify gpios for a device: |
| 25 | |
| 26 | device1@f991f000 { |
| 27 | compatible = "qcom,msm-device-v1"; |
| 28 | reg = <0xf991f000 0x1000>; |
| 29 | gpios = <&msmgpio 45 0>; |
| 30 | cs-gpios = <&msmgpio 46 0>; |
| 31 | }; |
| 32 | |
| 33 | 45, 46 - gpio numbers. |
| 34 | The driver for device1 can call of_get_gpio() to extract the |
| 35 | gpio45. In order to extract gpio46, the driver needs to call |
| 36 | of_get_named_gpio with "cs-gpios" as the name parameter. |
| 37 | Please refer to the file: include/linux/of_gpio.h for the |
| 38 | complete list of APIs the driver can use to extract gpio |
| 39 | information from the device tree. |