Skip to contentSkip to conversation

dt-bindings: sound: adau1372: Add bindings documentation

PATCH Superseded Alexandre Belloni 4 participants 5 messages Nov 4, 2020 – Nov 30, 2020

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: sound: adau1372: Add bindings documentation

Add device tree binding documentation for Analog Devices ADAU1372.

---
Cc: Rob Herring <[email protected]>

 .../bindings/sound/adi,adau1372.yaml          | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/adi,adau1372.yaml
Documentation/devicetree/bindings/sound/adi,adau1372.yaml new file +67 -0
new file mode 100644
index 000000000000..701449311fec
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/adi,adau1372.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+
+title: Analog Devices ADAU1372 CODEC
+
+maintainers:
+  - Alexandre Belloni <[email protected]>
+
+description: |
+  Analog Devices ADAU1372 four inputs and two outputs codec.
+  https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1372.pdf
+
+properties:
+  compatible:
+    enum:
+      - adi,adau1372
+
+  reg:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 0
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: "mclk"
+
+  powerdown-gpios:
+    description: GPIO used for hardware power-down.
+    maxItems: 1
+
+required:
+  - "#sound-dai-cells"
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        audio-codec@3c {
+                compatible = "adi,adau1372";
+                reg = <0x3c>;
+                #sound-dai-cells = <0>;
+                clock-names = "mclk";
+                clocks = <&adau1372z_xtal>;
+        };
+    };
+
+    adau1372z_xtal: clock {
+        compatible = "fixed-clock";
+        #clock-cells = <0>;
+        clock-frequency = <12288000>;
+    };
+...
+
Signature · 1 line
2.28.0
#1 lore raw

PATCH 2/2 ASoC: Add ADAU1372 audio CODEC support

From: Lars-Peter Clausen <[email protected]>

Add support for the Analog Devices ADAU1372 audio CODEC.

[Alexandre Belloni: allow 32kHz for TDM4 in slave mode, checkpatch fixes]
---
 sound/soc/codecs/Kconfig        |   16 +
 sound/soc/codecs/Makefile       |    6 +
 sound/soc/codecs/adau1372-i2c.c |   40 ++
 sound/soc/codecs/adau1372-spi.c |   58 ++
 sound/soc/codecs/adau1372.c     | 1062 +++++++++++++++++++++++++++++++
 sound/soc/codecs/adau1372.h     |   21 +
 6 files changed, 1203 insertions(+)
 create mode 100644 sound/soc/codecs/adau1372-i2c.c
 create mode 100644 sound/soc/codecs/adau1372-spi.c
 create mode 100644 sound/soc/codecs/adau1372.c
 create mode 100644 sound/soc/codecs/adau1372.h
sound/soc/codecs/Kconfig +16 -0
index 34c6dd04b85a..a457300f95da 100644
@@ -23,6 +23,8 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_AD193X_I2C
 	imply SND_SOC_AD1980
 	imply SND_SOC_AD73311
+	imply SND_SOC_ADAU1372_I2C
+	imply SND_SOC_ADAU1372_SPI
 	imply SND_SOC_ADAU1373
 	imply SND_SOC_ADAU1761_I2C
 	imply SND_SOC_ADAU1761_SPI
@@ -363,6 +365,20 @@ config SND_SOC_AD73311
 config SND_SOC_ADAU_UTILS
 	tristate
 
+config SND_SOC_ADAU1372
+	tristate
+	select SND_SOC_ADAU_UTILS
+
+config SND_SOC_ADAU1372_I2C
+	tristate "Analog Devices ADAU1372 CODEC (I2C)"
+	select SND_SOC_ADAU1372
+	select REGMAP_I2C
+
+config SND_SOC_ADAU1372_SPI
+	tristate "Analog Devices ADAU1372 CODEC (SPI)"
+	select SND_SOC_ADAU1372
+	select REGMAP_SPI
+
 config SND_SOC_ADAU1373
 	tristate
 	depends on I2C
sound/soc/codecs/Makefile +6 -0
index 11ce98c25d6c..b31f55c0d741 100644
@@ -9,6 +9,9 @@ snd-soc-ad193x-i2c-objs := ad193x-i2c.o
 snd-soc-ad1980-objs := ad1980.o
 snd-soc-ad73311-objs := ad73311.o
 snd-soc-adau-utils-objs := adau-utils.o
+snd-soc-adau1372-objs := adau1372.o
+snd-soc-adau1372-i2c-objs := adau1372-i2c.o
+snd-soc-adau1372-spi-objs := adau1372-spi.o
 snd-soc-adau1373-objs := adau1373.o
 snd-soc-adau1701-objs := adau1701.o
 snd-soc-adau17x1-objs := adau17x1.o
@@ -316,6 +319,9 @@ obj-$(CONFIG_SND_SOC_AD193X_I2C)	+= snd-soc-ad193x-i2c.o
 obj-$(CONFIG_SND_SOC_AD1980)	+= snd-soc-ad1980.o
 obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o
 obj-$(CONFIG_SND_SOC_ADAU_UTILS)	+= snd-soc-adau-utils.o
+obj-$(CONFIG_SND_SOC_ADAU1372)	+= snd-soc-adau1372.o
+obj-$(CONFIG_SND_SOC_ADAU1372_I2C)	+= snd-soc-adau1372-i2c.o
+obj-$(CONFIG_SND_SOC_ADAU1372_SPI)	+= snd-soc-adau1372-spi.o
 obj-$(CONFIG_SND_SOC_ADAU1373)	+= snd-soc-adau1373.o
 obj-$(CONFIG_SND_SOC_ADAU1701)		+= snd-soc-adau1701.o
 obj-$(CONFIG_SND_SOC_ADAU17X1)		+= snd-soc-adau17x1.o
sound/soc/codecs/adau1372-i2c.c new file +40 -0
new file mode 100644
index 000000000000..fc87a76ff1ee
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Driver for ADAU1372 codec
+ *
+ * Copyright 2016 Analog Devices Inc.
+ *  Author: Lars-Peter Clausen <[email protected]>
+ */
+
+#include <linux/i2c.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/regmap.h>
+#include <sound/soc.h>
+
+#include "adau1372.h"
+
+static int adau1372_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
+{
+	return adau1372_probe(&client->dev,
+		devm_regmap_init_i2c(client, &adau1372_regmap_config), NULL);
+}
+
+static const struct i2c_device_id adau1372_i2c_ids[] = {
+	{ "adau1372", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, adau1372_i2c_ids);
+
+static struct i2c_driver adau1372_i2c_driver = {
+	.driver = {
+		.name = "adau1372",
+	},
+	.probe = adau1372_i2c_probe,
+	.id_table = adau1372_i2c_ids,
+};
+module_i2c_driver(adau1372_i2c_driver);
+
+MODULE_DESCRIPTION("ASoC ADAU1372 CODEC I2C driver");
+MODULE_AUTHOR("Lars-Peter Clausen <[email protected]>");
+MODULE_LICENSE("GPL v2");
sound/soc/codecs/adau1372-spi.c new file +58 -0

58 lines not on this page · raw message

sound/soc/codecs/adau1372.c new file +1062 -0

1,062 lines not on this page · raw message

sound/soc/codecs/adau1372.h new file +21 -0
new file mode 100644
index 000000000000..a9d2c59b73a9
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * ADAU1372 driver
+ *
+ * Copyright 2016 Analog Devices Inc.
+ *  Author: Lars-Peter Clausen <[email protected]>
+ */
+
+#ifndef SOUND_SOC_CODECS_ADAU1372_H
+#define SOUND_SOC_CODECS_ADAU1372_H
+
+#include <linux/regmap.h>
+
+struct device;
+
+int adau1372_probe(struct device *dev, struct regmap *regmap,
+		   void (*switch_mode)(struct device *dev));
+
+extern const struct regmap_config adau1372_regmap_config;
+
+#endif
Signature · 1 line
2.28.0
#2 lore raw

Re: [PATCH 2/2] ASoC: Add ADAU1372 audio CODEC support

I love your patch! Perhaps something to improve:

Hi Alexandre,

I love your patch! Perhaps something to improve:

[auto build test WARNING on asoc/for-next]
[also build test WARNING on v5.10-rc3 next-20201110]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexandre-Belloni/dt-bindings-sound-adau1372-Add-bindings-documentation/20201105-041438
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: x86_64-randconfig-a013-20201109 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 09ec07827b1128504457a93dee80b2ceee1af600)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/f483771e450f4bb74b8e585ab5d7fb63ba557b29
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexandre-Belloni/dt-bindings-sound-adau1372-Add-bindings-documentation/20201105-041438 git checkout f483771e450f4bb74b8e585ab5d7fb63ba557b29
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> sound/soc/codecs/adau1372.c:161:29: warning: unused variable 'adau1372_bias_mic_enum' [-Wunused-const-variable]
   static SOC_ENUM_SINGLE_DECL(adau1372_bias_mic_enum,
                               ^

1 warning generated.

vim +/adau1372_bias_mic_enum +161 sound/soc/codecs/adau1372.c

148
149 static SOC_ENUM_SINGLE_DECL(adau1372_bias_hp_enum,
150 ADAU1372_REG_BIAS_CTRL0, 6, adau1372_bias_text);
151 static SOC_ENUM_SINGLE_DECL(adau1372_bias_afe0_1_enum,
152 ADAU1372_REG_BIAS_CTRL0, 4, adau1372_bias_text);
153 static SOC_VALUE_ENUM_SINGLE_DECL(adau1372_bias_adc2_3_enum,
154 ADAU1372_REG_BIAS_CTRL0, 2, 0x3, adau1372_bias_adc_text,
155 adau1372_bias_adc_values);
156 static SOC_VALUE_ENUM_SINGLE_DECL(adau1372_bias_adc0_1_enum,
157 ADAU1372_REG_BIAS_CTRL0, 0, 0x3, adau1372_bias_adc_text,
158 adau1372_bias_adc_values);
159 static SOC_ENUM_SINGLE_DECL(adau1372_bias_afe2_3_enum,
160 ADAU1372_REG_BIAS_CTRL1, 4, adau1372_bias_text);

 > 161	static SOC_ENUM_SINGLE_DECL(adau1372_bias_mic_enum,

162 ADAU1372_REG_BIAS_CTRL1, 2, adau1372_bias_text);
163 static SOC_ENUM_SINGLE_DECL(adau1372_bias_dac_enum,
164 ADAU1372_REG_BIAS_CTRL1, 0, adau1372_bias_dac_text);
165

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

maintainer Reviewed-by on v1 1/2
#3 lore raw
In reply to Alexandre Belloni
Quoted 10 lines · Alexandre Belloni

Add device tree binding documentation for Analog Devices ADAU1372.

---
Cc: Rob Herring <[email protected]>

 .../bindings/sound/adi,adau1372.yaml          | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/adi,adau1372.yaml
maintainer
#4 lore raw
In reply to Alexandre Belloni
Quoted 1 line · Alexandre Belloni

Add device tree binding documentation for Analog Devices ADAU1372.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: adau1372: Add bindings documentation

      commit: 32025c7c50c602a6c0bc3bef0e9a774003e2e7ae
[2/2] ASoC: Add ADAU1372 audio CODEC support
      commit: 6cd4c6459e47402ab90802eca61a18b231434053

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark