ASoc: cs42xx8-i2c.c: add module device table for of

Message ID 20221027115057.442925-1-peter@berginkonsult.se
State New
Headers
Series ASoc: cs42xx8-i2c.c: add module device table for of |

Commit Message

Peter Bergin Oct. 27, 2022, 11:50 a.m. UTC
  When trying to connect the device with the driver through of
it is not working. The of_device_id is defined in cs42xx8.c
but is not correctly included in cs42xx8-i2c.c. Also add the
matching table for of in the i2c file.

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
---
 sound/soc/codecs/cs42xx8-i2c.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Mark Brown Oct. 27, 2022, 12:31 p.m. UTC | #1
On Thu, Oct 27, 2022 at 01:50:56PM +0200, Peter Bergin wrote:
> When trying to connect the device with the driver through of
> it is not working. The of_device_id is defined in cs42xx8.c
> but is not correctly included in cs42xx8-i2c.c. Also add the
> matching table for of in the i2c file.
> 
> Signed-off-by: Peter Bergin <peter@berginkonsult.se>
> ---
>  sound/soc/codecs/cs42xx8-i2c.c | 7 +++++++
>  1 file changed, 7 insertions(+)

This should move the ID table out of cs42xx8.c, not just duplicate it.
  
kernel test robot Oct. 27, 2022, 10:30 p.m. UTC | #2
Hi Peter,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v6.0]
[also build test ERROR on linus/master next-20221027]
[cannot apply to broonie-sound/for-next v6.1-rc2 v6.1-rc1]
[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/Peter-Bergin/ASoc-cs42xx8-i2c-c-add-module-device-table-for-of/20221027-195337
patch link:    https://lore.kernel.org/r/20221027115057.442925-1-peter%40berginkonsult.se
patch subject: [PATCH] ASoc: cs42xx8-i2c.c: add module device table for of
config: s390-allyesconfig
compiler: s390-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/a09fe8d3c2a7a2270c0ec1582ed182d747f0d9b8
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Peter-Bergin/ASoc-cs42xx8-i2c-c-add-module-device-table-for-of/20221027-195337
        git checkout a09fe8d3c2a7a2270c0ec1582ed182d747f0d9b8
        # 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=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> s390-linux-ld: sound/soc/codecs/cs42xx8-i2c.o:(.data.rel.ro+0x0): multiple definition of `cs42xx8_of_match'; sound/soc/codecs/cs42xx8.o:(.data.rel.ro.local+0x540): first defined here
  
kernel test robot Oct. 27, 2022, 11:41 p.m. UTC | #3
Hi Peter,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v6.0]
[also build test ERROR on linus/master next-20221027]
[cannot apply to broonie-sound/for-next v6.1-rc2 v6.1-rc1]
[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/Peter-Bergin/ASoc-cs42xx8-i2c-c-add-module-device-table-for-of/20221027-195337
patch link:    https://lore.kernel.org/r/20221027115057.442925-1-peter%40berginkonsult.se
patch subject: [PATCH] ASoc: cs42xx8-i2c.c: add module device table for of
config: mips-allyesconfig
compiler: mips-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/a09fe8d3c2a7a2270c0ec1582ed182d747f0d9b8
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Peter-Bergin/ASoc-cs42xx8-i2c-c-add-module-device-table-for-of/20221027-195337
        git checkout a09fe8d3c2a7a2270c0ec1582ed182d747f0d9b8
        # 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=mips SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> mips-linux-ld: sound/soc/codecs/cs42xx8-i2c.o:(.rodata.cs42xx8_of_match+0x0): multiple definition of `cs42xx8_of_match'; sound/soc/codecs/cs42xx8.o:(.rodata.cs42xx8_of_match+0x0): first defined here
  

Patch

diff --git a/sound/soc/codecs/cs42xx8-i2c.c b/sound/soc/codecs/cs42xx8-i2c.c
index cb06a06d48b0..6e8ee28d01f8 100644
--- a/sound/soc/codecs/cs42xx8-i2c.c
+++ b/sound/soc/codecs/cs42xx8-i2c.c
@@ -37,6 +37,13 @@  static int cs42xx8_i2c_remove(struct i2c_client *i2c)
 	return 0;
 }
 
+const struct of_device_id cs42xx8_of_match[] = {
+	{ .compatible = "cirrus,cs42448", .data = &cs42448_data, },
+	{ .compatible = "cirrus,cs42888", .data = &cs42888_data, },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, cs42xx8_of_match);
+
 static struct i2c_device_id cs42xx8_i2c_id[] = {
 	{"cs42448", (kernel_ulong_t)&cs42448_data},
 	{"cs42888", (kernel_ulong_t)&cs42888_data},