Pramod Kumar | 604b257 | 2015-11-19 09:22:18 +0530 | [diff] [blame] | 1 | Broadcom iProc GPIO/PINCONF Controller |
Ray Jui | 2dffad8 | 2015-03-09 13:44:59 -0700 | [diff] [blame] | 2 | |
| 3 | Required properties: |
| 4 | |
| 5 | - compatible: |
Pramod Kumar | e054800 | 2015-10-19 11:13:11 +0530 | [diff] [blame] | 6 | Must be "brcm,cygnus-ccm-gpio", "brcm,cygnus-asiu-gpio", |
| 7 | "brcm,cygnus-crmu-gpio" or "brcm,iproc-gpio" |
Ray Jui | 2dffad8 | 2015-03-09 13:44:59 -0700 | [diff] [blame] | 8 | |
| 9 | - reg: |
Pramod Kumar | 604b257 | 2015-11-19 09:22:18 +0530 | [diff] [blame] | 10 | Define the base and range of the I/O address space that contains SoC |
Ray Jui | 2dffad8 | 2015-03-09 13:44:59 -0700 | [diff] [blame] | 11 | GPIO/PINCONF controller registers |
| 12 | |
Pramod Kumar | 2652df6 | 2015-11-19 09:22:13 +0530 | [diff] [blame] | 13 | - ngpios: |
| 14 | Total number of in-use slots in GPIO controller |
| 15 | |
Ray Jui | 2dffad8 | 2015-03-09 13:44:59 -0700 | [diff] [blame] | 16 | - #gpio-cells: |
| 17 | Must be two. The first cell is the GPIO pin number (within the |
| 18 | controller's pin space) and the second cell is used for the following: |
| 19 | bit[0]: polarity (0 for active high and 1 for active low) |
| 20 | |
| 21 | - gpio-controller: |
| 22 | Specifies that the node is a GPIO controller |
| 23 | |
| 24 | Optional properties: |
| 25 | |
| 26 | - interrupts: |
| 27 | Interrupt ID |
| 28 | |
| 29 | - interrupt-controller: |
| 30 | Specifies that the node is an interrupt controller |
| 31 | |
Pramod Kumar | 03e09bc | 2015-10-19 11:13:08 +0530 | [diff] [blame] | 32 | - gpio-ranges: |
| 33 | Specifies the mapping between gpio controller and pin-controllers pins. |
| 34 | This requires 4 fields in cells defined as - |
| 35 | 1. Phandle of pin-controller. |
| 36 | 2. GPIO base pin offset. |
| 37 | 3 Pin-control base pin offset. |
| 38 | 4. number of gpio pins which are linearly mapped from pin base. |
Ray Jui | 2dffad8 | 2015-03-09 13:44:59 -0700 | [diff] [blame] | 39 | |
| 40 | Supported generic PINCONF properties in child nodes: |
| 41 | |
| 42 | - pins: |
| 43 | The list of pins (within the controller's own pin space) that properties |
| 44 | in the node apply to. Pin names are "gpio-<pin>" |
| 45 | |
| 46 | - bias-disable: |
| 47 | Disable pin bias |
| 48 | |
| 49 | - bias-pull-up: |
| 50 | Enable internal pull up resistor |
| 51 | |
| 52 | - bias-pull-down: |
| 53 | Enable internal pull down resistor |
| 54 | |
| 55 | - drive-strength: |
| 56 | Valid drive strength values include 2, 4, 6, 8, 10, 12, 14, 16 (mA) |
| 57 | |
| 58 | Example: |
| 59 | gpio_ccm: gpio@1800a000 { |
| 60 | compatible = "brcm,cygnus-ccm-gpio"; |
| 61 | reg = <0x1800a000 0x50>, |
| 62 | <0x0301d164 0x20>; |
Pramod Kumar | 2652df6 | 2015-11-19 09:22:13 +0530 | [diff] [blame] | 63 | ngpios = <24>; |
Ray Jui | 2dffad8 | 2015-03-09 13:44:59 -0700 | [diff] [blame] | 64 | #gpio-cells = <2>; |
| 65 | gpio-controller; |
| 66 | interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>; |
| 67 | interrupt-controller; |
| 68 | |
| 69 | touch_pins: touch_pins { |
| 70 | pwr: pwr { |
| 71 | pins = "gpio-0"; |
| 72 | drive-strength = <16>; |
| 73 | }; |
| 74 | |
| 75 | event: event { |
| 76 | pins = "gpio-1"; |
| 77 | bias-pull-up; |
| 78 | }; |
| 79 | }; |
| 80 | }; |
| 81 | |
| 82 | gpio_asiu: gpio@180a5000 { |
| 83 | compatible = "brcm,cygnus-asiu-gpio"; |
| 84 | reg = <0x180a5000 0x668>; |
Pramod Kumar | 2652df6 | 2015-11-19 09:22:13 +0530 | [diff] [blame] | 85 | ngpios = <146>; |
Ray Jui | 2dffad8 | 2015-03-09 13:44:59 -0700 | [diff] [blame] | 86 | #gpio-cells = <2>; |
| 87 | gpio-controller; |
| 88 | interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; |
| 89 | interrupt-controller; |
Pramod Kumar | 03e09bc | 2015-10-19 11:13:08 +0530 | [diff] [blame] | 90 | gpio-ranges = <&pinctrl 0 42 1>, |
| 91 | <&pinctrl 1 44 3>; |
Ray Jui | 2dffad8 | 2015-03-09 13:44:59 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
| 94 | /* |
| 95 | * Touchscreen that uses the CCM GPIO 0 and 1 |
| 96 | */ |
| 97 | tsc { |
| 98 | ... |
| 99 | ... |
| 100 | gpio-pwr = <&gpio_ccm 0 0>; |
| 101 | gpio-event = <&gpio_ccm 1 0>; |
| 102 | }; |
| 103 | |
| 104 | /* Bluetooth that uses the ASIU GPIO 5, with polarity inverted */ |
| 105 | bluetooth { |
| 106 | ... |
| 107 | ... |
| 108 | bcm,rfkill-bank-sel = <&gpio_asiu 5 1> |
| 109 | } |