Skip to contentSkip to conversation

ASoC: Some issues about loongson i2s

PATCH Superseded Binbin Zhou 5 participants 26 messages Sep 24, 2024 – Sep 27, 2024

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Binbin Zhou

author maintainer
#0 lore raw

v2 cover ASoC: Some issues about loongson i2s

Hi all:

This patch set is mainly about Loongson i2s related issues.

Please allow me to briefly explain this patch set:
Patch 1-2: Add ES8323 codec required on Loongson-2K2000 Patch 3-4: Add uda1342 codec required on Loongson-2K1000 Patch 5: Fix the problem of unable to detect codec under FDT system. Patch 6-7: Add Loongson i2s platform device support
Patch 8-9: Related DTS support.

Thanks.

-------
V2:
- Spilt the improve code readability patch to a separate patch series. The link is:
https://lore.kernel.org/all/[email protected]/

patch (1/9):
- Add es8323 compatible in everest,es8316.yaml instead of creating a new yaml file;

patch (2/9):
- Use regmap_config.reg_defaults instead of snd_soc_component_driver.{read/write};
- Use the more modern _CBC_CFC(SND_SOC_DAIFMT_BC_FC);
- Rewrite suspend/resume function with regmap;
- Drop i2c_check_functionality();
- Use named variables for the enums rather than putting them into an array;

patch (3/9):
- Add Reviewed-by tag from Krzysztof;

patch (4/9):
- Drop unused param to avoid lkp warnning;
- Drop some noisy log message(dev_info);
- Use normal conditional statements to improve legibility;
- Use provider/consumer instead of master/slave;
- Use the more modern _CBC_CFC(SND_SOC_DAIFMT_BC_FC);
- Drop uda1342_set_bias_level() for it does nothing;
- Drop uda1342_mixer_enum[] for it is unused;
- Point to controls/routes arrays from the component struct;
- REGCACHE_MAP instead of REGCACHE_RBTREE.

patch (5/9):
- Add of_node_put(args.np) after snd_soc_get_dai_name();
- Use matching label name, such as codec_put instead of free_codec;
- Rewrote the loongson_parse_cpu() and loongson_parse_codec() function interfaces to avoid dropping a reference from a pointer that is a random stack value

patch (6/9):
- Rename file name as loongson,ls2k1000-i2s.yaml;
- List and describe items for reg property;
- 'unevaluatedProperties: false' instead of 'additionalProperties:
false';

patch (7/9):
- Fix lkp warnning;
- Reorder Kconfig items, let
SND_SOC_LOONGSON_I2S_{PCI,PLATFORM} select SND_SOC_LOONGSON_CARD.

Link to v1:
https://lore.kernel.org/all/[email protected]/

Binbin Zhou (9):
ASoC: dt-bindings: Add Everest ES8323 Codec
ASoC: codecs: Add support for ES8323
ASoC: dt-bindings: Add NXP uda1342 Codec
ASoC: codecs: Add uda1342 codec driver
ASoC: loongson: Fix codec detection failure on FDT systems
ASoC: dt-bindings: Add Loongson I2S controller
ASoC: loongson: Add I2S controller driver as platform device
LoongArch: dts: Add I2S support to Loongson-2K1000
LoongArch: dts: Add I2S support to Loongson-2K2000

 .../bindings/sound/everest,es8316.yaml        |   4 +-
 .../bindings/sound/loongson,ls2k1000-i2s.yaml |  68 ++
 .../bindings/sound/nxp,uda1342.yaml           |  42 +
 arch/loongarch/boot/dts/loongson-2k1000.dtsi  |  17 +-
 arch/loongarch/boot/dts/loongson-2k2000.dtsi  |  22 +-
 sound/soc/codecs/Kconfig                      |  13 +
 sound/soc/codecs/Makefile                     |   4 +
 sound/soc/codecs/es8323.c                     | 737 ++++++++++++++++++
 sound/soc/codecs/es8323.h                     |  78 ++
 sound/soc/codecs/uda1342.c                    | 355 +++++++++
 sound/soc/codecs/uda1342.h                    |  79 ++
 sound/soc/loongson/Kconfig                    |  31 +-
 sound/soc/loongson/Makefile                   |   3 +
 sound/soc/loongson/loongson_card.c            |  81 +-
 sound/soc/loongson/loongson_i2s_plat.c        | 186 +++++
 15 files changed, 1679 insertions(+), 41 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/loongson,ls2k1000-i2s.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nxp,uda1342.yaml
 create mode 100644 sound/soc/codecs/es8323.c
 create mode 100644 sound/soc/codecs/es8323.h
 create mode 100644 sound/soc/codecs/uda1342.c
 create mode 100644 sound/soc/codecs/uda1342.h
 create mode 100644 sound/soc/loongson/loongson_i2s_plat.c
Signature · 1 line
2.43.5
author maintainer
#1 lore raw

PATCH v2 1/9 ASoC: dt-bindings: Add Everest ES8323 Codec

Add DT bindings documentation for the Everest-semi ES8323 codec.

Everest-semi ES8323 codec is a low-power mono audio codec with I2S audio interface and I2C control.

Cc Daniel Drake <[email protected]>
Cc Katsuhiro Suzuki <[email protected]>
Cc Matteo Martelli <[email protected]>
---
 Documentation/devicetree/bindings/sound/everest,es8316.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/sound/everest,es8316.yaml +3 -1
index 214f135b7777..e4b2eb5fae2f 100644
@@ -4,12 +4,13 @@
 $id: http://devicetree.org/schemas/sound/everest,es8316.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Everest ES8311 and ES8316 audio CODECs
+title: Everest ES8311, ES8316 and ES8323 audio CODECs
 
 maintainers:
   - Daniel Drake <[email protected]>
   - Katsuhiro Suzuki <[email protected]>
   - Matteo Martelli <[email protected]>
+  - Binbin Zhou <[email protected]>
 
 allOf:
   - $ref: dai-common.yaml#
@@ -19,6 +20,7 @@ properties:
     enum:
       - everest,es8311
       - everest,es8316
+      - everest,es8323
 
   reg:
     maxItems: 1
Signature · 1 line
2.43.5
maintainer Acked-by on v2 1/9
#2 lore raw

Re: [PATCH v2 1/9] ASoC: dt-bindings: Add Everest ES8323 Codec

Quoted 5 lines · Binbin Zhou

Add DT bindings documentation for the Everest-semi ES8323 codec.

Everest-semi ES8323 codec is a low-power mono audio codec with I2S audio interface and I2C control.

Quoted 8 lines
Cc Daniel Drake <[email protected]>
Cc Katsuhiro Suzuki <[email protected]>
Cc Matteo Martelli <[email protected]>
---
 Documentation/devicetree/bindings/sound/everest,es8316.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
author maintainer
#3 lore raw

PATCH v2 2/9 ASoC: codecs: Add support for ES8323

In reply to Binbin Zhou

Add a codec driver for the Everest ES8323. It supports two separate audio outputs and two separate audio inputs.

---
 sound/soc/codecs/Kconfig  |   5 +
 sound/soc/codecs/Makefile |   2 +
 sound/soc/codecs/es8323.c | 737 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/es8323.h |  78 ++++
 4 files changed, 822 insertions(+)
 create mode 100644 sound/soc/codecs/es8323.c
 create mode 100644 sound/soc/codecs/es8323.h
sound/soc/codecs/Kconfig +5 -0
index 7092842480ef..79b2a16e4202 100644
@@ -112,6 +112,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_DA9055
 	imply SND_SOC_DMIC
 	imply SND_SOC_ES8316
+	imply SND_SOC_ES8323
 	imply SND_SOC_ES8326
 	imply SND_SOC_ES8328_SPI
 	imply SND_SOC_ES8328_I2C
@@ -1143,6 +1144,10 @@ config SND_SOC_ES8316
 	tristate "Everest Semi ES8316 CODEC"
 	depends on I2C
 
+config SND_SOC_ES8323
+	tristate "Everest Semi ES8323 CODEC"
+	depends on I2C
+
 config SND_SOC_ES8326
 	tristate "Everest Semi ES8326 CODEC"
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 54cbc3feae32..62fe972514a4 100644
@@ -125,6 +125,7 @@ snd-soc-es7241-y := es7241.o
 snd-soc-es83xx-dsm-common-y := es83xx-dsm-common.o
 snd-soc-es8311-y := es8311.o
 snd-soc-es8316-y := es8316.o
+snd-soc-es8323-y := es8323.o
 snd-soc-es8326-y := es8326.o
 snd-soc-es8328-y := es8328.o
 snd-soc-es8328-i2c-y := es8328-i2c.o
@@ -532,6 +533,7 @@ obj-$(CONFIG_SND_SOC_ES7241)	+= snd-soc-es7241.o
 obj-$(CONFIG_SND_SOC_ES83XX_DSM_COMMON)    += snd-soc-es83xx-dsm-common.o
 obj-$(CONFIG_SND_SOC_ES8311)    += snd-soc-es8311.o
 obj-$(CONFIG_SND_SOC_ES8316)    += snd-soc-es8316.o
+obj-$(CONFIG_SND_SOC_ES8323)	+= snd-soc-es8323.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
sound/soc/codecs/es8323.c new file +737 -0

737 lines not on this page · raw message

sound/soc/codecs/es8323.h new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
2.43.5
maintainer
#4 lore raw

Re: [PATCH v2 2/9] ASoC: codecs: Add support for ES8323

sound/soc/codecs/es8323.c line 452

Quoted 11 lines · Binbin Zhou
sound/soc/codecs/es8323.c new file +11 -0
+	/* interface format */
+	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+	case SND_SOC_DAIFMT_I2S:
+		adciface &= 0xFC;
+		daciface &= 0xF9;
+		break;
+	case SND_SOC_DAIFMT_RIGHT_J:
+	case SND_SOC_DAIFMT_LEFT_J:
+	case SND_SOC_DAIFMT_DSP_A:
+	case SND_SOC_DAIFMT_DSP_B:
+		break;

This results in an identical configuration for everything except I2S which must be buggy, these are distinct formats in ways that are visible on the bus.

#5 lore raw

Re: [PATCH v2 2/9] ASoC: codecs: Add support for ES8323

Hi Mark:

Quoted 15 lines · Mark Brown

sound/soc/codecs/es8323.c line 452

Quoted 11 lines · Binbin Zhou
sound/soc/codecs/es8323.c new file +11 -0
+     /* interface format */
+     switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+     case SND_SOC_DAIFMT_I2S:
+             adciface &= 0xFC;
+             daciface &= 0xF9;
+             break;
+     case SND_SOC_DAIFMT_RIGHT_J:
+     case SND_SOC_DAIFMT_LEFT_J:
+     case SND_SOC_DAIFMT_DSP_A:
+     case SND_SOC_DAIFMT_DSP_B:
+             break;
Quoted 3 lines

This results in an identical configuration for everything except I2S which must be buggy, these are distinct formats in ways that are visible on the bus.

Ok, I checked the datasheet for the ES8323 and it has set bits for LEFT_J/RIGHT_J etc.
In the next version, I'll patch it all.

Thanks.
Binbin

author maintainer
#6 lore raw

PATCH v2 3/9 ASoC: dt-bindings: Add NXP uda1342 Codec

In reply to Binbin Zhou

Add NXP uda1342 CODEC binding with DT schema format using json-schema.

---
 .../bindings/sound/nxp,uda1342.yaml           | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/nxp,uda1342.yaml
Documentation/devicetree/bindings/sound/nxp,uda1342.yaml new file +42 -0
new file mode 100644
index 000000000000..71c6a5a2f5bc
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nxp,uda1342.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP uda1342 audio CODECs
+
+maintainers:
+  - Binbin Zhou <[email protected]>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: nxp,uda1342
+
+  reg:
+    maxItems: 1
+
+  '#sound-dai-cells':
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - '#sound-dai-cells'
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      codec@1a {
+        compatible = "nxp,uda1342";
+        reg = <0x1a>;
+        #sound-dai-cells = <0>;
+      };
+    };
Signature · 1 line
2.43.5
author maintainer
#7 lore raw

PATCH v2 4/9 ASoC: codecs: Add uda1342 codec driver

In reply to Binbin Zhou

The UDA1342 is an NXP audio codec, support 2x Stereo audio ADC (4x PGA mic inputs), stereo audio DAC, with basic audio processing.

---
 sound/soc/codecs/Kconfig   |   8 +
 sound/soc/codecs/Makefile  |   2 +
 sound/soc/codecs/uda1342.c | 355 +++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/uda1342.h |  79 +++++++++
 4 files changed, 444 insertions(+)
 create mode 100644 sound/soc/codecs/uda1342.c
 create mode 100644 sound/soc/codecs/uda1342.h
sound/soc/codecs/Kconfig +8 -0
index 79b2a16e4202..979824fb90b0 100644
@@ -282,6 +282,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_TWL4030
 	imply SND_SOC_TWL6040
 	imply SND_SOC_UDA1334
+	imply SND_SOC_UDA1342
 	imply SND_SOC_UDA1380
 	imply SND_SOC_WCD9335
 	imply SND_SOC_WCD934X
@@ -2119,6 +2120,13 @@ config SND_SOC_UDA1334
 	  and has basic features such as de-emphasis (at 44.1 kHz sampling
 	  rate) and mute.
 
+config SND_SOC_UDA1342
+	tristate "NXP UDA1342 CODEC"
+	depends on I2C
+	help
+	  The UDA1342 is an NXP audio codec, support 2x Stereo audio ADC (4x PGA mic inputs),
+	  stereo audio DAC, with basic audio processing.
+
 config SND_SOC_UDA1380
 	tristate
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 62fe972514a4..add76b50c185 100644
@@ -320,6 +320,7 @@ snd-soc-ts3a227e-y := ts3a227e.o
 snd-soc-twl4030-y := twl4030.o
 snd-soc-twl6040-y := twl6040.o
 snd-soc-uda1334-y := uda1334.o
+snd-soc-uda1342-y := uda1342.o
 snd-soc-uda1380-y := uda1380.o
 snd-soc-wcd-classh-y := wcd-clsh-v2.o
 snd-soc-wcd-mbhc-y := wcd-mbhc-v2.o
@@ -725,6 +726,7 @@ obj-$(CONFIG_SND_SOC_TS3A227E)	+= snd-soc-ts3a227e.o
 obj-$(CONFIG_SND_SOC_TWL4030)	+= snd-soc-twl4030.o
 obj-$(CONFIG_SND_SOC_TWL6040)	+= snd-soc-twl6040.o
 obj-$(CONFIG_SND_SOC_UDA1334)	+= snd-soc-uda1334.o
+obj-$(CONFIG_SND_SOC_UDA1342)	+= snd-soc-uda1342.o
 obj-$(CONFIG_SND_SOC_UDA1380)	+= snd-soc-uda1380.o
 obj-$(CONFIG_SND_SOC_WCD_CLASSH)	+= snd-soc-wcd-classh.o
 obj-$(CONFIG_SND_SOC_WCD_MBHC)	+= snd-soc-wcd-mbhc.o
sound/soc/codecs/uda1342.c new file +355 -0

355 lines not on this page · raw message

sound/soc/codecs/uda1342.h new file +79 -0

79 lines not on this page · raw message

Signature · 1 line
2.43.5
maintainer
#8 lore raw

Re: [PATCH v2 4/9] ASoC: codecs: Add uda1342 codec driver

sound/soc/codecs/uda1342.c line 5

Quoted 6 lines · Binbin Zhou
sound/soc/codecs/uda1342.c new file +5 -0
@@ -0,0 +1,355 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * uda1342.c  --  UDA1342 ALSA SoC Codec driver
+ *
+ * Modifications by Christian Pellegrin <[email protected]>

Please make the entire comment a C++ comment so things look more intentional.

sound/soc/codecs/uda1342.c line 115

Quoted 12 lines
sound/soc/codecs/uda1342.c new file +12 -0
+static int uda1342_hw_params(struct snd_pcm_substream *substream,
+			     struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
+{
+	struct snd_soc_component *component = dai->component;
+	struct uda1342_priv *uda1342 = snd_soc_component_get_drvdata(component);
+	struct device *dev = &uda1342->i2c->dev;
+	unsigned int hw_params = 0;
+
+	if (substream == uda1342->consumer_substream) {
+		dev_info(dev, "ignoring hw_params for consumer substream\n");
+		return 0;
+	}

This is going to spam the logs loudly, dev_dbg() at most. For modern ALSA it's probably good to check that the configuration is the same, indeed it'd be good to set constraints for the configuration of the parent stream. We used to have to care about OSS which would transiently write invalid configurations but that was well over 10 years ago so probably isn't relevant here.

#9 lore raw

Re: [PATCH v2 4/9] ASoC: codecs: Add uda1342 codec driver

In reply to Binbin Zhou
kernel test robot noticed the following build warnings:

Hi Binbin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on robh/for-next linus/master v6.11 next-20240924] [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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Binbin-Zhou/ASoC-dt-bindings-Add-Everest-ES8323-Codec/20240924-150942
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/c69743ea929fed210128de765967ea045ebd6b27.1727056789.git.zhoubinbin%40loongson.cn
patch subject: [PATCH v2 4/9] ASoC: codecs: Add uda1342 codec driver
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240924/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240924/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> sound/soc/codecs/uda1342.c:206:26: warning: 'uda1342_mixmode' defined but not used [-Wunused-const-variable=]
     206 | static const char *const uda1342_mixmode[] = {"Differential", "Analog1", "Analog2", "Both"};
         |                          ^~~~~~~~~~~~~~~
>> sound/soc/codecs/uda1342.c:205:26: warning: 'uda1342_deemph' defined but not used [-Wunused-const-variable=]
     205 | static const char *const uda1342_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
         |                          ^~~~~~~~~~~~~~

vim +/uda1342_mixmode +206 sound/soc/codecs/uda1342.c

204

 > 205	static const char *const uda1342_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
 > 206	static const char *const uda1342_mixmode[] = {"Differential", "Analog1", "Analog2", "Both"};

207

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#10 lore raw

Re: [PATCH v2 4/9] ASoC: codecs: Add uda1342 codec driver

In reply to Binbin Zhou
kernel test robot noticed the following build warnings:

Hi Binbin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on robh/for-next linus/master v6.11 next-20240924] [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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Binbin-Zhou/ASoC-dt-bindings-Add-Everest-ES8323-Codec/20240924-150942
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/c69743ea929fed210128de765967ea045ebd6b27.1727056789.git.zhoubinbin%40loongson.cn
patch subject: [PATCH v2 4/9] ASoC: codecs: Add uda1342 codec driver
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240925/[email protected]/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 8663a75fa2f31299ab8d1d90288d9df92aadee88)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240925/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from sound/soc/codecs/uda1342.c:14:
In file included from include/linux/i2c.h:19:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:25:
In file included from include/linux/kernel_stat.h:8:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:14:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]

     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from sound/soc/codecs/uda1342.c:14:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:25:
   In file included from include/linux/kernel_stat.h:8:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from sound/soc/codecs/uda1342.c:14:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:25:
   In file included from include/linux/kernel_stat.h:8:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   In file included from sound/soc/codecs/uda1342.c:14:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   sound/soc/codecs/uda1342.c:48:20: warning: unused function 'uda1342_reset' [-Wunused-function]
      48 | static inline void uda1342_reset(struct uda1342_priv *uda1342)
         |                    ^~~~~~~~~~~~~
>> sound/soc/codecs/uda1342.c:205:26: warning: unused variable 'uda1342_deemph' [-Wunused-const-variable]
     205 | static const char *const uda1342_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
         |                          ^~~~~~~~~~~~~~
>> sound/soc/codecs/uda1342.c:206:26: warning: unused variable 'uda1342_mixmode' [-Wunused-const-variable]
     206 | static const char *const uda1342_mixmode[] = {"Differential", "Analog1", "Analog2", "Both"};
         |                          ^~~~~~~~~~~~~~~
   sound/soc/codecs/uda1342.c:208:38: warning: variable 'uda1342_snd_controls' is not needed and will not be emitted [-Wunneeded-internal-declaration]
     208 | static const struct snd_kcontrol_new uda1342_snd_controls[] = {
         |                                      ^~~~~~~~~~~~~~~~~~~~

11 warnings generated.

vim +/uda1342_deemph +205 sound/soc/codecs/uda1342.c

204

 > 205	static const char *const uda1342_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
 > 206	static const char *const uda1342_mixmode[] = {"Differential", "Analog1", "Analog2", "Both"};

207

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#11 lore raw

PATCH v2 5/9 ASoC: loongson: Fix codec detection failure on FDT systems

In reply to Binbin Zhou

When the Codec is compiled into a module, we can't use snd_soc_of_get_dlc() to get the codec dai_name, use snd_soc_get_dai_name() instead.

Also, for the cpu dailink, its dai_name is already defined as "loongson-i2s", so just get the corresponding of_node attribute here.

---
 sound/soc/loongson/loongson_card.c | 81 ++++++++++++++++++++----------
 1 file changed, 55 insertions(+), 26 deletions(-)
sound/soc/loongson/loongson_card.c +55 -26
index 7379f24d385c..b07b8652d95b 100644
@@ -119,48 +119,77 @@ static int loongson_card_parse_acpi(struct loongson_card_data *data)
 	return 0;
 }
 
-static int loongson_card_parse_of(struct loongson_card_data *data)
+static int loongson_parse_cpu(struct snd_soc_card *card)
 {
-	struct device_node *cpu, *codec;
-	struct snd_soc_card *card = &data->snd_card;
+	struct device_node *dai_node = NULL, *cpu = NULL;
 	struct device *dev = card->dev;
-	int ret, i;
+	int i;
 
 	cpu = of_get_child_by_name(dev->of_node, "cpu");
-	if (!cpu) {
-		dev_err(dev, "platform property missing or invalid\n");
+	if (!cpu)
 		return -EINVAL;
+
+	dai_node = of_parse_phandle(cpu, "sound-dai", 0);
+	of_node_put(cpu);
+	if (!dai_node)
+		return -EINVAL;
+
+	for (i = 0; i < card->num_links; i++) {
+		loongson_dai_links[i].platforms->of_node = dai_node;
+		loongson_dai_links[i].cpus->of_node = dai_node;
 	}
+
+	of_node_put(dai_node);
+	return 0;
+}
+
+static int loongson_parse_codec(struct snd_soc_card *card)
+{
+	struct device_node *codec = NULL, *dai_node = NULL;
+	struct device *dev = card->dev;
+	struct of_phandle_args args;
+	const char *dai_name;
+	int ret = 0, i;
+
 	codec = of_get_child_by_name(dev->of_node, "codec");
-	if (!codec) {
-		dev_err(dev, "audio-codec property missing or invalid\n");
-		of_node_put(cpu);
+	if (!codec)
 		return -EINVAL;
+
+	ret = of_parse_phandle_with_args(codec, "sound-dai", "#sound-dai-cells", 0, &args);
+	if (ret)
+		goto codec_put;
+
+	ret = snd_soc_get_dai_name(&args, &dai_name);
+	of_node_put(args.np);
+	if (ret)
+		goto codec_put;
+
+	dai_node = of_parse_phandle(codec, "sound-dai", 0);
+	if (!dai_node) {
+		ret = -EINVAL;
+		goto codec_put;
 	}
 
 	for (i = 0; i < card->num_links; i++) {
-		ret = snd_soc_of_get_dlc(cpu, NULL, loongson_dai_links[i].cpus, 0);
-		if (ret < 0) {
-			dev_err(dev, "getting cpu dlc error (%d)\n", ret);
-			goto err;
-		}
-
-		ret = snd_soc_of_get_dlc(codec, NULL, loongson_dai_links[i].codecs, 0);
-		if (ret < 0) {
-			dev_err(dev, "getting codec dlc error (%d)\n", ret);
-			goto err;
-		}
+		loongson_dai_links[i].codecs->of_node = dai_node;
+		loongson_dai_links[i].codecs->dai_name = dai_name;
 	}
 
-	of_node_put(cpu);
+codec_put:
 	of_node_put(codec);
+	return ret;
+}
 
-	return 0;
+static int loongson_card_parse_of(struct loongson_card_data *data)
+{
+	struct snd_soc_card *card = &data->snd_card;
+	int ret;
 
-err:
-	of_node_put(cpu);
-	of_node_put(codec);
-	return ret;
+	ret = loongson_parse_cpu(card);
+	if (ret)
+		return ret;
+
+	return loongson_parse_codec(card);
 }
 
 static int loongson_asoc_card_probe(struct platform_device *pdev)
Signature · 1 line
2.43.5
maintainer
#12 lore raw

Re: [PATCH v2 5/9] ASoC: loongson: Fix codec detection failure on FDT systems

Quoted 3 lines · Binbin Zhou

When the Codec is compiled into a module, we can't use snd_soc_of_get_dlc() to get the codec dai_name, use snd_soc_get_dai_name() instead.

What is the issue with using snd_soc_of_get_dlc()? Shouldn't we fix the helper instead?

#13 lore raw

Re: [PATCH v2 5/9] ASoC: loongson: Fix codec detection failure on FDT systems

Hi Mark:

Quoted 9 lines · Mark Brown
Quoted 3 lines · Binbin Zhou

When the Codec is compiled into a module, we can't use snd_soc_of_get_dlc() to get the codec dai_name, use snd_soc_get_dai_name() instead.

What is the issue with using snd_soc_of_get_dlc()? Shouldn't we fix the helper instead?

I'm very sorry for this part, I checked and tested it again and I should have over-modified it as well as the use of snd_soc_of_get_dlc() is correct.

In fact, what's really being missed here is the assignment of snd_soc_dai_link.platforms->of_node, which causes component_empty for soc_dai_link_sanity_check().

I'll rewrite this part in the next patch set.

Thanks.
Binbin

author maintainer
#14 lore raw

PATCH v2 6/9 ASoC: dt-bindings: Add Loongson I2S controller

In reply to Binbin Zhou

Add Loongson I2S controller binding with DT schema format using json-schema.

---
 .../bindings/sound/loongson,ls2k1000-i2s.yaml | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/loongson,ls2k1000-i2s.yaml
Documentation/devicetree/bindings/sound/loongson,ls2k1000-i2s.yaml new file +68 -0
new file mode 100644
index 000000000000..da79510bb2d9
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/loongson,ls2k1000-i2s.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson-2K1000 I2S controller
+
+maintainers:
+  - Binbin Zhou <[email protected]>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: loongson,ls2k1000-i2s
+
+  reg:
+    items:
+      - description: Loongson I2S controller Registers.
+      - description: APB DMA config register for Loongson I2S controller.
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  dmas:
+    maxItems: 2
+
+  dma-names:
+    items:
+      - const: tx
+      - const: rx
+
+  '#sound-dai-cells':
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - dmas
+  - dma-names
+  - '#sound-dai-cells'
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/loongson,ls2k-clk.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2s@1fe2d000 {
+        compatible = "loongson,ls2k1000-i2s";
+        reg = <0x1fe2d000 0x14>,
+              <0x1fe00438 0x8>;
+        interrupt-parent = <&liointc0>;
+        interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clk LOONGSON2_APB_CLK>;
+        dmas = <&apbdma2 0>, <&apbdma3 0>;
+        dma-names = "tx", "rx";
+        #sound-dai-cells = <0>;
+    };
+...
Signature · 1 line
2.43.5
maintainer Reviewed-by on v2 6/9
#15 lore raw

Re: [PATCH v2 6/9] ASoC: dt-bindings: Add Loongson I2S controller

Quoted 9 lines · Binbin Zhou

Add Loongson I2S controller binding with DT schema format using json-schema.

---
 .../bindings/sound/loongson,ls2k1000-i2s.yaml | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/loongson,ls2k1000-i2s.yaml
author maintainer
#16 lore raw

PATCH v2 7/9 ASoC: loongson: Add I2S controller driver as platform device

In reply to Binbin Zhou

The Loongson I2S controller exists not only in PCI form (LS7A bridge chip), but also in platform device form (Loongson-2K1000 SoC).

This patch adds support for platform device I2S controller.

---
 sound/soc/loongson/Kconfig             |  31 +++--
 sound/soc/loongson/Makefile            |   3 +
 sound/soc/loongson/loongson_i2s_plat.c | 186 +++++++++++++++++++++++++
 3 files changed, 210 insertions(+), 10 deletions(-)
 create mode 100644 sound/soc/loongson/loongson_i2s_plat.c
sound/soc/loongson/Kconfig +21 -10
index b8d7e2bade24..715ddc91a834 100644
@@ -1,11 +1,21 @@
 # SPDX-License-Identifier: GPL-2.0
 menu "SoC Audio for Loongson CPUs"
+
+config SND_SOC_LOONGSON_CARD
+	tristate "Loongson Sound Card Driver"
 	depends on LOONGARCH || COMPILE_TEST
+	help
+	  Say Y or M if you want to add support for SoC audio using
+	  loongson I2S controller.
+
+	  The driver add support for ALSA SoC Audio support using
+	  loongson I2S controller.
 
 config SND_SOC_LOONGSON_I2S_PCI
 	tristate "Loongson I2S-PCI Device Driver"
-	select REGMAP_MMIO
 	depends on PCI
+	select REGMAP_MMIO
+	select SND_SOC_LOONGSON_CARD
 	help
 	  Say Y or M if you want to add support for I2S driver for
 	  Loongson I2S controller.
@@ -13,15 +23,16 @@ config SND_SOC_LOONGSON_I2S_PCI
 	  The controller is found in loongson bridge chips or SoCs,
 	  and work as a PCI device.
 
-config SND_SOC_LOONGSON_CARD
-	tristate "Loongson Sound Card Driver"
-	select SND_SOC_LOONGSON_I2S_PCI
-	depends on PCI
+config SND_SOC_LOONGSON_I2S_PLATFORM
+	tristate "Loongson I2S controller as platform device"
+	depends on OF
+	select REGMAP_MMIO
+	select SND_SOC_LOONGSON_CARD
+	select SND_SOC_GENERIC_DMAENGINE_PCM
 	help
-	  Say Y or M if you want to add support for SoC audio using
-	  loongson I2S controller.
-
-	  The driver add support for ALSA SoC Audio support using
-	  loongson I2S controller.
+	  Say Y or M if you want to add support for I2S driver for
+	  Loongson I2S controller.
 
+	  The controller work as a platform device, found in Loongson-2K1000
+	  SoCs.
 endmenu
sound/soc/loongson/Makefile +3 -0
index 578030ad6563..f396259244a3 100644
@@ -3,6 +3,9 @@
 snd-soc-loongson-i2s-pci-y := loongson_i2s_pci.o loongson_i2s.o loongson_dma.o
 obj-$(CONFIG_SND_SOC_LOONGSON_I2S_PCI) += snd-soc-loongson-i2s-pci.o
 
+snd-soc-loongson-i2s-plat-y := loongson_i2s_plat.o loongson_i2s.o
+obj-$(CONFIG_SND_SOC_LOONGSON_I2S_PLATFORM) += snd-soc-loongson-i2s-plat.o
+
 #Machine Support
 snd-soc-loongson-card-y := loongson_card.o
 obj-$(CONFIG_SND_SOC_LOONGSON_CARD) += snd-soc-loongson-card.o
sound/soc/loongson/loongson_i2s_plat.c new file +186 -0

186 lines not on this page · raw message

Signature · 1 line
2.43.5
maintainer
#17 lore raw

Re: [PATCH v2 7/9] ASoC: loongson: Add I2S controller driver as platform device

sound/soc/loongson/Kconfig line 21

Quoted 9 lines · Binbin Zhou

config SND_SOC_LOONGSON_I2S_PCI

sound/soc/loongson/Kconfig +2 -1
 	tristate "Loongson I2S-PCI Device Driver"
-	select REGMAP_MMIO
 	depends on PCI
+	select REGMAP_MMIO
+	select SND_SOC_LOONGSON_CARD
 	help
 	  Say Y or M if you want to add support for I2S driver for
 	  Loongson I2S controller.

You shouldn't select the card from the DAI drivers, some system might use the driver with a different card for some reason. If anything a select from the card to the DAI driver is more appropriate, cards are the main user thing.

sound/soc/loongson/loongson_i2s_plat.c line 3

Quoted 5 lines

+++ b/sound/soc/loongson/loongson_i2s_plat.c

sound/soc/loongson/loongson_i2s_plat.c new file +3 -0
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Loongson I2S controller master mode dirver(platform device)

Please use C++ style for the whole comment block so things look more intentional.

#18 lore raw

Re: [PATCH v2 7/9] ASoC: loongson: Add I2S controller driver as platform device

Hi Mark:

Thanks for your reply.

Quoted 13 lines · Mark Brown

sound/soc/loongson/Kconfig line 21

Quoted 9 lines · Binbin Zhou

config SND_SOC_LOONGSON_I2S_PCI
tristate "Loongson I2S-PCI Device Driver"

sound/soc/loongson/Kconfig +2 -1
-     select REGMAP_MMIO
      depends on PCI
+     select REGMAP_MMIO
+     select SND_SOC_LOONGSON_CARD
      help
        Say Y or M if you want to add support for I2S driver for
        Loongson I2S controller.
Quoted 4 lines

You shouldn't select the card from the DAI drivers, some system might use the driver with a different card for some reason. If anything a select from the card to the DAI driver is more appropriate, cards are the main user thing.

I will rewrite the dependency between the card and the DAI driver, as follows:

config SND_SOC_LOONGSON_CARD
tristate "Loongson Sound Card Driver" depends on LOONGARCH || COMPILE_TEST select SND_SOC_LOONGSON_I2S_PCI if PCI select SND_SOC_LOONGSON_I2S_PLATFORM if OF

config SND_SOC_LOONGSON_I2S_PCI
tristate "Loongson I2S-PCI Device Driver"
select REGMAP_MMIO

config SND_SOC_LOONGSON_I2S_PLATFORM
tristate "Loongson I2S controller as platform device" select REGMAP_MMIO
select SND_SOC_GENERIC_DMAENGINE_PCM

Thanks.
Binbin

Quoted 9 lines

sound/soc/loongson/loongson_i2s_plat.c line 3

Quoted 6 lines

+++ b/sound/soc/loongson/loongson_i2s_plat.c

sound/soc/loongson/loongson_i2s_plat.c new file +3 -0
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Loongson I2S controller master mode dirver(platform device)

Please use C++ style for the whole comment block so things look more intentional.

maintainer
#19 lore raw

Re: [PATCH v2 7/9] ASoC: loongson: Add I2S controller driver as platform device

Quoted 8 lines · Binbin Zhou

I will rewrite the dependency between the card and the DAI driver, as follows:

config SND_SOC_LOONGSON_CARD
tristate "Loongson Sound Card Driver" depends on LOONGARCH || COMPILE_TEST select SND_SOC_LOONGSON_I2S_PCI if PCI select SND_SOC_LOONGSON_I2S_PLATFORM if OF

Quoted 8 lines

config SND_SOC_LOONGSON_I2S_PCI
tristate "Loongson I2S-PCI Device Driver"
select REGMAP_MMIO

config SND_SOC_LOONGSON_I2S_PLATFORM
tristate "Loongson I2S controller as platform device" select REGMAP_MMIO
select SND_SOC_GENERIC_DMAENGINE_PCM

That looks good apart from the PCI and platform drivers should probably also have a

	depends on LOONGARCH || COMPILE_TEST

so they're not shown on architectures where they can't be used unless doing testing.

#20 lore raw

Re: [PATCH v2 7/9] ASoC: loongson: Add I2S controller driver as platform device

Hi Mark:

Quoted 20 lines · Mark Brown
Quoted 8 lines · Binbin Zhou

I will rewrite the dependency between the card and the DAI driver, as follows:

config SND_SOC_LOONGSON_CARD
tristate "Loongson Sound Card Driver" depends on LOONGARCH || COMPILE_TEST select SND_SOC_LOONGSON_I2S_PCI if PCI select SND_SOC_LOONGSON_I2S_PLATFORM if OF

Quoted 8 lines

config SND_SOC_LOONGSON_I2S_PCI
tristate "Loongson I2S-PCI Device Driver"
select REGMAP_MMIO

config SND_SOC_LOONGSON_I2S_PLATFORM
tristate "Loongson I2S controller as platform device" select REGMAP_MMIO
select SND_SOC_GENERIC_DMAENGINE_PCM

Quoted 7 lines

That looks good apart from the PCI and platform drivers should probably also have a

        depends on LOONGARCH || COMPILE_TEST

so they're not shown on architectures where they can't be used unless doing testing.

OK, I will add it in the V3 patchset.

Thanks.
Binbin

#21 lore raw

Re: [PATCH v2 7/9] ASoC: loongson: Add I2S controller driver as platform device

In reply to Binbin Zhou
kernel test robot noticed the following build warnings:

Hi Binbin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on linus/master next-20240924] [cannot apply to robh/for-next v6.11]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Binbin-Zhou/ASoC-dt-bindings-Add-Everest-ES8323-Codec/20240924-150942
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/fd3989d15546502b47f580e6a2c3a59cb628ce93.1727056789.git.zhoubinbin%40loongson.cn
patch subject: [PATCH v2 7/9] ASoC: loongson: Add I2S controller driver as platform device
config: alpha-kismet-CONFIG_SND_SOC_LOONGSON_CARD-CONFIG_SND_SOC_LOONGSON_I2S_PCI-0-0 (https://download.01.org/0day-ci/archive/20240925/[email protected]/config)
reproduce: (https://download.01.org/0day-ci/archive/20240925/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

kismet warnings: (new ones prefixed by >>)

>> kismet: WARNING: unmet direct dependencies detected for SND_SOC_LOONGSON_CARD when selected by SND_SOC_LOONGSON_I2S_PCI

WARNING: unmet direct dependencies detected for SND_SOC_LOONGSON_CARD
Depends on [n]: SOUND [=y] && SND [=y] && SND_SOC [=y] && (LOONGARCH || COMPILE_TEST [=n]) Selected by [y]:
- SND_SOC_LOONGSON_I2S_PCI [=y] && SOUND [=y] && SND [=y] && SND_SOC [=y] && PCI [=y]

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#22 lore raw

Re: [PATCH v2 7/9] ASoC: loongson: Add I2S controller driver as platform device

In reply to Binbin Zhou
kernel test robot noticed the following build warnings:

Hi Binbin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on linus/master next-20240924] [cannot apply to robh/for-next v6.11]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Binbin-Zhou/ASoC-dt-bindings-Add-Everest-ES8323-Codec/20240924-150942
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/fd3989d15546502b47f580e6a2c3a59cb628ce93.1727056789.git.zhoubinbin%40loongson.cn
patch subject: [PATCH v2 7/9] ASoC: loongson: Add I2S controller driver as platform device
config: alpha-kismet-CONFIG_SND_SOC_LOONGSON_CARD-CONFIG_SND_SOC_LOONGSON_I2S_PLATFORM-0-0 (https://download.01.org/0day-ci/archive/20240925/[email protected]/config)
reproduce: (https://download.01.org/0day-ci/archive/20240925/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

kismet warnings: (new ones prefixed by >>)

>> kismet: WARNING: unmet direct dependencies detected for SND_SOC_LOONGSON_CARD when selected by SND_SOC_LOONGSON_I2S_PLATFORM

WARNING: unmet direct dependencies detected for SND_SOC_LOONGSON_CARD
Depends on [n]: SOUND [=y] && SND [=y] && SND_SOC [=y] && (LOONGARCH || COMPILE_TEST [=n]) Selected by [y]:
- SND_SOC_LOONGSON_I2S_PLATFORM [=y] && SOUND [=y] && SND [=y] && SND_SOC [=y] && OF [=y]

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#23 lore raw

PATCH v2 8/9 LoongArch: dts: Add I2S support to Loongson-2K1000

In reply to Binbin Zhou

The module is supported, adding it.

Not all Loongson-2K1000 boards have an i2s interface, here is an example of enabling it:

sound {
	compatible = "loongson,ls-audio-card";
	model = "Loongson-ASoC";
	mclk-fs = <512>;

	cpu {
		sound-dai = <&i2s>;
	};

	codec {
		sound-dai = <&uda1342>;
	};
};
&apbdma2 {
	status = "okay";
};
&apbdma3 {
	status = "okay";
};
&i2c3 {
	status = "okay";

	pinctrl-0 = <&i2c1_pins_default>;
	pinctrl-names = "default";

	#address-cells = <1>;
	#size-cells = <0>;

	uda1342: codec@1a {
		compatible = "nxp,uda1342";
		reg = <0x1a>;
		#sound-dai-cells = <0>;
	};
};
&i2s {
	status = "okay";

	pinctrl-0 = <&hda_pins_default>;
	pinctrl-names = "default";
};
---
 arch/loongarch/boot/dts/loongson-2k1000.dtsi | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
arch/loongarch/boot/dts/loongson-2k1000.dtsi +15 -2
index 92180140eb56..8dff2aa52417 100644
@@ -266,7 +266,7 @@ dma-controller@1fe00c10 {
 			status = "disabled";
 		};
 
-		dma-controller@1fe00c20 {
+		apbdma2: dma-controller@1fe00c20 {
 			compatible = "loongson,ls2k1000-apbdma";
 			reg = <0x0 0x1fe00c20 0x0 0x8>;
 			interrupt-parent = <&liointc1>;
@@ -276,7 +276,7 @@ dma-controller@1fe00c20 {
 			status = "disabled";
 		};
 
-		dma-controller@1fe00c30 {
+		apbdma3: dma-controller@1fe00c30 {
 			compatible = "loongson,ls2k1000-apbdma";
 			reg = <0x0 0x1fe00c30 0x0 0x8>;
 			interrupt-parent = <&liointc1>;
@@ -352,6 +352,19 @@ rtc0: rtc@1fe27800 {
 			status = "disabled";
 		};
 
+		i2s: i2s@1fe2d000 {
+			compatible = "loongson,ls2k1000-i2s";
+			reg = <0 0x1fe2d000 0 0x14>,
+			      <0 0x1fe00438 0 0x8>;
+			interrupt-parent = <&liointc0>;
+			interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk LOONGSON2_APB_CLK>;
+			dmas = <&apbdma2 0>, <&apbdma3 0>;
+			dma-names = "tx", "rx";
+			#sound-dai-cells = <0>;
+			status = "disabled";
+		};
+
 		spi0: spi@1fff0220 {
 			compatible = "loongson,ls2k1000-spi";
 			reg = <0x0 0x1fff0220 0x0 0x10>;
Signature · 1 line
2.43.5
author maintainer
#24 lore raw

PATCH v2 9/9 LoongArch: dts: Add I2S support to Loongson-2K2000

In reply to Binbin Zhou

The module is supported, adding it.

Not all Loongson-2K1000 boards have an i2s interface, here is an example of enabling it:

sound {
	compatible = "loongson,ls-audio-card";
	model = "Loongson-ASoC";
	mclk-fs = <512>;

	cpu {
		sound-dai = <&i2s>;
	};

	codec {
		sound-dai = <&es8323>;
	};
};
&i2c1 {
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	es8323:es8323@10 {
		compatible = "everest,es8323";
		reg = <0x10>;
		#sound-dai-cells = <0>;
	};
};
&i2s {
	status = "okay";

	clock-frequency = <175000000>;
	#sound-dai-cells = <0>;
};
---
 arch/loongarch/boot/dts/loongson-2k2000.dtsi | 22 ++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
arch/loongarch/boot/dts/loongson-2k2000.dtsi +20 -2
index 0953c5707825..b4ff55a33e90 100644
@@ -173,6 +173,22 @@ rtc0: rtc@100d0100 {
 			status = "disabled";
 		};
 
+		i2c@1fe00120 {
+			compatible = "loongson,ls2k-i2c";
+			reg = <0x0 0x1fe00120 0x0 0x8>;
+			interrupt-parent = <&liointc>;
+			interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		i2c@1fe00130 {
+			compatible = "loongson,ls2k-i2c";
+			reg = <0x0 0x1fe00130 0x0 0x8>;
+			interrupt-parent = <&liointc>;
+			interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
 		uart0: serial@1fe001e0 {
 			compatible = "ns16550a";
 			reg = <0x0 0x1fe001e0 0x0 0x10>;
@@ -243,9 +259,11 @@ display@6,1 {
 				status = "disabled";
 			};
 
-			hda@7,0 {
+			i2s@7,0 {
 				reg = <0x3800 0x0 0x0 0x0 0x0>;
-				interrupts = <58 IRQ_TYPE_LEVEL_HIGH>;
+				interrupts = <78 IRQ_TYPE_LEVEL_HIGH>,
+					     <79 IRQ_TYPE_LEVEL_HIGH>;
+				interrupt-names = "tx", "rx";
 				interrupt-parent = <&pic>;
 				status = "disabled";
 			};
Signature · 1 line
2.43.5
maintainer
#25 lore raw
In reply to Binbin Zhou
Quoted 3 lines · Binbin Zhou

Hi all:

This patch set is mainly about Loongson i2s related issues.

I did find some issues with this series but apart from the query with not using snd_soc_of_get_dlc() they're all fairly small, the bulk of this looks good.