156d79422SLudovic Desroches* Atmel PIO4 Controller 256d79422SLudovic Desroches 356d79422SLudovic DesrochesThe Atmel PIO4 controller is used to select the function of a pin and to 456d79422SLudovic Desrochesconfigure it. 556d79422SLudovic Desroches 656d79422SLudovic DesrochesRequired properties: 71e871d0cSEugen Hristev- compatible: 81e871d0cSEugen Hristev "atmel,sama5d2-pinctrl" 91e871d0cSEugen Hristev "microchip,sama7g5-pinctrl" 1056d79422SLudovic Desroches- reg: base address and length of the PIO controller. 1156d79422SLudovic Desroches- interrupts: interrupt outputs from the controller, one for each bank. 1256d79422SLudovic Desroches- interrupt-controller: mark the device node as an interrupt controller. 1356d79422SLudovic Desroches- #interrupt-cells: should be two. 1456d79422SLudovic Desroches- gpio-controller: mark the device node as a gpio controller. 1556d79422SLudovic Desroches- #gpio-cells: should be two. 1656d79422SLudovic Desroches 1756d79422SLudovic DesrochesPlease refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 1856d79422SLudovic Desrochesa general description of GPIO and interrupt bindings. 1956d79422SLudovic Desroches 2056d79422SLudovic DesrochesPlease refer to pinctrl-bindings.txt in this directory for details of the 2156d79422SLudovic Desrochescommon pinctrl bindings used by client devices. 2256d79422SLudovic Desroches 2356d79422SLudovic DesrochesSubnode format 2456d79422SLudovic DesrochesEach node (or subnode) will list the pins it needs and how to configured these 2556d79422SLudovic Desrochespins. 2656d79422SLudovic Desroches 2756d79422SLudovic Desroches node { 2856d79422SLudovic Desroches pinmux = <PIN_NUMBER_PINMUX>; 2956d79422SLudovic Desroches GENERIC_PINCONFIG; 3056d79422SLudovic Desroches }; 3156d79422SLudovic Desroches 3256d79422SLudovic DesrochesRequired properties: 3356d79422SLudovic Desroches- pinmux: integer array. Each integer represents a pin number plus mux and 3456d79422SLudovic Desrochesioset settings. Use the macros from boot/dts/<soc>-pinfunc.h file to get the 3556d79422SLudovic Desrochesright representation of the pin. 3656d79422SLudovic Desroches 3756d79422SLudovic DesrochesOptional properties: 38aad018aaSClaudiu Beznea- GENERIC_PINCONFIG: generic pinconfig options to use: 39aad018aaSClaudiu Beznea - bias-disable, bias-pull-down, bias-pull-up, drive-open-drain, 40*93bd39f0SRyan Wanner drive-push-pull input-schmitt-enable, input-debounce, output-low, 41*93bd39f0SRyan Wanner output-high. 42aad018aaSClaudiu Beznea - for microchip,sama7g5-pinctrl only: 43aad018aaSClaudiu Beznea - slew-rate: 0 - disabled, 1 - enabled (default) 44ff10e353SLudovic Desroches- atmel,drive-strength: 0 or 1 for low drive, 2 for medium drive and 3 for 45ff10e353SLudovic Desrocheshigh drive. The default value is low drive. 4656d79422SLudovic Desroches 4756d79422SLudovic DesrochesExample: 4856d79422SLudovic Desroches 4956d79422SLudovic Desroches#include <sama5d2-pinfunc.h> 5056d79422SLudovic Desroches 5156d79422SLudovic Desroches... 5256d79422SLudovic Desroches{ 5356d79422SLudovic Desroches pioA: pinctrl@fc038000 { 5456d79422SLudovic Desroches compatible = "atmel,sama5d2-pinctrl"; 5556d79422SLudovic Desroches reg = <0xfc038000 0x600>; 5656d79422SLudovic Desroches interrupts = <18 IRQ_TYPE_LEVEL_HIGH 7>, 5756d79422SLudovic Desroches <68 IRQ_TYPE_LEVEL_HIGH 7>, 5856d79422SLudovic Desroches <69 IRQ_TYPE_LEVEL_HIGH 7>, 5956d79422SLudovic Desroches <70 IRQ_TYPE_LEVEL_HIGH 7>; 6056d79422SLudovic Desroches interrupt-controller; 6156d79422SLudovic Desroches #interrupt-cells = <2>; 6256d79422SLudovic Desroches gpio-controller; 6356d79422SLudovic Desroches #gpio-cells = <2>; 6456d79422SLudovic Desroches clocks = <&pioA_clk>; 6556d79422SLudovic Desroches 6656d79422SLudovic Desroches pinctrl_i2c0_default: i2c0_default { 6756d79422SLudovic Desroches pinmux = <PIN_PD21__TWD0>, 6856d79422SLudovic Desroches <PIN_PD22__TWCK0>; 6956d79422SLudovic Desroches bias-disable; 7056d79422SLudovic Desroches }; 7156d79422SLudovic Desroches 7256d79422SLudovic Desroches pinctrl_led_gpio_default: led_gpio_default { 7356d79422SLudovic Desroches pinmux = <PIN_PB0>, 7456d79422SLudovic Desroches <PIN_PB5>; 7556d79422SLudovic Desroches bias-pull-up; 76ff10e353SLudovic Desroches atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>; 7756d79422SLudovic Desroches }; 7856d79422SLudovic Desroches 7956d79422SLudovic Desroches pinctrl_sdmmc1_default: sdmmc1_default { 8056d79422SLudovic Desroches cmd_data { 8156d79422SLudovic Desroches pinmux = <PIN_PA28__SDMMC1_CMD>, 8256d79422SLudovic Desroches <PIN_PA18__SDMMC1_DAT0>, 8356d79422SLudovic Desroches <PIN_PA19__SDMMC1_DAT1>, 8456d79422SLudovic Desroches <PIN_PA20__SDMMC1_DAT2>, 8556d79422SLudovic Desroches <PIN_PA21__SDMMC1_DAT3>; 8656d79422SLudovic Desroches bias-pull-up; 8756d79422SLudovic Desroches }; 8856d79422SLudovic Desroches 8956d79422SLudovic Desroches ck_cd { 9056d79422SLudovic Desroches pinmux = <PIN_PA22__SDMMC1_CK>, 9156d79422SLudovic Desroches <PIN_PA30__SDMMC1_CD>; 9256d79422SLudovic Desroches bias-disable; 9356d79422SLudovic Desroches }; 9456d79422SLudovic Desroches }; 9556d79422SLudovic Desroches ... 9656d79422SLudovic Desroches }; 9756d79422SLudovic Desroches}; 9856d79422SLudovic Desroches... 99