diff mbox series

[v2,5/5] ASoC: codecs: wsa881x: add static port map support

Message ID 20210309141514.24744-6-srinivas.kandagatla@linaro.org
State New
Headers show
Series soundwire: add static port map support | expand

Commit Message

Srinivas Kandagatla March 9, 2021, 2:15 p.m. UTC
Two instances of WSA881x(Speaker Right, Speaker Left) ports
are statically mapped to master ports. Allow the driver to parse
those mappings from device tree.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

---
 sound/soc/codecs/wsa881x.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.21.0

Comments

kernel test robot March 9, 2021, 4:08 p.m. UTC | #1
Hi Srinivas,

I love your patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on vkoul-dmaengine/next robh/for-next linus/master v5.12-rc2 next-20210309]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Srinivas-Kandagatla/soundwire-add-static-port-map-support/20210309-221834
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: nds32-randconfig-r003-20210308 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/d0e48ba0d85c188c14216aad9397bcd902d8a09a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Srinivas-Kandagatla/soundwire-add-static-port-map-support/20210309-221834
        git checkout d0e48ba0d85c188c14216aad9397bcd902d8a09a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

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

All errors (new ones prefixed by >>):

   sound/soc/codecs/wsa881x.c: In function 'wsa881x_probe':
>> sound/soc/codecs/wsa881x.c:1108:33: error: 'dev' undeclared (first use in this function); did you mean 'pdev'?

    1108 |  if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping",
         |                                 ^~~
         |                                 pdev
   sound/soc/codecs/wsa881x.c:1108:33: note: each undeclared identifier is reported only once for each function it appears in


vim +1108 sound/soc/codecs/wsa881x.c

  1091	
  1092	static int wsa881x_probe(struct sdw_slave *pdev,
  1093				 const struct sdw_device_id *id)
  1094	{
  1095		struct wsa881x_priv *wsa881x;
  1096	
  1097		wsa881x = devm_kzalloc(&pdev->dev, sizeof(*wsa881x), GFP_KERNEL);
  1098		if (!wsa881x)
  1099			return -ENOMEM;
  1100	
  1101		wsa881x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
  1102							GPIOD_FLAGS_BIT_NONEXCLUSIVE);
  1103		if (IS_ERR(wsa881x->sd_n)) {
  1104			dev_err(&pdev->dev, "Shutdown Control GPIO not found\n");
  1105			return PTR_ERR(wsa881x->sd_n);
  1106		}
  1107	
> 1108		if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping",

  1109					       pdev->m_port_map,
  1110					       WSA881X_MAX_SWR_PORTS))
  1111			dev_info(dev, "Static Port mapping not specified\n");
  1112	
  1113		dev_set_drvdata(&pdev->dev, wsa881x);
  1114		wsa881x->slave = pdev;
  1115		wsa881x->dev = &pdev->dev;
  1116		wsa881x->sconfig.ch_count = 1;
  1117		wsa881x->sconfig.bps = 1;
  1118		wsa881x->sconfig.frame_rate = 48000;
  1119		wsa881x->sconfig.direction = SDW_DATA_DIR_RX;
  1120		wsa881x->sconfig.type = SDW_STREAM_PDM;
  1121		pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS, 0);
  1122		pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
  1123		pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
  1124		gpiod_direction_output(wsa881x->sd_n, 1);
  1125	
  1126		wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config);
  1127		if (IS_ERR(wsa881x->regmap)) {
  1128			dev_err(&pdev->dev, "regmap_init failed\n");
  1129			return PTR_ERR(wsa881x->regmap);
  1130		}
  1131	
  1132		return devm_snd_soc_register_component(&pdev->dev,
  1133						       &wsa881x_component_drv,
  1134						       wsa881x_dais,
  1135						       ARRAY_SIZE(wsa881x_dais));
  1136	}
  1137	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot March 9, 2021, 8:31 p.m. UTC | #2
Hi Srinivas,

I love your patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on vkoul-dmaengine/next robh/for-next linus/master v5.12-rc2 next-20210309]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Srinivas-Kandagatla/soundwire-add-static-port-map-support/20210309-221834
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: arm64-randconfig-r016-20210308 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 820f508b08d7c94b2dd7847e9710d2bc36d3dd45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/d0e48ba0d85c188c14216aad9397bcd902d8a09a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Srinivas-Kandagatla/soundwire-add-static-port-map-support/20210309-221834
        git checkout d0e48ba0d85c188c14216aad9397bcd902d8a09a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

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

All errors (new ones prefixed by >>):

>> sound/soc/codecs/wsa881x.c:1108:33: error: use of undeclared identifier 'dev'

           if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping",
                                          ^
   sound/soc/codecs/wsa881x.c:1111:12: error: use of undeclared identifier 'dev'; did you mean 'pdev'?
                   dev_info(dev, "Static Port mapping not specified\n");
                            ^~~
                            pdev
   include/linux/dev_printk.h:118:12: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                     ^
   sound/soc/codecs/wsa881x.c:1092:44: note: 'pdev' declared here
   static int wsa881x_probe(struct sdw_slave *pdev,
                                              ^
   2 errors generated.


vim +/dev +1108 sound/soc/codecs/wsa881x.c

  1091	
  1092	static int wsa881x_probe(struct sdw_slave *pdev,
  1093				 const struct sdw_device_id *id)
  1094	{
  1095		struct wsa881x_priv *wsa881x;
  1096	
  1097		wsa881x = devm_kzalloc(&pdev->dev, sizeof(*wsa881x), GFP_KERNEL);
  1098		if (!wsa881x)
  1099			return -ENOMEM;
  1100	
  1101		wsa881x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
  1102							GPIOD_FLAGS_BIT_NONEXCLUSIVE);
  1103		if (IS_ERR(wsa881x->sd_n)) {
  1104			dev_err(&pdev->dev, "Shutdown Control GPIO not found\n");
  1105			return PTR_ERR(wsa881x->sd_n);
  1106		}
  1107	
> 1108		if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping",

  1109					       pdev->m_port_map,
  1110					       WSA881X_MAX_SWR_PORTS))
  1111			dev_info(dev, "Static Port mapping not specified\n");
  1112	
  1113		dev_set_drvdata(&pdev->dev, wsa881x);
  1114		wsa881x->slave = pdev;
  1115		wsa881x->dev = &pdev->dev;
  1116		wsa881x->sconfig.ch_count = 1;
  1117		wsa881x->sconfig.bps = 1;
  1118		wsa881x->sconfig.frame_rate = 48000;
  1119		wsa881x->sconfig.direction = SDW_DATA_DIR_RX;
  1120		wsa881x->sconfig.type = SDW_STREAM_PDM;
  1121		pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS, 0);
  1122		pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
  1123		pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
  1124		gpiod_direction_output(wsa881x->sd_n, 1);
  1125	
  1126		wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config);
  1127		if (IS_ERR(wsa881x->regmap)) {
  1128			dev_err(&pdev->dev, "regmap_init failed\n");
  1129			return PTR_ERR(wsa881x->regmap);
  1130		}
  1131	
  1132		return devm_snd_soc_register_component(&pdev->dev,
  1133						       &wsa881x_component_drv,
  1134						       wsa881x_dais,
  1135						       ARRAY_SIZE(wsa881x_dais));
  1136	}
  1137	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index db87e07b11c9..f7b6bbd62728 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -1105,6 +1105,11 @@  static int wsa881x_probe(struct sdw_slave *pdev,
 		return PTR_ERR(wsa881x->sd_n);
 	}
 
+	if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping",
+				       pdev->m_port_map,
+				       WSA881X_MAX_SWR_PORTS))
+		dev_info(dev, "Static Port mapping not specified\n");
+
 	dev_set_drvdata(&pdev->dev, wsa881x);
 	wsa881x->slave = pdev;
 	wsa881x->dev = &pdev->dev;