Skip to contentSkip to conversation

ASoC: codecs: add support for ES8326

PATCH In review Zhu Ning 4 participants 7 messages Jul 29, 2022 – Aug 14, 2022

Subsystems (3)
lore
Share & tools
lore

Zhu Ning

author
#0 lore raw

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

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

-----
v4 changes since v3

1. remove sysconstrains
2. remove check for null mclk
3. add button detection
3. add properity for reg 58 & 59
-----
v3 changes since v2
1. remove .non_legacy_dai_naming flag

---
 sound/soc/codecs/Kconfig  |   5 +
 sound/soc/codecs/Makefile |   2 +
 sound/soc/codecs/es8326.c | 908 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/es8326.h | 187 ++++++++
 4 files changed, 1102 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 +908 -0

908 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 v4 2/2 ASoC: dt-bindings: Add Everest ES8326 audio CODEC

Add device tree binding documentation for Everest ES8326

----
v4 add properity for reg58 and reg59

---
 .../bindings/sound/everest,es8326.yaml        | 116 ++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100755 Documentation/devicetree/bindings/sound/everest,es8326.yaml
Documentation/devicetree/bindings/sound/everest,es8326.yaml new file +116 -0
new file mode 100755
index 000000000000..d957211516f0
@@ -0,0 +1,116 @@
+# 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 button on the headset is inverted.
+      Bit(1)/(0) decides the mic properity to be OMTP/CTIA or auto.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 0x00
+    maximum: 0x0f
+    default: 0x0f
+  
+  everest,mic1-src:
+    description:
+      the value of reg 2A when headset plugged.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 0x00
+    maximum: 0x77
+    default: 0x22
+
+  everest,mic2-src:
+    description:
+      the value of reg 2A when headset unplugged.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 0x00
+    maximum: 0x77
+    default: 0x44
+
+  everest,jack-detect-inverted:
+    description:
+      Defined to invert the jack detection.
+    $ref: /schemas/types.yaml#/definitions/flag
+
+  everest,interrupt-src:
+    description:
+      value of reg 0x58, Defines the interrupt source.
+      Bit(2) 1 means button press triggers irq, 0 means not.
+      Bit(3) 1 means PIN9 is the irq source for jack detection. When set to 0,
+      bias change on PIN9 do not triggers irq.
+      Bit(4) 1 means PIN27 is the irq source for jack detection.
+      Bit(5) 1 means PIN9 is the irq source after MIC detect.
+      Bit(6) 1 means PIN27 is the irq source after MIC detect.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 0
+    maximum: 0x3c
+    default: 0x08
+
+  everest,interrupt-clk:
+   description:
+     value of reg 0x59, Defines the interrupt output behavior.
+     Bit(0-3) 0 means irq pulse equals 512*internal clock
+       1 means irq pulse equals 1024*internal clock
+       2 means ...
+       7 means irq pulse equals 65536*internal clock
+       8 means irq mutes PA
+       9 means irq mutes PA and DAC output
+     Bit(4) 1 means we invert the interrupt output.
+     Bit(6) 1 means the chip do not detect jack type after button released.
+       0 means the chip detect jack type again after button released.
+  $ref: /schemas/types.yaml#/definitions/uint8
+  minimum: 0
+  maximum: 0x7f
+  default: 0x45
+
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+      #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];
+        everest,interrupt-src = [08];
+        everest,interrupt-clk = [45];
+      };
+    };
Signature · 1 line
2.36.1
maintainer
#2 lore raw

Re: [PATCH v4 2/2] ASoC: dt-bindings: Add Everest ES8326 audio CODEC

Quoted 11 lines · Zhu Ning

Add device tree binding documentation for Everest ES8326

----
v4 add properity for reg58 and reg59

---
 .../bindings/sound/everest,es8326.yaml        | 116 ++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100755 Documentation/devicetree/bindings/sound/everest,es8326.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/sound/everest,es8326.yaml:76:4: [warning] wrong indentation: expected 4 but found 3 (indentation)

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.yaml: properties:$ref: '/schemas/types.yaml#/definitions/uint8' is not of type 'object', 'boolean'
from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.yaml: properties:maximum: 127 is not of type 'object', 'boolean'
from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.yaml: properties:default: 69 is not of type 'object', 'boolean'
from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.yaml: properties:minimum: 0 is not of type 'object', 'boolean'
from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.yaml: properties:everest,interrupt-clk: 'oneOf' conditional failed, one must be fixed:
'type' is a required property
hint: A vendor boolean property can use "type: boolean"
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.yaml: properties:everest,interrupt-clk: 'oneOf' conditional failed, one must be fixed:
'enum' is a required property
'const' is a required property
hint: A vendor string property with exact values has an implicit type
from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.yaml: properties:everest,interrupt-clk: 'oneOf' conditional failed, one must be fixed:
'$ref' is a required property
'allOf' is a required property
hint: A vendor property needs a $ref to types.yaml
from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.yaml: ignoring, error in schema: properties: default /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.example.dtb: codec@19: everest,mic1-src: b'"' is not of type 'object', 'array', 'boolean', 'null'
From schema: /usr/local/lib/python3.10/dist-packages/dtschema/schemas/dt-core.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.example.dtb: codec@19: everest,mic2-src: b'D' is not of type 'object', 'array', 'boolean', 'null'
From schema: /usr/local/lib/python3.10/dist-packages/dtschema/schemas/dt-core.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.example.dtb: codec@19: everest,jack-pol: b'\x0e' is not of type 'object', 'array', 'boolean', 'null'
From schema: /usr/local/lib/python3.10/dist-packages/dtschema/schemas/dt-core.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.example.dtb: codec@19: everest,interrupt-src: b'\x08' is not of type 'object', 'array', 'boolean', 'null'
From schema: /usr/local/lib/python3.10/dist-packages/dtschema/schemas/dt-core.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/everest,es8326.example.dtb: codec@19: everest,interrupt-clk: b'E' is not of type 'object', 'array', 'boolean', 'null'
From schema: /usr/local/lib/python3.10/dist-packages/dtschema/schemas/dt-core.yaml
Documentation/devicetree/bindings/sound/everest,es8326.example.dtb:0:0: /example-0/i2c/codec@19: failed to match any schema with compatible: ['everest,es8326']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

maintainer
#3 lore raw
In reply to Zhu Ning

sound/soc/codecs/es8326.c line 319

Quoted 9 lines · Zhu Ning
sound/soc/codecs/es8326.c new file +9 -0
+static unsigned int es8326_rates[] = {
+	8000, 12000, 16000, 32000, 48000, 96000
+};
+
+static struct snd_pcm_hw_constraint_list es8326_constraints = {
+	.count = ARRAY_SIZE(es8326_rates),
+	.list = es8326_rates,
+};
+

These now aren't used, you should see warnings about this which will turn into build failures in an allmodconfig since it's built with -Werror. Otherwise than that one small thing this now looks good.

#4 lore raw
In reply to Zhu Ning
Thank you for the patch! Yet something to improve:

Hi Zhu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on broonie-sound/for-next]
[also build test ERROR on tiwai-sound/for-next linus/master v5.19-rc8 next-20220728] [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/Zhu-Ning/ASoC-codecs-add-support-for-ES8326/20220729-171050
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: parisc-randconfig-s042-20220729 (https://download.01.org/0day-ci/archive/20220730/[email protected]/config)
compiler: hppa64-linux-gcc (GCC) 12.1.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/fa066f18e36d4d134a5e94a872c911335b148576
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Zhu-Ning/ASoC-codecs-add-support-for-ES8326/20220729-171050
git checkout fa066f18e36d4d134a5e94a872c911335b148576
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=parisc64 SHELL=/bin/bash sound/soc/codecs/

If you fix the issue, kindly add following tag where applicable

All errors (new ones prefixed by >>):

In file included from include/linux/container_of.h:5,

                    from include/linux/kernel.h:21,
                    from include/linux/clk.h:13,
                    from sound/soc/codecs/es8326.c:9:
   sound/soc/codecs/es8326.c: In function 'es8326_jack_button_handler':
>> include/linux/container_of.h:19:54: error: 'struct es8326_priv' has no member named 'button_press_work'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                                                      ^~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
   include/linux/compiler_types.h:293:27: error: expression in static assertion is not an integer
     293 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from include/linux/kasan-checks.h:5,
                    from include/asm-generic/rwonce.h:26,
                    from ./arch/parisc/include/generated/asm/rwonce.h:1,
                    from include/linux/compiler.h:248,
                    from include/linux/err.h:5,
                    from include/linux/clk.h:12:
>> include/linux/stddef.h:16:33: error: 'struct es8326_priv' has no member named 'button_press_work'
      16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
         |                                 ^~~~~~~~~~~~~~~~~~
   include/linux/container_of.h:22:28: note: in expansion of macro 'offsetof'
      22 |         ((type *)(__mptr - offsetof(type, member))); })
         |                            ^~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
>> sound/soc/codecs/es8326.c:543:46: error: 'ES8326_HP_DECTECT_FB' undeclared (first use in this function); did you mean 'ES8326_HP_DETECT_FB'?
     543 |         iface = snd_soc_component_read(comp, ES8326_HP_DECTECT_FB);
         |                                              ^~~~~~~~~~~~~~~~~~~~
         |                                              ES8326_HP_DETECT_FB
   sound/soc/codecs/es8326.c:543:46: note: each undeclared identifier is reported only once for each function it appears in
>> sound/soc/codecs/es8326.c:574:54: error: 'struct es8326_priv' has no member named 'button_press_work'
     574 |                 queue_delayed_work(system_wq, &es8326->button_press_work,
         |                                                      ^~
   sound/soc/codecs/es8326.c:579:54: error: 'struct es8326_priv' has no member named 'button_press_work'
     579 |                 queue_delayed_work(system_wq, &es8326->button_press_work,
         |                                                      ^~
   sound/soc/codecs/es8326.c: In function 'es8326_jack_detect_handler':
   sound/soc/codecs/es8326.c:602:46: error: 'ES8326_HP_DECTECT_FB' undeclared (first use in this function); did you mean 'ES8326_HP_DETECT_FB'?
     602 |         iface = snd_soc_component_read(comp, ES8326_HP_DECTECT_FB);
         |                                              ^~~~~~~~~~~~~~~~~~~~
         |                                              ES8326_HP_DETECT_FB
   sound/soc/codecs/es8326.c:615:62: error: 'struct es8326_priv' has no member named 'button_press_work'
     615 |                         queue_delayed_work(system_wq, &es8326->button_press_work, 10);
         |                                                              ^~
   sound/soc/codecs/es8326.c: In function 'es8326_resume':
>> sound/soc/codecs/es8326.c:681:14: error: 'reg' undeclared (first use in this function)
     681 |         if ((reg & ES8326_VERSION_B) == 1) {
         |              ^~~
   sound/soc/codecs/es8326.c: In function 'es8326_probe':
>> sound/soc/codecs/es8326.c:740:41: error: 'ES8326_INT_SRC_PIN9' undeclared (first use in this function); did you mean 'ES8326_HP_DET_SRC_PIN9'?
     740 |                 es8326->interrupt_src = ES8326_INT_SRC_PIN9;
         |                                         ^~~~~~~~~~~~~~~~~~~
         |                                         ES8326_HP_DET_SRC_PIN9
   sound/soc/codecs/es8326.c: At top level:
   sound/soc/codecs/es8326.c:530:13: warning: 'es8326_jack_button_handler' defined but not used [-Wunused-function]
     530 | static void es8326_jack_button_handler(struct work_struct *work)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/es8326.c:315:42: warning: 'es8326_constraints' defined but not used [-Wunused-variable]
     315 | static struct snd_pcm_hw_constraint_list es8326_constraints = {
         |                                          ^~~~~~~~~~~~~~~~~~

vim +19 include/linux/container_of.h

d2a8ebbf8192b84 Andy Shevchenko  2021-11-08   9  
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  10  /**
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  11   * container_of - cast a member of a structure out to the containing structure
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  12   * @ptr:	the pointer to the member.
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  13   * @type:	the type of the container struct this is embedded in.
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  14   * @member:	the name of the member within the struct.
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  15   *
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  16   */
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  17  #define container_of(ptr, type, member) ({				\
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  18  	void *__mptr = (void *)(ptr);					\
e1edc277e6f6dfb Rasmus Villemoes 2021-11-08 @19  	static_assert(__same_type(*(ptr), ((type *)0)->member) ||	\
e1edc277e6f6dfb Rasmus Villemoes 2021-11-08  20  		      __same_type(*(ptr), void),			\
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  21  		      "pointer type mismatch in container_of()");	\
d2a8ebbf8192b84 Andy Shevchenko  2021-11-08  22  	((type *)(__mptr - offsetof(type, member))); })

d2a8ebbf8192b84 Andy Shevchenko 2021-11-08 23

Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp
#5 lore raw
In reply to Zhu Ning
Thank you for the patch! Yet something to improve:

Hi Zhu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on broonie-sound/for-next]
[also build test ERROR on tiwai-sound/for-next linus/master v5.19-rc8 next-20220728] [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/Zhu-Ning/ASoC-codecs-add-support-for-ES8326/20220729-171050
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: ia64-randconfig-r031-20220729 (https://download.01.org/0day-ci/archive/20220730/[email protected]/config)
compiler: ia64-linux-gcc (GCC) 12.1.0

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
# https://github.com/intel-lab-lkp/linux/commit/fa066f18e36d4d134a5e94a872c911335b148576
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Zhu-Ning/ASoC-codecs-add-support-for-ES8326/20220729-171050
git checkout fa066f18e36d4d134a5e94a872c911335b148576
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash sound/soc/codecs/

If you fix the issue, kindly add following tag where applicable

All errors (new ones prefixed by >>):

In file included from arch/ia64/include/asm/pgtable.h:153,

                    from include/linux/pgtable.h:6,
                    from arch/ia64/include/asm/uaccess.h:40,
                    from include/linux/uaccess.h:11,
                    from include/linux/sched/task.h:11,
                    from include/linux/sched/signal.h:9,
                    from include/linux/rcuwait.h:6,
                    from include/linux/percpu-rwsem.h:7,
                    from include/linux/fs.h:33,
                    from include/linux/cgroup.h:17,
                    from include/linux/memcontrol.h:13,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from include/linux/regulator/consumer.h:35,
                    from include/linux/i2c.h:19,
                    from sound/soc/codecs/es8326.c:10:
   arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
   arch/ia64/include/asm/mmu_context.h:127:48: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
     127 |         unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
         |                                                ^~~~~~~
   In file included from include/linux/container_of.h:5,
                    from include/linux/kernel.h:21,
                    from include/linux/clk.h:13,
                    from sound/soc/codecs/es8326.c:9:
   sound/soc/codecs/es8326.c: In function 'es8326_jack_button_handler':
   include/linux/container_of.h:19:54: error: 'struct es8326_priv' has no member named 'button_press_work'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                                                      ^~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
>> include/linux/compiler_types.h:293:27: error: expression in static assertion is not an integer
     293 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from include/linux/kasan-checks.h:5,
                    from include/asm-generic/rwonce.h:26,
                    from ./arch/ia64/include/generated/asm/rwonce.h:1,
                    from include/linux/compiler.h:248,
                    from include/linux/err.h:5,
                    from include/linux/clk.h:12:
   include/linux/stddef.h:16:33: error: 'struct es8326_priv' has no member named 'button_press_work'
      16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
         |                                 ^~~~~~~~~~~~~~~~~~
   include/linux/container_of.h:22:28: note: in expansion of macro 'offsetof'
      22 |         ((type *)(__mptr - offsetof(type, member))); })
         |                            ^~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
   sound/soc/codecs/es8326.c:543:46: error: 'ES8326_HP_DECTECT_FB' undeclared (first use in this function); did you mean 'ES8326_HP_DETECT_FB'?
     543 |         iface = snd_soc_component_read(comp, ES8326_HP_DECTECT_FB);
         |                                              ^~~~~~~~~~~~~~~~~~~~
         |                                              ES8326_HP_DETECT_FB
   sound/soc/codecs/es8326.c:543:46: note: each undeclared identifier is reported only once for each function it appears in
   sound/soc/codecs/es8326.c:574:54: error: 'struct es8326_priv' has no member named 'button_press_work'
     574 |                 queue_delayed_work(system_wq, &es8326->button_press_work,
         |                                                      ^~
   sound/soc/codecs/es8326.c:579:54: error: 'struct es8326_priv' has no member named 'button_press_work'
     579 |                 queue_delayed_work(system_wq, &es8326->button_press_work,
         |                                                      ^~
   sound/soc/codecs/es8326.c: In function 'es8326_jack_detect_handler':
   sound/soc/codecs/es8326.c:602:46: error: 'ES8326_HP_DECTECT_FB' undeclared (first use in this function); did you mean 'ES8326_HP_DETECT_FB'?
     602 |         iface = snd_soc_component_read(comp, ES8326_HP_DECTECT_FB);
         |                                              ^~~~~~~~~~~~~~~~~~~~
         |                                              ES8326_HP_DETECT_FB
   sound/soc/codecs/es8326.c:615:62: error: 'struct es8326_priv' has no member named 'button_press_work'
     615 |                         queue_delayed_work(system_wq, &es8326->button_press_work, 10);
         |                                                              ^~
   sound/soc/codecs/es8326.c: In function 'es8326_resume':
   sound/soc/codecs/es8326.c:681:14: error: 'reg' undeclared (first use in this function)
     681 |         if ((reg & ES8326_VERSION_B) == 1) {
         |              ^~~
   sound/soc/codecs/es8326.c: In function 'es8326_probe':
   sound/soc/codecs/es8326.c:740:41: error: 'ES8326_INT_SRC_PIN9' undeclared (first use in this function); did you mean 'ES8326_HP_DET_SRC_PIN9'?
     740 |                 es8326->interrupt_src = ES8326_INT_SRC_PIN9;
         |                                         ^~~~~~~~~~~~~~~~~~~
         |                                         ES8326_HP_DET_SRC_PIN9
   sound/soc/codecs/es8326.c: At top level:
   sound/soc/codecs/es8326.c:530:13: warning: 'es8326_jack_button_handler' defined but not used [-Wunused-function]
     530 | static void es8326_jack_button_handler(struct work_struct *work)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/es8326.c:315:42: warning: 'es8326_constraints' defined but not used [-Wunused-variable]
     315 | static struct snd_pcm_hw_constraint_list es8326_constraints = {
         |                                          ^~~~~~~~~~~~~~~~~~

vim +293 include/linux/compiler_types.h

eb111869301e15b Rasmus Villemoes 2019-09-13 291

d15155824c50148 Will Deacon      2017-10-24  292  /* Are two types/vars the same type (ignoring qualifiers)? */
d15155824c50148 Will Deacon      2017-10-24 @293  #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
d15155824c50148 Will Deacon      2017-10-24  294  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp
#6 lore raw
In reply to Zhu Ning
Thank you for the patch! Perhaps something to improve:

Hi Zhu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on tiwai-sound/for-next linus/master v5.19 next-20220812] [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/Zhu-Ning/ASoC-codecs-add-support-for-ES8326/20220729-171050
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220814/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/fa066f18e36d4d134a5e94a872c911335b148576
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Zhu-Ning/ASoC-codecs-add-support-for-ES8326/20220729-171050
        git checkout fa066f18e36d4d134a5e94a872c911335b148576
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash sound/soc/codecs/

If you fix the issue, kindly add following tag where applicable

All warnings (new ones prefixed by >>):

In file included from include/linux/container_of.h:5,

                    from include/linux/kernel.h:21,
                    from include/linux/clk.h:13,
                    from sound/soc/codecs/es8326.c:9:
   sound/soc/codecs/es8326.c: In function 'es8326_jack_button_handler':
   include/linux/container_of.h:19:54: error: 'struct es8326_priv' has no member named 'button_press_work'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                                                      ^~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
   include/linux/compiler_types.h:293:27: error: expression in static assertion is not an integer
     293 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from include/linux/kasan-checks.h:5,
                    from include/asm-generic/rwonce.h:26,
                    from ./arch/x86/include/generated/asm/rwonce.h:1,
                    from include/linux/compiler.h:248,
                    from include/linux/err.h:5,
                    from include/linux/clk.h:12,
                    from sound/soc/codecs/es8326.c:9:
   include/linux/stddef.h:16:33: error: 'struct es8326_priv' has no member named 'button_press_work'
      16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
         |                                 ^~~~~~~~~~~~~~~~~~
   include/linux/container_of.h:22:28: note: in expansion of macro 'offsetof'
      22 |         ((type *)(__mptr - offsetof(type, member))); })
         |                            ^~~~~~~~
   sound/soc/codecs/es8326.c:533:17: note: in expansion of macro 'container_of'
     533 |                 container_of(work, struct es8326_priv, button_press_work.work);
         |                 ^~~~~~~~~~~~
   sound/soc/codecs/es8326.c:543:46: error: 'ES8326_HP_DECTECT_FB' undeclared (first use in this function); did you mean 'ES8326_HP_DETECT_FB'?
     543 |         iface = snd_soc_component_read(comp, ES8326_HP_DECTECT_FB);
         |                                              ^~~~~~~~~~~~~~~~~~~~
         |                                              ES8326_HP_DETECT_FB
   sound/soc/codecs/es8326.c:543:46: note: each undeclared identifier is reported only once for each function it appears in
   sound/soc/codecs/es8326.c:574:54: error: 'struct es8326_priv' has no member named 'button_press_work'
     574 |                 queue_delayed_work(system_wq, &es8326->button_press_work,
         |                                                      ^~
   sound/soc/codecs/es8326.c:579:54: error: 'struct es8326_priv' has no member named 'button_press_work'
     579 |                 queue_delayed_work(system_wq, &es8326->button_press_work,
         |                                                      ^~
   sound/soc/codecs/es8326.c: In function 'es8326_jack_detect_handler':
   sound/soc/codecs/es8326.c:602:46: error: 'ES8326_HP_DECTECT_FB' undeclared (first use in this function); did you mean 'ES8326_HP_DETECT_FB'?
     602 |         iface = snd_soc_component_read(comp, ES8326_HP_DECTECT_FB);
         |                                              ^~~~~~~~~~~~~~~~~~~~
         |                                              ES8326_HP_DETECT_FB
   sound/soc/codecs/es8326.c:615:62: error: 'struct es8326_priv' has no member named 'button_press_work'
     615 |                         queue_delayed_work(system_wq, &es8326->button_press_work, 10);
         |                                                              ^~
   sound/soc/codecs/es8326.c: In function 'es8326_resume':
   sound/soc/codecs/es8326.c:681:14: error: 'reg' undeclared (first use in this function)
     681 |         if ((reg & ES8326_VERSION_B) == 1) {
         |              ^~~
   sound/soc/codecs/es8326.c: In function 'es8326_probe':
   sound/soc/codecs/es8326.c:740:41: error: 'ES8326_INT_SRC_PIN9' undeclared (first use in this function); did you mean 'ES8326_HP_DET_SRC_PIN9'?
     740 |                 es8326->interrupt_src = ES8326_INT_SRC_PIN9;
         |                                         ^~~~~~~~~~~~~~~~~~~
         |                                         ES8326_HP_DET_SRC_PIN9
   At top level:
   sound/soc/codecs/es8326.c:530:13: warning: 'es8326_jack_button_handler' defined but not used [-Wunused-function]
     530 | static void es8326_jack_button_handler(struct work_struct *work)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/codecs/es8326.c:315:42: warning: 'es8326_constraints' defined but not used [-Wunused-variable]
     315 | static struct snd_pcm_hw_constraint_list es8326_constraints = {
         |                                          ^~~~~~~~~~~~~~~~~~

vim +/es8326_constraints +315 sound/soc/codecs/es8326.c

314

 > 315	static struct snd_pcm_hw_constraint_list es8326_constraints = {

316 .count = ARRAY_SIZE(es8326_rates),
317 .list = es8326_rates,
318 };
319

Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp