1aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2aa1a8ff2SEmmanuel Vadot%YAML 1.2 3aa1a8ff2SEmmanuel Vadot--- 4aa1a8ff2SEmmanuel Vadot$id: http://devicetree.org/schemas/sound/wlf,wm8904.yaml# 5aa1a8ff2SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6aa1a8ff2SEmmanuel Vadot 7aa1a8ff2SEmmanuel Vadottitle: Wolfson WM8904/WM8912 audio codecs 8aa1a8ff2SEmmanuel Vadot 9aa1a8ff2SEmmanuel Vadotmaintainers: 10aa1a8ff2SEmmanuel Vadot - patches@opensource.cirrus.com 11aa1a8ff2SEmmanuel Vadot 12aa1a8ff2SEmmanuel Vadotdescription: | 13aa1a8ff2SEmmanuel Vadot Pins on the device (for linking into audio routes): 14aa1a8ff2SEmmanuel Vadot IN1L, IN1R, IN2L, IN2R, IN3L, IN3R, HPOUTL, HPOUTR, LINEOUTL, LINEOUTR, 15aa1a8ff2SEmmanuel Vadot MICBIAS 16aa1a8ff2SEmmanuel Vadot 17aa1a8ff2SEmmanuel Vadotproperties: 18aa1a8ff2SEmmanuel Vadot compatible: 19aa1a8ff2SEmmanuel Vadot enum: 20aa1a8ff2SEmmanuel Vadot - wlf,wm8904 21aa1a8ff2SEmmanuel Vadot - wlf,wm8912 22aa1a8ff2SEmmanuel Vadot 23aa1a8ff2SEmmanuel Vadot reg: 24aa1a8ff2SEmmanuel Vadot maxItems: 1 25aa1a8ff2SEmmanuel Vadot 26aa1a8ff2SEmmanuel Vadot "#sound-dai-cells": 27aa1a8ff2SEmmanuel Vadot const: 0 28aa1a8ff2SEmmanuel Vadot 29aa1a8ff2SEmmanuel Vadot clocks: 30aa1a8ff2SEmmanuel Vadot maxItems: 1 31aa1a8ff2SEmmanuel Vadot 32aa1a8ff2SEmmanuel Vadot clock-names: 33aa1a8ff2SEmmanuel Vadot const: mclk 34aa1a8ff2SEmmanuel Vadot 35aa1a8ff2SEmmanuel Vadot AVDD-supply: true 36aa1a8ff2SEmmanuel Vadot CPVDD-supply: true 37aa1a8ff2SEmmanuel Vadot DBVDD-supply: true 38aa1a8ff2SEmmanuel Vadot DCVDD-supply: true 39aa1a8ff2SEmmanuel Vadot MICVDD-supply: true 40aa1a8ff2SEmmanuel Vadot 41*8ccc0d23SEmmanuel Vadot wlf,in1l-as-dmicdat1: 42*8ccc0d23SEmmanuel Vadot type: boolean 43*8ccc0d23SEmmanuel Vadot description: 44*8ccc0d23SEmmanuel Vadot Use IN1L/DMICDAT1 as DMICDAT1, enabling the DMIC input path. 45*8ccc0d23SEmmanuel Vadot Can be used separately or together with wlf,in1r-as-dmicdat2. 46*8ccc0d23SEmmanuel Vadot 47*8ccc0d23SEmmanuel Vadot wlf,in1r-as-dmicdat2: 48*8ccc0d23SEmmanuel Vadot type: boolean 49*8ccc0d23SEmmanuel Vadot description: 50*8ccc0d23SEmmanuel Vadot Use IN1R/DMICDAT2 as DMICDAT2, enabling the DMIC input path. 51*8ccc0d23SEmmanuel Vadot Can be used separately or together with wlf,in1l-as-dmicdat1. 52*8ccc0d23SEmmanuel Vadot 53*8ccc0d23SEmmanuel Vadot wlf,gpio-cfg: 54*8ccc0d23SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32-array 55*8ccc0d23SEmmanuel Vadot minItems: 4 56*8ccc0d23SEmmanuel Vadot maxItems: 4 57*8ccc0d23SEmmanuel Vadot description: 58*8ccc0d23SEmmanuel Vadot Default register values for R121/122/123/124 (GPIO Control). 59*8ccc0d23SEmmanuel Vadot If any entry has the value 0xFFFF, the related register won't be set. 60*8ccc0d23SEmmanuel Vadot default: [0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF] 61*8ccc0d23SEmmanuel Vadot 62*8ccc0d23SEmmanuel Vadot wlf,micbias-cfg: 63*8ccc0d23SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32-array 64*8ccc0d23SEmmanuel Vadot minItems: 2 65*8ccc0d23SEmmanuel Vadot maxItems: 2 66*8ccc0d23SEmmanuel Vadot description: 67*8ccc0d23SEmmanuel Vadot Default register values for R6/R7 (Mic Bias Control). 68*8ccc0d23SEmmanuel Vadot default: [0, 0] 69*8ccc0d23SEmmanuel Vadot 70*8ccc0d23SEmmanuel Vadot wlf,drc-cfg-names: 71*8ccc0d23SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/string-array 72*8ccc0d23SEmmanuel Vadot description: 73*8ccc0d23SEmmanuel Vadot List of strings for the available DRC modes. 74*8ccc0d23SEmmanuel Vadot If absent, DRC is disabled. 75*8ccc0d23SEmmanuel Vadot 76*8ccc0d23SEmmanuel Vadot wlf,drc-cfg-regs: 77*8ccc0d23SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint16-matrix 78*8ccc0d23SEmmanuel Vadot description: 79*8ccc0d23SEmmanuel Vadot Sets of default register values for R40/41/42/43 (DRC). 80*8ccc0d23SEmmanuel Vadot Each set corresponds to a DRC mode, so the number of sets should equal 81*8ccc0d23SEmmanuel Vadot the length of wlf,drc-cfg-names. 82*8ccc0d23SEmmanuel Vadot If absent, DRC is disabled. 83*8ccc0d23SEmmanuel Vadot items: 84*8ccc0d23SEmmanuel Vadot minItems: 4 85*8ccc0d23SEmmanuel Vadot maxItems: 4 86*8ccc0d23SEmmanuel Vadot 87*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-names: 88*8ccc0d23SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/non-unique-string-array 89*8ccc0d23SEmmanuel Vadot description: 90*8ccc0d23SEmmanuel Vadot List of strings for the available retune modes. 91*8ccc0d23SEmmanuel Vadot If absent, retune is disabled. 92*8ccc0d23SEmmanuel Vadot 93*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-hz: 94*8ccc0d23SEmmanuel Vadot description: 95*8ccc0d23SEmmanuel Vadot The list must be the same length as wlf,retune-mobile-cfg-names. 96*8ccc0d23SEmmanuel Vadot If absent, retune is disabled. 97*8ccc0d23SEmmanuel Vadot 98*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-regs: 99*8ccc0d23SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint16-matrix 100*8ccc0d23SEmmanuel Vadot description: 101*8ccc0d23SEmmanuel Vadot Sets of default register values for R134/.../157 (EQ). 102*8ccc0d23SEmmanuel Vadot Each set corresponds to a retune mode, so the number of sets should equal 103*8ccc0d23SEmmanuel Vadot the length of wlf,retune-mobile-cfg-names. 104*8ccc0d23SEmmanuel Vadot If absent, retune is disabled. 105*8ccc0d23SEmmanuel Vadot items: 106*8ccc0d23SEmmanuel Vadot minItems: 24 107*8ccc0d23SEmmanuel Vadot maxItems: 24 108*8ccc0d23SEmmanuel Vadot 109*8ccc0d23SEmmanuel Vadotdependencies: 110*8ccc0d23SEmmanuel Vadot wlf,drc-cfg-names: [ 'wlf,drc-cfg-regs' ] 111*8ccc0d23SEmmanuel Vadot wlf,drc-cfg-regs: [ 'wlf,drc-cfg-names' ] 112*8ccc0d23SEmmanuel Vadot 113*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-names: [ 'wlf,retune-mobile-cfg-hz', 'wlf,retune-mobile-cfg-regs' ] 114*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-regs: [ 'wlf,retune-mobile-cfg-names', 'wlf,retune-mobile-cfg-hz' ] 115*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-hz: [ 'wlf,retune-mobile-cfg-names', 'wlf,retune-mobile-cfg-regs' ] 116*8ccc0d23SEmmanuel Vadot 117aa1a8ff2SEmmanuel Vadotrequired: 118aa1a8ff2SEmmanuel Vadot - compatible 119aa1a8ff2SEmmanuel Vadot - reg 120aa1a8ff2SEmmanuel Vadot - clocks 121aa1a8ff2SEmmanuel Vadot - clock-names 122aa1a8ff2SEmmanuel Vadot - AVDD-supply 123aa1a8ff2SEmmanuel Vadot - CPVDD-supply 124aa1a8ff2SEmmanuel Vadot - DBVDD-supply 125aa1a8ff2SEmmanuel Vadot - DCVDD-supply 126aa1a8ff2SEmmanuel Vadot - MICVDD-supply 127aa1a8ff2SEmmanuel Vadot 128aa1a8ff2SEmmanuel VadotallOf: 129aa1a8ff2SEmmanuel Vadot - $ref: dai-common.yaml# 130aa1a8ff2SEmmanuel Vadot 131aa1a8ff2SEmmanuel VadotunevaluatedProperties: false 132aa1a8ff2SEmmanuel Vadot 133aa1a8ff2SEmmanuel Vadotexamples: 134aa1a8ff2SEmmanuel Vadot - | 135aa1a8ff2SEmmanuel Vadot i2c { 136aa1a8ff2SEmmanuel Vadot #address-cells = <1>; 137aa1a8ff2SEmmanuel Vadot #size-cells = <0>; 138aa1a8ff2SEmmanuel Vadot 139aa1a8ff2SEmmanuel Vadot codec@1a { 140aa1a8ff2SEmmanuel Vadot compatible = "wlf,wm8904"; 141aa1a8ff2SEmmanuel Vadot reg = <0x1a>; 142aa1a8ff2SEmmanuel Vadot clocks = <&pck0>; 143aa1a8ff2SEmmanuel Vadot clock-names = "mclk"; 144aa1a8ff2SEmmanuel Vadot AVDD-supply = <®_1p8v>; 145aa1a8ff2SEmmanuel Vadot CPVDD-supply = <®_1p8v>; 146aa1a8ff2SEmmanuel Vadot DBVDD-supply = <®_1p8v>; 147aa1a8ff2SEmmanuel Vadot DCVDD-supply = <®_1p8v>; 148aa1a8ff2SEmmanuel Vadot MICVDD-supply = <®_1p8v>; 149*8ccc0d23SEmmanuel Vadot 150*8ccc0d23SEmmanuel Vadot wlf,drc-cfg-names = "default", "peaklimiter", "tradition", "soft", 151*8ccc0d23SEmmanuel Vadot "music"; 152*8ccc0d23SEmmanuel Vadot /* 153*8ccc0d23SEmmanuel Vadot * Config registers per name, respectively: 154*8ccc0d23SEmmanuel Vadot * KNEE_IP = 0, KNEE_OP = 0, HI_COMP = 1, LO_COMP = 1 155*8ccc0d23SEmmanuel Vadot * KNEE_IP = -24, KNEE_OP = -6, HI_COMP = 1/4, LO_COMP = 1 156*8ccc0d23SEmmanuel Vadot * KNEE_IP = -42, KNEE_OP = -3, HI_COMP = 0, LO_COMP = 1 157*8ccc0d23SEmmanuel Vadot * KNEE_IP = -45, KNEE_OP = -9, HI_COMP = 1/8, LO_COMP = 1 158*8ccc0d23SEmmanuel Vadot * KNEE_IP = -30, KNEE_OP = -10.5, HI_COMP = 1/4, LO_COMP = 1 159*8ccc0d23SEmmanuel Vadot */ 160*8ccc0d23SEmmanuel Vadot wlf,drc-cfg-regs = /bits/ 16 <0x01af 0x3248 0x0000 0x0000>, 161*8ccc0d23SEmmanuel Vadot /bits/ 16 <0x04af 0x324b 0x0010 0x0408>, 162*8ccc0d23SEmmanuel Vadot /bits/ 16 <0x04af 0x324b 0x0028 0x0704>, 163*8ccc0d23SEmmanuel Vadot /bits/ 16 <0x04af 0x324b 0x0018 0x078c>, 164*8ccc0d23SEmmanuel Vadot /bits/ 16 <0x04af 0x324b 0x0010 0x050e>; 165*8ccc0d23SEmmanuel Vadot 166*8ccc0d23SEmmanuel Vadot /* GPIO1 = DMIC_CLK, don't touch others */ 167*8ccc0d23SEmmanuel Vadot wlf,gpio-cfg = <0x0018>, <0xffff>, <0xffff>, <0xffff>; 168*8ccc0d23SEmmanuel Vadot 169*8ccc0d23SEmmanuel Vadot /* Use IN1R as DMICDAT2, leave IN1L as an analog input path */ 170*8ccc0d23SEmmanuel Vadot wlf,in1r-as-dmicdat2; 171*8ccc0d23SEmmanuel Vadot 172*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-names = "bassboost", "bassboost", "treble"; 173*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-hz = <48000>, <44100>, <48000>; 174*8ccc0d23SEmmanuel Vadot /* 175*8ccc0d23SEmmanuel Vadot * Config registers per name, respectively: 176*8ccc0d23SEmmanuel Vadot * EQ_ENA, 100 Hz, 300 Hz, 875 Hz, 2400 Hz, 6900 Hz 177*8ccc0d23SEmmanuel Vadot * 1, +6 dB, +3 dB, 0 dB, 0 dB, 0 dB 178*8ccc0d23SEmmanuel Vadot * 1, +6 dB, +3 dB, 0 dB, 0 dB, 0 dB 179*8ccc0d23SEmmanuel Vadot * 1, -2 dB, -2 dB, 0 dB, 0 dB, +3 dB 180*8ccc0d23SEmmanuel Vadot * Each one uses the defaults for ReTune Mobile registers 140-157 181*8ccc0d23SEmmanuel Vadot */ 182*8ccc0d23SEmmanuel Vadot wlf,retune-mobile-cfg-regs = /bits/ 16 <0x1 0x12 0xf 0xc 0xc 0xc 183*8ccc0d23SEmmanuel Vadot 0x0fca 0x0400 0x00d8 0x1eb5 184*8ccc0d23SEmmanuel Vadot 0xf145 0x0bd5 0x0075 0x1c58 185*8ccc0d23SEmmanuel Vadot 0xf3d3 0x0a54 0x0568 0x168e 186*8ccc0d23SEmmanuel Vadot 0xf829 0x07ad 0x1103 0x0564 187*8ccc0d23SEmmanuel Vadot 0x0559 0x4000>, 188*8ccc0d23SEmmanuel Vadot 189*8ccc0d23SEmmanuel Vadot /bits/ 16 <0x1 0x12 0xf 0xc 0xc 0xc 190*8ccc0d23SEmmanuel Vadot 0x0fca 0x0400 0x00d8 0x1eb5 191*8ccc0d23SEmmanuel Vadot 0xf145 0x0bd5 0x0075 0x1c58 192*8ccc0d23SEmmanuel Vadot 0xf3d3 0x0a54 0x0568 0x168e 193*8ccc0d23SEmmanuel Vadot 0xf829 0x07ad 0x1103 0x0564 194*8ccc0d23SEmmanuel Vadot 0x0559 0x4000>, 195*8ccc0d23SEmmanuel Vadot 196*8ccc0d23SEmmanuel Vadot /bits/ 16 <0x1 0xa 0xa 0xc 0xc 0xf 197*8ccc0d23SEmmanuel Vadot 0x0fca 0x0400 0x00d8 0x1eb5 198*8ccc0d23SEmmanuel Vadot 0xf145 0x0bd5 0x0075 0x1c58 199*8ccc0d23SEmmanuel Vadot 0xf3d3 0x0a54 0x0568 0x168e 200*8ccc0d23SEmmanuel Vadot 0xf829 0x07ad 0x1103 0x0564 201*8ccc0d23SEmmanuel Vadot 0x0559 0x4000>; 202aa1a8ff2SEmmanuel Vadot }; 203aa1a8ff2SEmmanuel Vadot }; 204