Wenyou Yang | 382d562 | 2016-07-20 17:16:28 +0800 | [diff] [blame] | 1 | * Atmel PIO4 Controller |
| 2 | |
| 3 | The Atmel PIO4 controller is used to select the function of a pin and to |
| 4 | configure it. |
| 5 | |
| 6 | Required properties: |
| 7 | - compatible: "atmel,sama5d2-pinctrl". |
| 8 | - reg: base address and length of the PIO controller. |
| 9 | |
| 10 | Please refer to pinctrl-bindings.txt in this directory for details of the |
| 11 | common pinctrl bindings used by client devices. |
| 12 | |
| 13 | Subnode format |
| 14 | Each node (or subnode) will list the pins it needs and how to configured these |
| 15 | pins. |
| 16 | |
| 17 | node { |
| 18 | pinmux = <PIN_NUMBER_PINMUX>; |
| 19 | GENERIC_PINCONFIG; |
| 20 | }; |
| 21 | |
| 22 | Required properties: |
| 23 | - pinmux: integer array. Each integer represents a pin number plus mux and |
| 24 | ioset settings. Use the macros from boot/dts/<soc>-pinfunc.h file to get the |
| 25 | right representation of the pin. |
| 26 | |
| 27 | Optional properties: |
| 28 | - GENERIC_PINCONFIG: generic pinconfig options to use, bias-disable, |
| 29 | bias-pull-down, bias-pull-up, drive-open-drain, input-schmitt-enable, |
| 30 | input-debounce. |
| 31 | |
| 32 | Example: |
| 33 | |
| 34 | #include <sama5d2-pinfunc.h> |
| 35 | |
| 36 | ... |
| 37 | { |
| 38 | spi0: spi@f8000000 { |
| 39 | cs-gpios = <&pioA 17 0>, <0>, <0>, <0>; |
| 40 | pinctrl-names = "default"; |
| 41 | pinctrl-0 = <&pinctrl_spi0_default>; |
| 42 | status = "okay"; |
| 43 | |
| 44 | spi_flash@0 { |
| 45 | compatible = "spi-flash"; |
| 46 | reg = <0>; |
| 47 | spi-max-frequency = <50000000>; |
| 48 | }; |
| 49 | }; |
| 50 | |
| 51 | ... |
| 52 | |
| 53 | pioA: pinctrl@fc038000 { |
| 54 | compatible = "atmel,sama5d2-pinctrl"; |
| 55 | reg = <0xfc038000 0x600>; |
| 56 | |
| 57 | pinctrl_spi0_default: spi0_default { |
| 58 | pinmux = <PIN_PA14__SPI0_SPCK>, |
| 59 | <PIN_PA15__SPI0_MOSI>, |
| 60 | <PIN_PA16__SPI0_MISO>; |
| 61 | bias-disable; |
| 62 | }; |
| 63 | ... |
| 64 | }; |
| 65 | }; |
| 66 | ... |