1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/adi,max98396.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices MAX98396 Speaker Amplifier
8
9maintainers:
10  - Ryan Lee <ryans.lee@analog.com>
11
12description:
13  The MAX98396 is a mono Class-DG speaker amplifier with I/V sense.
14  The device provides a PCM interface for audio data and a standard
15  I2C interface for control data communication.
16  The MAX98397 is a variant of MAX98396 with wide input supply range.
17
18properties:
19  compatible:
20    enum:
21      - adi,max98396
22      - adi,max98397
23  reg:
24    maxItems: 1
25    description: I2C address of the device.
26
27  avdd-supply:
28    description: A 1.8V supply that powers up the AVDD pin.
29
30  dvdd-supply:
31    description: A 1.2V supply that powers up the DVDD pin.
32
33  dvddio-supply:
34    description: A 1.2V or 1.8V supply that powers up the VDDIO pin.
35
36  pvdd-supply:
37    description: A 3.0V to 20V supply that powers up the PVDD pin.
38
39  vbat-supply:
40    description: A 3.3V to 5.5V supply that powers up the VBAT pin.
41
42  adi,vmon-slot-no:
43    description: slot number of the voltage sense monitor
44    $ref: "/schemas/types.yaml#/definitions/uint32"
45    minimum: 0
46    maximum: 15
47    default: 0
48
49  adi,imon-slot-no:
50    description: slot number of the current sense monitor
51    $ref: "/schemas/types.yaml#/definitions/uint32"
52    minimum: 0
53    maximum: 15
54    default: 1
55
56  adi,spkfb-slot-no:
57    description: slot number of speaker DSP monitor
58    $ref: "/schemas/types.yaml#/definitions/uint32"
59    minimum: 0
60    maximum: 15
61    default: 2
62
63  adi,bypass-slot-no:
64    description:
65      Selects the PCM data input channel that is routed to the speaker
66      audio processing bypass path.
67    $ref: "/schemas/types.yaml#/definitions/uint32"
68    minimum: 0
69    maximum: 15
70    default: 0
71
72  adi,interleave-mode:
73    description:
74      For cases where a single combined channel for the I/V sense data
75      is not sufficient, the device can also be configured to share
76      a single data output channel on alternating frames.
77      In this configuration, the current and voltage data will be frame
78      interleaved on a single output channel.
79    type: boolean
80
81  adi,dmon-stuck-enable:
82    description:
83      Enables the "data monitor stuck" feature. Once the data monitor is
84      enabled, it actively monitors the selected input data (from DIN) to the
85      speaker amplifier. Once a data error is detected, the data monitor
86      automatically places the device into software shutdown.
87    type: boolean
88
89  adi,dmon-stuck-threshold-bits:
90    description:
91      Sets the threshold for the "data monitor stuck" feature, in bits.
92    enum: [9, 11, 13, 15]
93    default: 15
94
95  adi,dmon-magnitude-enable:
96    description:
97      Enables the "data monitor magnitude" feature. Once the data monitor is
98      enabled, it actively monitors the selected input data (from DIN) to the
99      speaker amplifier. Once a data error is detected, the data monitor
100      automatically places the device into software shutdown.
101    type: boolean
102
103  adi,dmon-magnitude-threshold-bits:
104    description:
105      Sets the threshold for the "data monitor magnitude" feature, in bits.
106    enum: [2, 3, 4, 5]
107    default: 5
108
109  adi,dmon-duration-ms:
110    description:
111      Sets the duration for the "data monitor" feature, in milliseconds.
112    enum: [64, 256, 1024, 4096]
113    default: 64
114
115  reset-gpios:
116    maxItems: 1
117
118required:
119  - compatible
120  - reg
121
122additionalProperties: false
123
124examples:
125  - |
126    #include <dt-bindings/gpio/gpio.h>
127    i2c {
128        #address-cells = <1>;
129        #size-cells = <0>;
130        max98396: amplifier@39 {
131            compatible = "adi,max98396";
132            reg = <0x39>;
133            dvdd-supply = <&regulator_1v2>;
134            dvddio-supply = <&regulator_1v8>;
135            avdd-supply = <&regulator_1v8>;
136            pvdd-supply = <&regulator_pvdd>;
137            adi,vmon-slot-no = <0>;
138            adi,imon-slot-no = <1>;
139            reset-gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
140        };
141    };
142