Documentation / devicetree / bindings / sound / realtek,rt5640.yaml


Based on kernel version 6.13. Page generated on 2025-01-21 08:21 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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/realtek,rt5640.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: RT5640/RT5639 audio CODEC

maintainers:
  - Neil Armstrong <neil.armstrong@linaro.org>

description: |
  This device supports I2C only.
 
  Pins on the device (for linking into audio routes) for RT5639/RT5640:
    * DMIC1
    * DMIC2
    * MICBIAS1
    * IN1P
    * IN1N
    * IN2P
    * IN2N
    * IN3P
    * IN3N
    * HPOL
    * HPOR
    * LOUTL
    * LOUTR
    * SPOLP
    * SPOLN
    * SPORP
    * SPORN
 
  Additional pins on the device for RT5640:
    * MONOP
    * MONON

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    enum:
      - realtek,rt5640
      - realtek,rt5639

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: The CODEC's interrupt output.

  realtek,in1-differential:
    description:
      Indicate MIC1 input is differential, rather than single-ended.
    type: boolean

  realtek,in2-differential:
    description:
      Indicate MIC2 input is differential, rather than single-ended.
    type: boolean

  realtek,in3-differential:
    description:
      Indicate MIC3 input is differential, rather than single-ended.
    type: boolean

  realtek,lout-differential:
    description:
      Indicate LOUT output is differential, rather than single-ended.
    type: boolean

  realtek,dmic1-data-pin:
    description: Specify which pin to be used as DMIC1 data pin.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 0 # dmic1 is not used
      - 1 # using IN2P pin as dmic1 data pin
      - 2 # using GPIO3 pin as dmic1 data pin

  realtek,dmic2-data-pin:
    description: Specify which pin to be used as DMIC2 data pin.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 0 # dmic2 is not used
      - 1 # using IN2N pin as dmic2 data pin
      - 2 # using GPIO4 pin as dmic2 data pin

  realtek,jack-detect-source:
    description: The Jack Detect source.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 0 # Jack Detect function is not used
      - 1 # Use GPIO1 for jack-detect
      - 2 # Use JD1_IN4P for jack-detect
      - 3 # Use JD2_IN4N for jack-detect
      - 4 # Use GPIO2 for jack-detect
      - 5 # Use GPIO3 for jack-detect
      - 6 # Use GPIO4 for jack-detect

  realtek,jack-detect-not-inverted:
    description:
      Normal jack-detect switches give an inverted signal, set this bool
      in the rare case you've a jack-detect switch which is not inverted.
    type: boolean

  realtek,over-current-threshold-microamp:
    description: micbias over-current detection threshold in µA
    enum:
      - 600
      - 1500
      - 2000

  realtek,over-current-scale-factor:
    description: micbias over-current detection scale-factor
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 0 # Scale current by 0.5
      - 1 # Scale current by 0.75
      - 2 # Scale current by 1.0
      - 3 # Scale current by 1.5

required:
  - compatible
  - reg
  - interrupts

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
 
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
 
        codec@1a {
            compatible = "realtek,rt5640";
            reg = <0x1a>;
            interrupt-parent = <&gpio>;
            interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
        };
    };