Skip to content

Commit aab1ad1

Browse files
LeeWeiTse-sevenbroonie
authored andcommitted
ASoC: nau8821: new driver
The driver is for codec NAU88L21 of Nuvoton Technology Corporation. The NAU88L21 is an ultra-low power high performance audio codec that supports both analog and digital audio functions. Signed-off-by: Seven Lee <wtli@nuvoton.com> Link: https://lore.kernel.org/r/20211001103108.3297848-1-wtli@nuvoton.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 27547a3 commit aab1ad1

File tree

5 files changed

+2307
-0
lines changed

5 files changed

+2307
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Nuvoton NAU88L21 audio codec
2+
3+
This device supports I2C only.
4+
5+
Required properties:
6+
- compatible : Must be "nuvoton,nau8821"
7+
8+
- reg : the I2C address of the device. This is either 0x1B (CSB=0) or 0x54 (CSB=1).
9+
10+
Optional properties:
11+
- nuvoton,jkdet-enable: Enable jack detection via JKDET pin.
12+
- nuvoton,jkdet-pull-enable: Enable JKDET pin pull. If set - pin pull enabled,
13+
otherwise pin in high impedance state.
14+
- nuvoton,jkdet-pull-up: Pull-up JKDET pin. If set then JKDET pin is pull up, otherwise pull down.
15+
- nuvoton,jkdet-polarity: JKDET pin polarity. 0 - active high, 1 - active low.
16+
17+
- nuvoton,vref-impedance: VREF Impedance selection
18+
0 - Open
19+
1 - 25 kOhm
20+
2 - 125 kOhm
21+
3 - 2.5 kOhm
22+
23+
- nuvoton,micbias-voltage: Micbias voltage level.
24+
0 - VDDA
25+
1 - VDDA
26+
2 - VDDA * 1.1
27+
3 - VDDA * 1.2
28+
4 - VDDA * 1.3
29+
5 - VDDA * 1.4
30+
6 - VDDA * 1.53
31+
7 - VDDA * 1.53
32+
33+
- nuvoton,jack-insert-debounce: number from 0 to 7 that sets debounce time to 2^(n+2) ms
34+
- nuvoton,jack-eject-debounce: number from 0 to 7 that sets debounce time to 2^(n+2) ms
35+
36+
- nuvoton,dmic-clk-threshold: the ADC threshold of DMIC clock.
37+
38+
39+
Example:
40+
41+
headset: nau8821@1b {
42+
compatible = "nuvoton,nau8821";
43+
reg = <0x1b>;
44+
interrupt-parent = <&gpio>;
45+
interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
46+
nuvoton,jkdet-enable;
47+
nuvoton,jkdet-pull-enable;
48+
nuvoton,jkdet-pull-up;
49+
nuvoton,jkdet-polarity = <GPIO_ACTIVE_LOW>;
50+
nuvoton,vref-impedance = <2>;
51+
nuvoton,micbias-voltage = <6>;
52+
nuvoton,jack-insert-debounce = <7>;
53+
nuvoton,jack-eject-debounce = <7>;
54+
nuvoton,dmic-clk-threshold = 3072000;
55+
};

sound/soc/codecs/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ config SND_SOC_ALL_CODECS
138138
imply SND_SOC_NAU8315
139139
imply SND_SOC_NAU8540
140140
imply SND_SOC_NAU8810
141+
imply SND_SOC_NAU8821
141142
imply SND_SOC_NAU8822
142143
imply SND_SOC_NAU8824
143144
imply SND_SOC_NAU8825
@@ -1922,6 +1923,10 @@ config SND_SOC_NAU8810
19221923
tristate "Nuvoton Technology Corporation NAU88C10 CODEC"
19231924
depends on I2C
19241925

1926+
config SND_SOC_NAU8821
1927+
tristate "Nuvoton Technology Corporation NAU88L21 CODEC"
1928+
depends on I2C
1929+
19251930
config SND_SOC_NAU8822
19261931
tristate "Nuvoton Technology Corporation NAU88C22 CODEC"
19271932
depends on I2C

sound/soc/codecs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ snd-soc-mt6660-objs := mt6660.o
143143
snd-soc-nau8315-objs := nau8315.o
144144
snd-soc-nau8540-objs := nau8540.o
145145
snd-soc-nau8810-objs := nau8810.o
146+
snd-soc-nau8821-objs := nau8821.o
146147
snd-soc-nau8822-objs := nau8822.o
147148
snd-soc-nau8824-objs := nau8824.o
148149
snd-soc-nau8825-objs := nau8825.o
@@ -473,6 +474,7 @@ obj-$(CONFIG_SND_SOC_MT6660) += snd-soc-mt6660.o
473474
obj-$(CONFIG_SND_SOC_NAU8315) += snd-soc-nau8315.o
474475
obj-$(CONFIG_SND_SOC_NAU8540) += snd-soc-nau8540.o
475476
obj-$(CONFIG_SND_SOC_NAU8810) += snd-soc-nau8810.o
477+
obj-$(CONFIG_SND_SOC_NAU8821) += snd-soc-nau8821.o
476478
obj-$(CONFIG_SND_SOC_NAU8822) += snd-soc-nau8822.o
477479
obj-$(CONFIG_SND_SOC_NAU8824) += snd-soc-nau8824.o
478480
obj-$(CONFIG_SND_SOC_NAU8825) += snd-soc-nau8825.o

0 commit comments

Comments
 (0)