Skip to content

Commit 3160e75

Browse files
committed
ASoC: wm8904: Add DMIC and DRC support
Merge series from Francesco Dolcini <francesco@dolcini.it>: This patch series adds DMIC and DRC support to the WM8904 driver, a new of_ helper is added to simplify the driver code. DRC functionality is added in the same patch series to provide the necessary dynamic range control to make DMIC support useful. The WM8904 supports digital microphones on two of its inputs: IN1L/DMICDAT1 and IN1R/DMICDAT2. These two inputs can either be connected to an ADC or to the DMIC system. There is an ADC for each line, and only one DMIC block. This DMIC block is either connected to DMICDAT1 or to DMICDAT2. One DMIC data line supports two digital microphones via time multiplexing. The pin's functionality is decided during hardware design (IN1L vs DMICDAT1 and IN1R vs DMICDAT2). This is reflected in the Device Tree. If one line is analog and one is DMIC, we need to be able to switch between ADC and DMIC at runtime. The DMIC source is known from the Device Tree. If both are DMIC inputs, we need to be able to switch the DMIC source. There is no need to switch between ADC and DMIC at runtime. Therefore, kcontrols are dynamically added by the driver depending on its Device Tree configuration. This is a heavy rework of a previous patch series provided by Alifer Moraes and Pierluigi Passaro, https://lore.kernel.org/lkml/20220307141041.27538-1-alifer.m@variscite.com.
2 parents 47c4f9b + b6612c8 commit 3160e75

File tree

503 files changed

+6375
-2701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

503 files changed

+6375
-2701
lines changed

.mailmap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ Antonio Quartulli <antonio@mandelbit.com> <antonio@open-mesh.com>
8888
Antonio Quartulli <antonio@mandelbit.com> <antonio.quartulli@open-mesh.com>
8989
Antonio Quartulli <antonio@mandelbit.com> <ordex@autistici.org>
9090
Antonio Quartulli <antonio@mandelbit.com> <ordex@ritirata.org>
91-
Antonio Quartulli <antonio@mandelbit.com> <antonio@openvpn.net>
9291
Antonio Quartulli <antonio@mandelbit.com> <a@unstable.cc>
9392
Anup Patel <anup@brainfault.org> <anup.patel@wdc.com>
9493
Archit Taneja <archit@ti.com>
@@ -282,6 +281,7 @@ Henrik Rydberg <rydberg@bitmath.org>
282281
Herbert Xu <herbert@gondor.apana.org.au>
283282
Huacai Chen <chenhuacai@kernel.org> <chenhc@lemote.com>
284283
Huacai Chen <chenhuacai@kernel.org> <chenhuacai@loongson.cn>
284+
Ike Panhc <ikepanhc@gmail.com> <ike.pan@canonical.com>
285285
J. Bruce Fields <bfields@fieldses.org> <bfields@redhat.com>
286286
J. Bruce Fields <bfields@fieldses.org> <bfields@citi.umich.edu>
287287
Jacob Shin <Jacob.Shin@amd.com>
@@ -692,6 +692,7 @@ Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> <subbaram@codeaurora.org>
692692
Subhash Jadavani <subhashj@codeaurora.org>
693693
Sudarshan Rajagopalan <quic_sudaraja@quicinc.com> <sudaraja@codeaurora.org>
694694
Sudeep Holla <sudeep.holla@arm.com> Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
695+
Sumit Garg <sumit.garg@kernel.org> <sumit.garg@linaro.org>
695696
Sumit Semwal <sumit.semwal@ti.com>
696697
Surabhi Vishnoi <quic_svishnoi@quicinc.com> <svishnoi@codeaurora.org>
697698
Sven Eckelmann <sven@narfation.org> <seckelmann@datto.com>

Documentation/admin-guide/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Configuring the kernel
176176
values without prompting.
177177

178178
"make defconfig" Create a ./.config file by using the default
179-
symbol values from either arch/$ARCH/defconfig
179+
symbol values from either arch/$ARCH/configs/defconfig
180180
or arch/$ARCH/configs/${PLATFORM}_defconfig,
181181
depending on the architecture.
182182

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,17 @@ pid>/``).
212212
This value defaults to 0.
213213
214214

215+
core_sort_vma
216+
=============
217+
218+
The default coredump writes VMAs in address order. By setting
219+
``core_sort_vma`` to 1, VMAs will be written from smallest size
220+
to largest size. This is known to break at least elfutils, but
221+
can be handy when dealing with very large (and truncated)
222+
coredumps where the more useful debugging details are included
223+
in the smaller VMAs.
224+
225+
215226
core_uses_pid
216227
=============
217228

Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ properties:
146146
maxItems: 2
147147

148148
pwm-names:
149+
minItems: 1
149150
items:
150151
- const: convst1
151152
- const: convst2

Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ properties:
1919
- imagis,ist3038
2020
- imagis,ist3038b
2121
- imagis,ist3038c
22+
- imagis,ist3038h
2223

2324
reg:
2425
maxItems: 1

Documentation/devicetree/bindings/sound/wlf,wm8904.yaml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,82 @@ properties:
3838
DCVDD-supply: true
3939
MICVDD-supply: true
4040

41+
wlf,in1l-as-dmicdat1:
42+
type: boolean
43+
description:
44+
Use IN1L/DMICDAT1 as DMICDAT1, enabling the DMIC input path.
45+
Can be used separately or together with wlf,in1r-as-dmicdat2.
46+
47+
wlf,in1r-as-dmicdat2:
48+
type: boolean
49+
description:
50+
Use IN1R/DMICDAT2 as DMICDAT2, enabling the DMIC input path.
51+
Can be used separately or together with wlf,in1l-as-dmicdat1.
52+
53+
wlf,gpio-cfg:
54+
$ref: /schemas/types.yaml#/definitions/uint32-array
55+
minItems: 4
56+
maxItems: 4
57+
description:
58+
Default register values for R121/122/123/124 (GPIO Control).
59+
If any entry has the value 0xFFFF, the related register won't be set.
60+
default: [0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF]
61+
62+
wlf,micbias-cfg:
63+
$ref: /schemas/types.yaml#/definitions/uint32-array
64+
minItems: 2
65+
maxItems: 2
66+
description:
67+
Default register values for R6/R7 (Mic Bias Control).
68+
default: [0, 0]
69+
70+
wlf,drc-cfg-names:
71+
$ref: /schemas/types.yaml#/definitions/string-array
72+
description:
73+
List of strings for the available DRC modes.
74+
If absent, DRC is disabled.
75+
76+
wlf,drc-cfg-regs:
77+
$ref: /schemas/types.yaml#/definitions/uint16-matrix
78+
description:
79+
Sets of default register values for R40/41/42/43 (DRC).
80+
Each set corresponds to a DRC mode, so the number of sets should equal
81+
the length of wlf,drc-cfg-names.
82+
If absent, DRC is disabled.
83+
items:
84+
minItems: 4
85+
maxItems: 4
86+
87+
wlf,retune-mobile-cfg-names:
88+
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
89+
description:
90+
List of strings for the available retune modes.
91+
If absent, retune is disabled.
92+
93+
wlf,retune-mobile-cfg-hz:
94+
description:
95+
The list must be the same length as wlf,retune-mobile-cfg-names.
96+
If absent, retune is disabled.
97+
98+
wlf,retune-mobile-cfg-regs:
99+
$ref: /schemas/types.yaml#/definitions/uint16-matrix
100+
description:
101+
Sets of default register values for R134/.../157 (EQ).
102+
Each set corresponds to a retune mode, so the number of sets should equal
103+
the length of wlf,retune-mobile-cfg-names.
104+
If absent, retune is disabled.
105+
items:
106+
minItems: 24
107+
maxItems: 24
108+
109+
dependencies:
110+
wlf,drc-cfg-names: [ 'wlf,drc-cfg-regs' ]
111+
wlf,drc-cfg-regs: [ 'wlf,drc-cfg-names' ]
112+
113+
wlf,retune-mobile-cfg-names: [ 'wlf,retune-mobile-cfg-hz', 'wlf,retune-mobile-cfg-regs' ]
114+
wlf,retune-mobile-cfg-regs: [ 'wlf,retune-mobile-cfg-names', 'wlf,retune-mobile-cfg-hz' ]
115+
wlf,retune-mobile-cfg-hz: [ 'wlf,retune-mobile-cfg-names', 'wlf,retune-mobile-cfg-regs' ]
116+
41117
required:
42118
- compatible
43119
- reg
@@ -70,5 +146,58 @@ examples:
70146
DBVDD-supply = <&reg_1p8v>;
71147
DCVDD-supply = <&reg_1p8v>;
72148
MICVDD-supply = <&reg_1p8v>;
149+
150+
wlf,drc-cfg-names = "default", "peaklimiter", "tradition", "soft",
151+
"music";
152+
/*
153+
* Config registers per name, respectively:
154+
* KNEE_IP = 0, KNEE_OP = 0, HI_COMP = 1, LO_COMP = 1
155+
* KNEE_IP = -24, KNEE_OP = -6, HI_COMP = 1/4, LO_COMP = 1
156+
* KNEE_IP = -42, KNEE_OP = -3, HI_COMP = 0, LO_COMP = 1
157+
* KNEE_IP = -45, KNEE_OP = -9, HI_COMP = 1/8, LO_COMP = 1
158+
* KNEE_IP = -30, KNEE_OP = -10.5, HI_COMP = 1/4, LO_COMP = 1
159+
*/
160+
wlf,drc-cfg-regs = /bits/ 16 <0x01af 0x3248 0x0000 0x0000>,
161+
/bits/ 16 <0x04af 0x324b 0x0010 0x0408>,
162+
/bits/ 16 <0x04af 0x324b 0x0028 0x0704>,
163+
/bits/ 16 <0x04af 0x324b 0x0018 0x078c>,
164+
/bits/ 16 <0x04af 0x324b 0x0010 0x050e>;
165+
166+
/* GPIO1 = DMIC_CLK, don't touch others */
167+
wlf,gpio-cfg = <0x0018>, <0xffff>, <0xffff>, <0xffff>;
168+
169+
/* Use IN1R as DMICDAT2, leave IN1L as an analog input path */
170+
wlf,in1r-as-dmicdat2;
171+
172+
wlf,retune-mobile-cfg-names = "bassboost", "bassboost", "treble";
173+
wlf,retune-mobile-cfg-hz = <48000>, <44100>, <48000>;
174+
/*
175+
* Config registers per name, respectively:
176+
* EQ_ENA, 100 Hz, 300 Hz, 875 Hz, 2400 Hz, 6900 Hz
177+
* 1, +6 dB, +3 dB, 0 dB, 0 dB, 0 dB
178+
* 1, +6 dB, +3 dB, 0 dB, 0 dB, 0 dB
179+
* 1, -2 dB, -2 dB, 0 dB, 0 dB, +3 dB
180+
* Each one uses the defaults for ReTune Mobile registers 140-157
181+
*/
182+
wlf,retune-mobile-cfg-regs = /bits/ 16 <0x1 0x12 0xf 0xc 0xc 0xc
183+
0x0fca 0x0400 0x00d8 0x1eb5
184+
0xf145 0x0bd5 0x0075 0x1c58
185+
0xf3d3 0x0a54 0x0568 0x168e
186+
0xf829 0x07ad 0x1103 0x0564
187+
0x0559 0x4000>,
188+
189+
/bits/ 16 <0x1 0x12 0xf 0xc 0xc 0xc
190+
0x0fca 0x0400 0x00d8 0x1eb5
191+
0xf145 0x0bd5 0x0075 0x1c58
192+
0xf3d3 0x0a54 0x0568 0x168e
193+
0xf829 0x07ad 0x1103 0x0564
194+
0x0559 0x4000>,
195+
196+
/bits/ 16 <0x1 0xa 0xa 0xc 0xc 0xf
197+
0x0fca 0x0400 0x00d8 0x1eb5
198+
0xf145 0x0bd5 0x0075 0x1c58
199+
0xf3d3 0x0a54 0x0568 0x168e
200+
0xf829 0x07ad 0x1103 0x0564
201+
0x0559 0x4000>;
73202
};
74203
};

Documentation/filesystems/idmappings.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ what id ``k11000`` corresponds to in the second or third idmapping. The
6363
straightforward algorithm to use is to apply the inverse of the first idmapping,
6464
mapping ``k11000`` up to ``u1000``. Afterwards, we can map ``u1000`` down using
6565
either the second idmapping mapping or third idmapping mapping. The second
66-
idmapping would map ``u1000`` down to ``21000``. The third idmapping would map
67-
``u1000`` down to ``u31000``.
66+
idmapping would map ``u1000`` down to ``k21000``. The third idmapping would map
67+
``u1000`` down to ``k31000``.
6868

6969
If we were given the same task for the following three idmappings::
7070

Documentation/rust/quick-start.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Rust standard library source
145145
****************************
146146

147147
The Rust standard library source is required because the build system will
148-
cross-compile ``core`` and ``alloc``.
148+
cross-compile ``core``.
149149

150150
If ``rustup`` is being used, run::
151151

Documentation/rust/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ operator are also supported as usual, e.g.:
9797
9898
/// ```
9999
/// # use kernel::{spawn_work_item, workqueue};
100-
/// spawn_work_item!(workqueue::system(), || pr_info!("x"))?;
100+
/// spawn_work_item!(workqueue::system(), || pr_info!("x\n"))?;
101101
/// # Ok::<(), Error>(())
102102
/// ```
103103

Documentation/scheduler/sched-rt-group.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ The system wide settings are configured under the /proc virtual file system:
102102
* sched_rt_period_us takes values from 1 to INT_MAX.
103103
* sched_rt_runtime_us takes values from -1 to sched_rt_period_us.
104104
* A run time of -1 specifies runtime == period, ie. no limit.
105+
* sched_rt_runtime_us/sched_rt_period_us > 0.05 inorder to preserve
106+
bandwidth for fair dl_server. For accurate value check average of
107+
runtime/period in /sys/kernel/debug/sched/fair_server/cpuX/
105108

106109

107110
2.2 Default behaviour

0 commit comments

Comments
 (0)