Skip to contentSkip to conversation

ASoC: codecs: add support for ES8326

PATCH New Zhu Ning 1 participant 2 messages Jul 14, 2022

Subsystems (3)
lore
Share & tools
lore

Zhu Ning

author
#0 lore raw

PATCH 1/2 ASoC: codecs: add support for ES8326

The ES8326 codec is not compatible with ES8316 and requires a dedicated driver.

---
 sound/soc/codecs/Kconfig  |   5 +
 sound/soc/codecs/Makefile |   2 +
 sound/soc/codecs/es8326.c | 759 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/es8326.h | 187 ++++++++++
 4 files changed, 953 insertions(+)
 mode change 100644 => 100755 sound/soc/codecs/Kconfig
 mode change 100644 => 100755 sound/soc/codecs/Makefile
 create mode 100755 sound/soc/codecs/es8326.c
 create mode 100755 sound/soc/codecs/es8326.h
sound/soc/codecs/Kconfig +5 -0
old mode 100644
new mode 100755
index 6165db92a629..b0a15cce416d
@@ -98,6 +98,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_DA9055
 	imply SND_SOC_DMIC
 	imply SND_SOC_ES8316
+	imply SND_SOC_ES8326
 	imply SND_SOC_ES8328_SPI
 	imply SND_SOC_ES8328_I2C
 	imply SND_SOC_ES7134
@@ -911,6 +912,10 @@ config SND_SOC_ES8316
 	tristate "Everest Semi ES8316 CODEC"
 	depends on I2C
 
+config SND_SOC_ES8326
+	tristate "Everest Semi ES8326 CODEC"
+	depends on I2C
+
 config SND_SOC_ES8328
 	tristate
 
sound/soc/codecs/Makefile +2 -0
old mode 100644
new mode 100755
index 28dc4edfd01f..ae9d789b5381
@@ -100,6 +100,7 @@ snd-soc-dmic-objs := dmic.o
 snd-soc-es7134-objs := es7134.o
 snd-soc-es7241-objs := es7241.o
 snd-soc-es8316-objs := es8316.o
+snd-soc-es8326-objs := es8326.o
 snd-soc-es8328-objs := es8328.o
 snd-soc-es8328-i2c-objs := es8328-i2c.o
 snd-soc-es8328-spi-objs := es8328-spi.o
@@ -452,6 +453,7 @@ obj-$(CONFIG_SND_SOC_DMIC)	+= snd-soc-dmic.o
 obj-$(CONFIG_SND_SOC_ES7134)	+= snd-soc-es7134.o
 obj-$(CONFIG_SND_SOC_ES7241)	+= snd-soc-es7241.o
 obj-$(CONFIG_SND_SOC_ES8316)    += snd-soc-es8316.o
+obj-$(CONFIG_SND_SOC_ES8326)    += snd-soc-es8326.o
 obj-$(CONFIG_SND_SOC_ES8328)	+= snd-soc-es8328.o
 obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o
 obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o
sound/soc/codecs/es8326.c new file +759 -0

759 lines not on this page · raw message

sound/soc/codecs/es8326.h new file +187 -0

187 lines not on this page · raw message

Signature · 1 line
2.36.1
author
#1 lore raw

PATCH 2/2 dt-bindings: sound: es8326: Add dtbindings documentation

Add device tree binding documentation for Everest ES8326

---
 .../bindings/sound/everest,es8326.yaml        | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100755 Documentation/devicetree/bindings/sound/everest,es8326.yaml
Documentation/devicetree/bindings/sound/everest,es8326.yaml new file +84 -0
new file mode 100755
index 000000000000..f6aa3c03d456
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/everest,es8326.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Everest ES8326 audio CODEC
+
+maintainers:
+  - David Yang <[email protected]>
+
+properties:
+  compatible:
+    const: everest,es8326
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: clock for master clock (MCLK)
+
+  clock-names:
+    items:
+      - const: mclk
+
+  "#sound-dai-cells":
+    const: 0
+
+  everest,jack-pol:
+    description:
+      just the value of reg 57. Bit(3) decides whether the jack polarity is inverted.
+      Bit(2) decides whether the bottom on the headset is inverted.
+      Bit(1)/(0) decides the mic properity to be OMTP/CTIA or auto.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    minimum: 0
+    maximum: 0x0f
+    default: 0x0f
+  
+  everest,mic1-src:
+    description:
+      the value of reg 2A when headset plugged.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    minimum: 0x00
+    maximum: 0x77
+    default: 0x22
+
+  everest,mic2-src:
+    description:
+      the value of reg 2A when headset unplugged.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    minimum: 0x00
+    maximum: 0x77
+    default: 0x44
+
+  everest,jack-detect-inverted:
+    description:
+      Defined to invert the jack detection.
+    $ref: /schemas/types.yaml#/definitions/flag
+
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c0 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      es8326: codec@19 {
+        compatible = "everest,es8326";
+        reg = <0x19>;
+        clocks = <&clks 10>;
+        clock-names = "mclk";
+        #sound-dai-cells = <0>;
+        everest,mic1-src = [22];
+        everest,mic2-src = [44];
+        everest,jack-pol = [0e];
+      };
+    };
Signature · 1 line
2.36.1