Documentation / devicetree / bindings / pinctrl / apple,pinctrl.yaml


Based on kernel version 6.8. Page generated on 2024-03-11 21:26 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/apple,pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple GPIO controller

maintainers:
  - Mark Kettenis <kettenis@openbsd.org>

description: |
  The Apple GPIO controller is a simple combined pin and GPIO
  controller present on Apple ARM SoC platforms, including various
  iPhone and iPad devices and the "Apple Silicon" Macs.

properties:
  compatible:
    items:
      - enum:
          - apple,t8103-pinctrl
          - apple,t8112-pinctrl
          - apple,t6000-pinctrl
      - const: apple,pinctrl

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  gpio-controller: true
 
  '#gpio-cells':
    const: 2

  gpio-ranges:
    maxItems: 1

  apple,npins:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: The number of pins in this GPIO controller.

  interrupts:
    description: One interrupt for each of the (up to 7) interrupt
      groups supported by the controller sorted by interrupt group
      number in ascending order.
    minItems: 1
    maxItems: 7

  interrupt-controller: true
 
  '#interrupt-cells':
    const: 2

  power-domains:
    maxItems: 1

patternProperties:
  '-pins$':
    type: object
    $ref: pinmux-node.yaml#

    properties:
      pinmux:
        description:
          Values are constructed from pin number and alternate function
          configuration number using the APPLE_PINMUX() helper macro
          defined in include/dt-bindings/pinctrl/apple.h.

    required:
      - pinmux

    additionalProperties: false

allOf:
  - $ref: pinctrl.yaml#

required:
  - compatible
  - reg
  - gpio-controller
  - '#gpio-cells'
  - gpio-ranges
  - apple,npins

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/apple-aic.h>
    #include <dt-bindings/pinctrl/apple.h>
 
    soc {
      #address-cells = <2>;
      #size-cells = <2>;
 
      pinctrl: pinctrl@23c100000 {
        compatible = "apple,t8103-pinctrl", "apple,pinctrl";
        reg = <0x2 0x3c100000 0x0 0x100000>;
        clocks = <&gpio_clk>;
 
        gpio-controller;
        #gpio-cells = <2>;
        gpio-ranges = <&pinctrl 0 0 212>;
        apple,npins = <212>;
 
        interrupt-controller;
        #interrupt-cells = <2>;
        interrupt-parent = <&aic>;
        interrupts = <AIC_IRQ 16 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 17 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 18 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 19 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 20 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 21 IRQ_TYPE_LEVEL_HIGH>,
                     <AIC_IRQ 22 IRQ_TYPE_LEVEL_HIGH>;
 
        pcie_pins: pcie-pins {
          pinmux = <APPLE_PINMUX(150, 1)>,
                   <APPLE_PINMUX(151, 1)>,
                   <APPLE_PINMUX(32, 1)>;
        };
      };
    };