RT5640/RT5639 audio CODEC

Schema identifier ($id): "http://devicetree.org/schemas/sound/realtek,rt5640.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Neil Armstrong <neil.armstrong@linaro.org>"

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

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): dai-common.yaml#

Properties and child nodes (properties) #

compatible — required here #

Allowed values (enum): "realtek,rt5640", "realtek,rt5639"

reg — required here #

Maximum number of items (maxItems): 1

clocks — not listed as required here #

Maximum number of items (maxItems): 1

clock-names — not listed as required here #

Exact value (const): "mclk"

interrupts — required here #

Maximum number of items (maxItems): 1

The CODEC's interrupt output.

realtek,in1-differential — not listed as required here #

Indicate MIC1 input is differential, rather than single-ended.

Value type (type): "boolean"

realtek,in2-differential — not listed as required here #

Indicate MIC2 input is differential, rather than single-ended.

Value type (type): "boolean"

realtek,in3-differential — not listed as required here #

Indicate MIC3 input is differential, rather than single-ended.

Value type (type): "boolean"

realtek,lout-differential — not listed as required here #

Indicate LOUT output is differential, rather than single-ended.

Value type (type): "boolean"

realtek,dmic1-data-pin — not listed as required here #

Specify which pin to be used as DMIC1 data pin.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Allowed values (enum): 0, 1, 2

realtek,dmic2-data-pin — not listed as required here #

Specify which pin to be used as DMIC2 data pin.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Allowed values (enum): 0, 1, 2

realtek,jack-detect-source — not listed as required here #

The Jack Detect source.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Allowed values (enum): 0, 1, 2, 3, 4, 5, 6, 7

realtek,jack-detect-not-inverted — not listed as required here #

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.

Value type (type): "boolean"

realtek,over-current-threshold-microamp — not listed as required here #

micbias over-current detection threshold in µA

Allowed values (enum): 600, 1500, 2000

realtek,over-current-scale-factor — not listed as required here #

micbias over-current detection scale-factor

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Allowed values (enum): 0, 1, 2, 3

port — not listed as required here #

Shared schema rule ($ref): audio-graph-port.yaml#

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Required in this object (required): "compatible", "reg", "interrupts"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (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>;
    };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause

Line 84: dmic1 is not used

Line 85: using IN2P pin as dmic1 data pin

Line 86: using GPIO3 pin as dmic1 data pin

Line 92: dmic2 is not used

Line 93: using IN2N pin as dmic2 data pin

Line 94: using GPIO4 pin as dmic2 data pin

Line 100: Jack Detect function is not used

Line 101: Use GPIO1 for jack-detect

Line 102: Use JD1_IN4P for jack-detect

Line 103: Use JD2_IN4N for jack-detect

Line 104: Use GPIO2 for jack-detect

Line 105: Use GPIO3 for jack-detect

Line 106: Use GPIO4 for jack-detect

Line 107: Use HDA header for jack-detect

Line 126: Scale current by 0.5

Line 127: Scale current by 0.75

Line 128: Scale current by 1.0

Line 129: Scale current by 1.5

Edit this page