1c66ec88fSEmmanuel VadotSamsung GPIO and Pin Mux/Config controller 2c66ec88fSEmmanuel Vadot 3c66ec88fSEmmanuel VadotSamsung's ARM based SoC's integrates a GPIO and Pin mux/config hardware 4c66ec88fSEmmanuel Vadotcontroller. It controls the input/output settings on the available pads/pins 5c66ec88fSEmmanuel Vadotand also provides ability to multiplex and configure the output of various 6c66ec88fSEmmanuel Vadoton-chip controllers onto these pads. 7c66ec88fSEmmanuel Vadot 8c66ec88fSEmmanuel VadotRequired Properties: 9c66ec88fSEmmanuel Vadot- compatible: should be one of the following. 10c66ec88fSEmmanuel Vadot - "samsung,s3c2412-pinctrl": for S3C2412-compatible pin-controller, 11c66ec88fSEmmanuel Vadot - "samsung,s3c2416-pinctrl": for S3C2416-compatible pin-controller, 12c66ec88fSEmmanuel Vadot - "samsung,s3c2440-pinctrl": for S3C2440-compatible pin-controller, 13c66ec88fSEmmanuel Vadot - "samsung,s3c2450-pinctrl": for S3C2450-compatible pin-controller, 14c66ec88fSEmmanuel Vadot - "samsung,s3c64xx-pinctrl": for S3C64xx-compatible pin-controller, 15c66ec88fSEmmanuel Vadot - "samsung,s5pv210-pinctrl": for S5PV210-compatible pin-controller, 16c66ec88fSEmmanuel Vadot - "samsung,exynos3250-pinctrl": for Exynos3250 compatible pin-controller. 17c66ec88fSEmmanuel Vadot - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller. 18c66ec88fSEmmanuel Vadot - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller. 19c66ec88fSEmmanuel Vadot - "samsung,exynos5250-pinctrl": for Exynos5250 compatible pin-controller. 20c66ec88fSEmmanuel Vadot - "samsung,exynos5260-pinctrl": for Exynos5260 compatible pin-controller. 21c66ec88fSEmmanuel Vadot - "samsung,exynos5410-pinctrl": for Exynos5410 compatible pin-controller. 22c66ec88fSEmmanuel Vadot - "samsung,exynos5420-pinctrl": for Exynos5420 compatible pin-controller. 23c66ec88fSEmmanuel Vadot - "samsung,exynos5433-pinctrl": for Exynos5433 compatible pin-controller. 24c66ec88fSEmmanuel Vadot - "samsung,exynos7-pinctrl": for Exynos7 compatible pin-controller. 25*e67e8565SEmmanuel Vadot - "samsung,exynos7885-pinctrl": for Exynos7885 compatible pin-controller. 26354d7675SEmmanuel Vadot - "samsung,exynos850-pinctrl": for Exynos850 compatible pin-controller. 278cc087a1SEmmanuel Vadot - "samsung,exynosautov9-pinctrl": for ExynosAutov9 compatible pin-controller. 28c66ec88fSEmmanuel Vadot 29c66ec88fSEmmanuel Vadot- reg: Base address of the pin controller hardware module and length of 30c66ec88fSEmmanuel Vadot the address space it occupies. 31c66ec88fSEmmanuel Vadot 32c66ec88fSEmmanuel Vadot - reg: Second base address of the pin controller if the specific registers 33c66ec88fSEmmanuel Vadot of the pin controller are separated into the different base address. 34c66ec88fSEmmanuel Vadot 35c66ec88fSEmmanuel Vadot Eg: GPF[1-5] of Exynos5433 are separated into the two base address. 36c66ec88fSEmmanuel Vadot - First base address is for GPAx and GPF[1-5] external interrupt 37c66ec88fSEmmanuel Vadot registers. 38c66ec88fSEmmanuel Vadot - Second base address is for GPF[1-5] pinctrl registers. 39c66ec88fSEmmanuel Vadot 40c66ec88fSEmmanuel Vadot pinctrl_0: pinctrl@10580000 { 41c66ec88fSEmmanuel Vadot compatible = "samsung,exynos5433-pinctrl"; 42c66ec88fSEmmanuel Vadot reg = <0x10580000 0x1a20>, <0x11090000 0x100>; 43c66ec88fSEmmanuel Vadot 44c66ec88fSEmmanuel Vadot wakeup-interrupt-controller { 45c66ec88fSEmmanuel Vadot compatible = "samsung,exynos7-wakeup-eint"; 46c66ec88fSEmmanuel Vadot interrupts = <0 16 0>; 47c66ec88fSEmmanuel Vadot }; 48c66ec88fSEmmanuel Vadot }; 49c66ec88fSEmmanuel Vadot 50c66ec88fSEmmanuel Vadot- Pin banks as child nodes: Pin banks of the controller are represented by child 51c66ec88fSEmmanuel Vadot nodes of the controller node. Bank name is taken from name of the node. Each 52c66ec88fSEmmanuel Vadot bank node must contain following properties: 53c66ec88fSEmmanuel Vadot 54c66ec88fSEmmanuel Vadot - gpio-controller: identifies the node as a gpio controller and pin bank. 55c66ec88fSEmmanuel Vadot - #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO 56c66ec88fSEmmanuel Vadot binding is used, the amount of cells must be specified as 2. See the below 57c66ec88fSEmmanuel Vadot mentioned gpio binding representation for description of particular cells. 58c66ec88fSEmmanuel Vadot 59c66ec88fSEmmanuel Vadot Eg: <&gpx2 6 0> 60c66ec88fSEmmanuel Vadot <[phandle of the gpio controller node] 61c66ec88fSEmmanuel Vadot [pin number within the gpio controller] 62c66ec88fSEmmanuel Vadot [flags]> 63c66ec88fSEmmanuel Vadot 64c66ec88fSEmmanuel Vadot Values for gpio specifier: 65c66ec88fSEmmanuel Vadot - Pin number: is a value between 0 to 7. 66c66ec88fSEmmanuel Vadot - Flags: 0 - Active High 67c66ec88fSEmmanuel Vadot 1 - Active Low 68c66ec88fSEmmanuel Vadot 69c66ec88fSEmmanuel Vadot- Pin mux/config groups as child nodes: The pin mux (selecting pin function 70c66ec88fSEmmanuel Vadot mode) and pin config (pull up/down, driver strength) settings are represented 71c66ec88fSEmmanuel Vadot as child nodes of the pin-controller node. There should be at least one 72c66ec88fSEmmanuel Vadot child node and there is no limit on the count of these child nodes. It is 73c66ec88fSEmmanuel Vadot also possible for a child node to consist of several further child nodes 74c66ec88fSEmmanuel Vadot to allow grouping multiple pinctrl groups into one. The format of second 75c66ec88fSEmmanuel Vadot level child nodes is exactly the same as for first level ones and is 76c66ec88fSEmmanuel Vadot described below. 77c66ec88fSEmmanuel Vadot 78c66ec88fSEmmanuel Vadot The child node should contain a list of pin(s) on which a particular pin 79c66ec88fSEmmanuel Vadot function selection or pin configuration (or both) have to applied. This 80c66ec88fSEmmanuel Vadot list of pins is specified using the property name "samsung,pins". There 816be33864SEmmanuel Vadot should be at least one pin specified for this property and there is no upper 82c66ec88fSEmmanuel Vadot limit on the count of pins that can be specified. The pins are specified 83c66ec88fSEmmanuel Vadot using pin names which are derived from the hardware manual of the SoC. As 84c66ec88fSEmmanuel Vadot an example, the pins in GPA0 bank of the pin controller can be represented 85c66ec88fSEmmanuel Vadot as "gpa0-0", "gpa0-1", "gpa0-2" and so on. The names should be in lower case. 86c66ec88fSEmmanuel Vadot The format of the pin names should be (as per the hardware manual) 87c66ec88fSEmmanuel Vadot "[pin bank name]-[pin number within the bank]". 88c66ec88fSEmmanuel Vadot 89c66ec88fSEmmanuel Vadot The pin function selection that should be applied on the pins listed in the 90c66ec88fSEmmanuel Vadot child node is specified using the "samsung,pin-function" property. The value 91c66ec88fSEmmanuel Vadot of this property that should be applied to each of the pins listed in the 92c66ec88fSEmmanuel Vadot "samsung,pins" property should be picked from the hardware manual of the SoC 93c66ec88fSEmmanuel Vadot for the specified pin group. This property is optional in the child node if 94c66ec88fSEmmanuel Vadot no specific function selection is desired for the pins listed in the child 95c66ec88fSEmmanuel Vadot node. The value of this property is used as-is to program the pin-controller 96c66ec88fSEmmanuel Vadot function selector register of the pin-bank. 97c66ec88fSEmmanuel Vadot 98c66ec88fSEmmanuel Vadot The child node can also optionally specify one or more of the pin 99c66ec88fSEmmanuel Vadot configuration that should be applied on all the pins listed in the 100c66ec88fSEmmanuel Vadot "samsung,pins" property of the child node. The following pin configuration 101c66ec88fSEmmanuel Vadot properties are supported. 102c66ec88fSEmmanuel Vadot 103c66ec88fSEmmanuel Vadot - samsung,pin-val: Initial value of pin output buffer. 104c66ec88fSEmmanuel Vadot - samsung,pin-pud: Pull up/down configuration. 105c66ec88fSEmmanuel Vadot - samsung,pin-drv: Drive strength configuration. 106c66ec88fSEmmanuel Vadot - samsung,pin-pud-pdn: Pull up/down configuration in power down mode. 107c66ec88fSEmmanuel Vadot - samsung,pin-drv-pdn: Drive strength configuration in power down mode. 108c66ec88fSEmmanuel Vadot 109c66ec88fSEmmanuel Vadot The values specified by these config properties should be derived from the 110c66ec88fSEmmanuel Vadot hardware manual and these values are programmed as-is into the pin 111c66ec88fSEmmanuel Vadot pull up/down and driver strength register of the pin-controller. 112c66ec88fSEmmanuel Vadot 113c66ec88fSEmmanuel Vadot Note: A child should include at least a pin function selection property or 114c66ec88fSEmmanuel Vadot pin configuration property (one or more) or both. 115c66ec88fSEmmanuel Vadot 116c66ec88fSEmmanuel Vadot The client nodes that require a particular pin function selection and/or 117c66ec88fSEmmanuel Vadot pin configuration should use the bindings listed in the "pinctrl-bindings.txt" 118c66ec88fSEmmanuel Vadot file. 119c66ec88fSEmmanuel Vadot 120c66ec88fSEmmanuel VadotExternal GPIO and Wakeup Interrupts: 121c66ec88fSEmmanuel Vadot 122c66ec88fSEmmanuel VadotThe controller supports two types of external interrupts over gpio. The first 123c66ec88fSEmmanuel Vadotis the external gpio interrupt and second is the external wakeup interrupts. 124c66ec88fSEmmanuel VadotThe difference between the two is that the external wakeup interrupts can be 125c66ec88fSEmmanuel Vadotused as system wakeup events. 126c66ec88fSEmmanuel Vadot 127c66ec88fSEmmanuel VadotA. External GPIO Interrupts: For supporting external gpio interrupts, the 128c66ec88fSEmmanuel Vadot following properties should be specified in the pin-controller device node. 129c66ec88fSEmmanuel Vadot 130c66ec88fSEmmanuel Vadot - interrupts: interrupt specifier for the controller. The format and value of 131c66ec88fSEmmanuel Vadot the interrupt specifier depends on the interrupt parent for the controller. 132c66ec88fSEmmanuel Vadot 133c66ec88fSEmmanuel Vadot In addition, following properties must be present in node of every bank 134c66ec88fSEmmanuel Vadot of pins supporting GPIO interrupts: 135c66ec88fSEmmanuel Vadot 136c66ec88fSEmmanuel Vadot - interrupt-controller: identifies the controller node as interrupt-parent. 137c66ec88fSEmmanuel Vadot - #interrupt-cells: the value of this property should be 2. 138c66ec88fSEmmanuel Vadot - First Cell: represents the external gpio interrupt number local to the 139c66ec88fSEmmanuel Vadot external gpio interrupt space of the controller. 140c66ec88fSEmmanuel Vadot - Second Cell: flags to identify the type of the interrupt 141c66ec88fSEmmanuel Vadot - 1 = rising edge triggered 142c66ec88fSEmmanuel Vadot - 2 = falling edge triggered 143c66ec88fSEmmanuel Vadot - 3 = rising and falling edge triggered 144c66ec88fSEmmanuel Vadot - 4 = high level triggered 145c66ec88fSEmmanuel Vadot - 8 = low level triggered 146c66ec88fSEmmanuel Vadot 147c66ec88fSEmmanuel VadotB. External Wakeup Interrupts: For supporting external wakeup interrupts, a 148c66ec88fSEmmanuel Vadot child node representing the external wakeup interrupt controller should be 149c66ec88fSEmmanuel Vadot included in the pin-controller device node. 150c66ec88fSEmmanuel Vadot 151c66ec88fSEmmanuel Vadot Only one pin-controller device node can include external wakeup interrupts 152c66ec88fSEmmanuel Vadot child node (in other words, only one External Wakeup Interrupts 153c66ec88fSEmmanuel Vadot pin-controller is supported). 154c66ec88fSEmmanuel Vadot 155c66ec88fSEmmanuel Vadot This child node should include following properties: 156c66ec88fSEmmanuel Vadot 157c66ec88fSEmmanuel Vadot - compatible: identifies the type of the external wakeup interrupt controller 158c66ec88fSEmmanuel Vadot The possible values are: 159c66ec88fSEmmanuel Vadot - samsung,s3c2410-wakeup-eint: represents wakeup interrupt controller 160c66ec88fSEmmanuel Vadot found on Samsung S3C24xx SoCs except S3C2412 and S3C2413, 161c66ec88fSEmmanuel Vadot - samsung,s3c2412-wakeup-eint: represents wakeup interrupt controller 162c66ec88fSEmmanuel Vadot found on Samsung S3C2412 and S3C2413 SoCs, 163c66ec88fSEmmanuel Vadot - samsung,s3c64xx-wakeup-eint: represents wakeup interrupt controller 164c66ec88fSEmmanuel Vadot found on Samsung S3C64xx SoCs, 165c66ec88fSEmmanuel Vadot - samsung,s5pv210-wakeup-eint: represents wakeup interrupt controller 166c66ec88fSEmmanuel Vadot found on Samsung S5Pv210 SoCs, 167c66ec88fSEmmanuel Vadot - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller 168c66ec88fSEmmanuel Vadot found on Samsung Exynos4210 and S5PC110/S5PV210 SoCs. 169c66ec88fSEmmanuel Vadot - samsung,exynos7-wakeup-eint: represents wakeup interrupt controller 170c66ec88fSEmmanuel Vadot found on Samsung Exynos7 SoC. 171c66ec88fSEmmanuel Vadot - interrupts: interrupt used by multiplexed wakeup interrupts. 172c66ec88fSEmmanuel Vadot 173c66ec88fSEmmanuel Vadot In addition, following properties must be present in node of every bank 174c66ec88fSEmmanuel Vadot of pins supporting wake-up interrupts: 175c66ec88fSEmmanuel Vadot 176c66ec88fSEmmanuel Vadot - interrupt-controller: identifies the node as interrupt-parent. 177c66ec88fSEmmanuel Vadot - #interrupt-cells: the value of this property should be 2 178c66ec88fSEmmanuel Vadot - First Cell: represents the external wakeup interrupt number local to 179c66ec88fSEmmanuel Vadot the external wakeup interrupt space of the controller. 180c66ec88fSEmmanuel Vadot - Second Cell: flags to identify the type of the interrupt 181c66ec88fSEmmanuel Vadot - 1 = rising edge triggered 182c66ec88fSEmmanuel Vadot - 2 = falling edge triggered 183c66ec88fSEmmanuel Vadot - 3 = rising and falling edge triggered 184c66ec88fSEmmanuel Vadot - 4 = high level triggered 185c66ec88fSEmmanuel Vadot - 8 = low level triggered 186c66ec88fSEmmanuel Vadot 187c66ec88fSEmmanuel Vadot Node of every bank of pins supporting direct wake-up interrupts (without 188c66ec88fSEmmanuel Vadot multiplexing) must contain following properties: 189c66ec88fSEmmanuel Vadot 190c66ec88fSEmmanuel Vadot - interrupts: interrupts of the interrupt parent which are used for external 191c66ec88fSEmmanuel Vadot wakeup interrupts from pins of the bank, must contain interrupts for all 192c66ec88fSEmmanuel Vadot pins of the bank. 193c66ec88fSEmmanuel Vadot 194c66ec88fSEmmanuel VadotAliases: 195c66ec88fSEmmanuel Vadot 196c66ec88fSEmmanuel VadotAll the pin controller nodes should be represented in the aliases node using 197c66ec88fSEmmanuel Vadotthe following format 'pinctrl{n}' where n is a unique number for the alias. 198c66ec88fSEmmanuel Vadot 199c66ec88fSEmmanuel VadotAliases for controllers compatible with "samsung,exynos7-pinctrl": 200c66ec88fSEmmanuel Vadot- pinctrl0: pin controller of ALIVE block, 201c66ec88fSEmmanuel Vadot- pinctrl1: pin controller of BUS0 block, 202c66ec88fSEmmanuel Vadot- pinctrl2: pin controller of NFC block, 203c66ec88fSEmmanuel Vadot- pinctrl3: pin controller of TOUCH block, 204c66ec88fSEmmanuel Vadot- pinctrl4: pin controller of FF block, 205c66ec88fSEmmanuel Vadot- pinctrl5: pin controller of ESE block, 206c66ec88fSEmmanuel Vadot- pinctrl6: pin controller of FSYS0 block, 207c66ec88fSEmmanuel Vadot- pinctrl7: pin controller of FSYS1 block, 208c66ec88fSEmmanuel Vadot- pinctrl8: pin controller of BUS1 block, 209c66ec88fSEmmanuel Vadot- pinctrl9: pin controller of AUDIO block, 210c66ec88fSEmmanuel Vadot 211c66ec88fSEmmanuel VadotExample: A pin-controller node with pin banks: 212c66ec88fSEmmanuel Vadot 213c66ec88fSEmmanuel Vadot pinctrl_0: pinctrl@11400000 { 214c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-pinctrl"; 215c66ec88fSEmmanuel Vadot reg = <0x11400000 0x1000>; 216c66ec88fSEmmanuel Vadot interrupts = <0 47 0>; 217c66ec88fSEmmanuel Vadot 218c66ec88fSEmmanuel Vadot /* ... */ 219c66ec88fSEmmanuel Vadot 220c66ec88fSEmmanuel Vadot /* Pin bank without external interrupts */ 221c66ec88fSEmmanuel Vadot gpy0: gpy0 { 222c66ec88fSEmmanuel Vadot gpio-controller; 223c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 224c66ec88fSEmmanuel Vadot }; 225c66ec88fSEmmanuel Vadot 226c66ec88fSEmmanuel Vadot /* ... */ 227c66ec88fSEmmanuel Vadot 228c66ec88fSEmmanuel Vadot /* Pin bank with external GPIO or muxed wake-up interrupts */ 229c66ec88fSEmmanuel Vadot gpj0: gpj0 { 230c66ec88fSEmmanuel Vadot gpio-controller; 231c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 232c66ec88fSEmmanuel Vadot 233c66ec88fSEmmanuel Vadot interrupt-controller; 234c66ec88fSEmmanuel Vadot #interrupt-cells = <2>; 235c66ec88fSEmmanuel Vadot }; 236c66ec88fSEmmanuel Vadot 237c66ec88fSEmmanuel Vadot /* ... */ 238c66ec88fSEmmanuel Vadot 239c66ec88fSEmmanuel Vadot /* Pin bank with external direct wake-up interrupts */ 240c66ec88fSEmmanuel Vadot gpx0: gpx0 { 241c66ec88fSEmmanuel Vadot gpio-controller; 242c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 243c66ec88fSEmmanuel Vadot 244c66ec88fSEmmanuel Vadot interrupt-controller; 245c66ec88fSEmmanuel Vadot interrupt-parent = <&gic>; 246c66ec88fSEmmanuel Vadot interrupts = <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>, 247c66ec88fSEmmanuel Vadot <0 20 0>, <0 21 0>, <0 22 0>, <0 23 0>; 248c66ec88fSEmmanuel Vadot #interrupt-cells = <2>; 249c66ec88fSEmmanuel Vadot }; 250c66ec88fSEmmanuel Vadot 251c66ec88fSEmmanuel Vadot /* ... */ 252c66ec88fSEmmanuel Vadot }; 253c66ec88fSEmmanuel Vadot 254c66ec88fSEmmanuel VadotExample 1: A pin-controller node with pin groups. 255c66ec88fSEmmanuel Vadot 256c66ec88fSEmmanuel Vadot #include <dt-bindings/pinctrl/samsung.h> 257c66ec88fSEmmanuel Vadot 258c66ec88fSEmmanuel Vadot pinctrl_0: pinctrl@11400000 { 259c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-pinctrl"; 260c66ec88fSEmmanuel Vadot reg = <0x11400000 0x1000>; 261c66ec88fSEmmanuel Vadot interrupts = <0 47 0>; 262c66ec88fSEmmanuel Vadot 263c66ec88fSEmmanuel Vadot /* ... */ 264c66ec88fSEmmanuel Vadot 265c66ec88fSEmmanuel Vadot uart0_data: uart0-data { 266c66ec88fSEmmanuel Vadot samsung,pins = "gpa0-0", "gpa0-1"; 267c66ec88fSEmmanuel Vadot samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 268c66ec88fSEmmanuel Vadot samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 269c66ec88fSEmmanuel Vadot samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 270c66ec88fSEmmanuel Vadot }; 271c66ec88fSEmmanuel Vadot 272c66ec88fSEmmanuel Vadot uart0_fctl: uart0-fctl { 273c66ec88fSEmmanuel Vadot samsung,pins = "gpa0-2", "gpa0-3"; 274c66ec88fSEmmanuel Vadot samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 275c66ec88fSEmmanuel Vadot samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 276c66ec88fSEmmanuel Vadot samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 277c66ec88fSEmmanuel Vadot }; 278c66ec88fSEmmanuel Vadot 279c66ec88fSEmmanuel Vadot uart1_data: uart1-data { 280c66ec88fSEmmanuel Vadot samsung,pins = "gpa0-4", "gpa0-5"; 281c66ec88fSEmmanuel Vadot samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 282c66ec88fSEmmanuel Vadot samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 283c66ec88fSEmmanuel Vadot samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 284c66ec88fSEmmanuel Vadot }; 285c66ec88fSEmmanuel Vadot 286c66ec88fSEmmanuel Vadot uart1_fctl: uart1-fctl { 287c66ec88fSEmmanuel Vadot samsung,pins = "gpa0-6", "gpa0-7"; 288c66ec88fSEmmanuel Vadot samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 289c66ec88fSEmmanuel Vadot samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 290c66ec88fSEmmanuel Vadot samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 291c66ec88fSEmmanuel Vadot }; 292c66ec88fSEmmanuel Vadot 293c66ec88fSEmmanuel Vadot i2c2_bus: i2c2-bus { 294c66ec88fSEmmanuel Vadot samsung,pins = "gpa0-6", "gpa0-7"; 295c66ec88fSEmmanuel Vadot samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 296c66ec88fSEmmanuel Vadot samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 297c66ec88fSEmmanuel Vadot samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 298c66ec88fSEmmanuel Vadot }; 299c66ec88fSEmmanuel Vadot 300c66ec88fSEmmanuel Vadot sd4_bus8: sd4-bus-width8 { 301c66ec88fSEmmanuel Vadot part-1 { 302c66ec88fSEmmanuel Vadot samsung,pins = "gpk0-3", "gpk0-4", 303c66ec88fSEmmanuel Vadot "gpk0-5", "gpk0-6"; 304c66ec88fSEmmanuel Vadot samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 305c66ec88fSEmmanuel Vadot samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 306c66ec88fSEmmanuel Vadot samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 307c66ec88fSEmmanuel Vadot }; 308c66ec88fSEmmanuel Vadot part-2 { 309c66ec88fSEmmanuel Vadot samsung,pins = "gpk1-3", "gpk1-4", 310c66ec88fSEmmanuel Vadot "gpk1-5", "gpk1-6"; 311c66ec88fSEmmanuel Vadot samsung,pin-function = <EXYNOS_PIN_FUNC_4>; 312c66ec88fSEmmanuel Vadot samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 313c66ec88fSEmmanuel Vadot samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 314c66ec88fSEmmanuel Vadot }; 315c66ec88fSEmmanuel Vadot }; 316c66ec88fSEmmanuel Vadot }; 317c66ec88fSEmmanuel Vadot 318c66ec88fSEmmanuel VadotExample 2: A pin-controller node with external wakeup interrupt controller node. 319c66ec88fSEmmanuel Vadot 320c66ec88fSEmmanuel Vadot pinctrl_1: pinctrl@11000000 { 321c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-pinctrl"; 322c66ec88fSEmmanuel Vadot reg = <0x11000000 0x1000>; 323c66ec88fSEmmanuel Vadot interrupts = <0 46 0> 324c66ec88fSEmmanuel Vadot 325c66ec88fSEmmanuel Vadot /* ... */ 326c66ec88fSEmmanuel Vadot 327c66ec88fSEmmanuel Vadot wakeup-interrupt-controller { 328c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-wakeup-eint"; 329c66ec88fSEmmanuel Vadot interrupt-parent = <&gic>; 330c66ec88fSEmmanuel Vadot interrupts = <0 32 0>; 331c66ec88fSEmmanuel Vadot }; 332c66ec88fSEmmanuel Vadot }; 333c66ec88fSEmmanuel Vadot 334c66ec88fSEmmanuel VadotExample 3: A uart client node that supports 'default' and 'flow-control' states. 335c66ec88fSEmmanuel Vadot 336c66ec88fSEmmanuel Vadot uart@13800000 { 337c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-uart"; 338c66ec88fSEmmanuel Vadot reg = <0x13800000 0x100>; 339c66ec88fSEmmanuel Vadot interrupts = <0 52 0>; 340c66ec88fSEmmanuel Vadot pinctrl-names = "default", "flow-control; 341c66ec88fSEmmanuel Vadot pinctrl-0 = <&uart0_data>; 3425def4c47SEmmanuel Vadot pinctrl-1 = <&uart0_data>, <&uart0_fctl>; 343c66ec88fSEmmanuel Vadot }; 344c66ec88fSEmmanuel Vadot 345c66ec88fSEmmanuel VadotExample 4: Set up the default pin state for uart controller. 346c66ec88fSEmmanuel Vadot 347c66ec88fSEmmanuel Vadot static int s3c24xx_serial_probe(struct platform_device *pdev) { 348c66ec88fSEmmanuel Vadot struct pinctrl *pinctrl; 349c66ec88fSEmmanuel Vadot 350c66ec88fSEmmanuel Vadot /* ... */ 351c66ec88fSEmmanuel Vadot 352c66ec88fSEmmanuel Vadot pinctrl = devm_pinctrl_get_select_default(&pdev->dev); 353c66ec88fSEmmanuel Vadot } 354c66ec88fSEmmanuel Vadot 355c66ec88fSEmmanuel VadotExample 5: A display port client node that supports 'default' pinctrl state 356c66ec88fSEmmanuel Vadot and gpio binding. 357c66ec88fSEmmanuel Vadot 358c66ec88fSEmmanuel Vadot display-port-controller { 359c66ec88fSEmmanuel Vadot /* ... */ 360c66ec88fSEmmanuel Vadot 361c66ec88fSEmmanuel Vadot samsung,hpd-gpio = <&gpx2 6 0>; 362c66ec88fSEmmanuel Vadot pinctrl-names = "default"; 363c66ec88fSEmmanuel Vadot pinctrl-0 = <&dp_hpd>; 364c66ec88fSEmmanuel Vadot }; 365c66ec88fSEmmanuel Vadot 366c66ec88fSEmmanuel VadotExample 6: Request the gpio for display port controller 367c66ec88fSEmmanuel Vadot 368c66ec88fSEmmanuel Vadot static int exynos_dp_probe(struct platform_device *pdev) 369c66ec88fSEmmanuel Vadot { 370c66ec88fSEmmanuel Vadot int hpd_gpio, ret; 371c66ec88fSEmmanuel Vadot struct device *dev = &pdev->dev; 372c66ec88fSEmmanuel Vadot struct device_node *dp_node = dev->of_node; 373c66ec88fSEmmanuel Vadot 374c66ec88fSEmmanuel Vadot /* ... */ 375c66ec88fSEmmanuel Vadot 376c66ec88fSEmmanuel Vadot hpd_gpio = of_get_named_gpio(dp_node, "samsung,hpd-gpio", 0); 377c66ec88fSEmmanuel Vadot 378c66ec88fSEmmanuel Vadot /* ... */ 379c66ec88fSEmmanuel Vadot 380c66ec88fSEmmanuel Vadot ret = devm_gpio_request_one(&pdev->dev, hpd_gpio, GPIOF_IN, 381c66ec88fSEmmanuel Vadot "hpd_gpio"); 382c66ec88fSEmmanuel Vadot /* ... */ 383c66ec88fSEmmanuel Vadot } 384