All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 5/5] ASoC: codecs: Add WCD939x Codec driver
@ 2023-12-05 17:45 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-12-05 17:45 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20231201-topic-sm8650-upstream-wcd939x-codec-v2-5-94ed814b25aa@linaro.org>
References: <20231201-topic-sm8650-upstream-wcd939x-codec-v2-5-94ed814b25aa@linaro.org>
TO: Neil Armstrong <neil.armstrong@linaro.org>
TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
TO: Banajit Goswami <bgoswami@quicinc.com>
TO: Andy Gross <agross@kernel.org>
TO: Bjorn Andersson <andersson@kernel.org>
TO: Konrad Dybcio <konrad.dybcio@linaro.org>
TO: Liam Girdwood <lgirdwood@gmail.com>
TO: Mark Brown <broonie@kernel.org>
TO: Rob Herring <robh+dt@kernel.org>
TO: Krzysztof Kozlowski <krzk@kernel.org>
TO: Conor Dooley <conor+dt@kernel.org>
TO: Jaroslav Kysela <perex@perex.cz>
TO: Takashi Iwai <tiwai@suse.com>
CC: linux-arm-msm@vger.kernel.org
CC: alsa-devel@alsa-project.org
CC: linux-sound@vger.kernel.org
CC: devicetree@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: Neil Armstrong <neil.armstrong@linaro.org>

Hi Neil,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on linus/master v6.7-rc4 next-20231205]
[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/Neil-Armstrong/ASoC-dt-bindings-document-WCD939x-Audio-Codec/20231202-000916
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/20231201-topic-sm8650-upstream-wcd939x-codec-v2-5-94ed814b25aa%40linaro.org
patch subject: [PATCH v2 5/5] ASoC: codecs: Add WCD939x Codec driver
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: powerpc64-randconfig-r081-20231204 (https://download.01.org/0day-ci/archive/20231206/202312060127.FLhplIP3-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231206/202312060127.FLhplIP3-lkp@intel.com/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 <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202312060127.FLhplIP3-lkp@intel.com/

New smatch warnings:
sound/soc/codecs/wcd939x.c:3168 wcd939x_typec_mux_set() error: 'wcd939x' dereferencing possible ERR_PTR()
sound/soc/codecs/wcd939x.c:3221 wcd939x_swap_gnd_mic() warn: signedness bug returning '(-22)'

Old smatch warnings:
sound/soc/codecs/wcd939x.c:3170 wcd939x_typec_mux_set() error: 'wcd939x' dereferencing possible ERR_PTR()
sound/soc/codecs/wcd939x.c:3173 wcd939x_typec_mux_set() error: 'wcd939x' dereferencing possible ERR_PTR()
sound/soc/codecs/wcd939x.c:3174 wcd939x_typec_mux_set() error: 'wcd939x' dereferencing possible ERR_PTR()
sound/soc/codecs/wcd939x.c:3176 wcd939x_typec_mux_set() error: 'wcd939x' dereferencing possible ERR_PTR()
sound/soc/codecs/wcd939x.c:3177 wcd939x_typec_mux_set() error: 'wcd939x' dereferencing possible ERR_PTR()
sound/soc/codecs/wcd939x.c:3179 wcd939x_typec_mux_set() error: 'wcd939x' dereferencing possible ERR_PTR()

vim +/wcd939x +3168 sound/soc/codecs/wcd939x.c

6c302e2f95b1d1 Neil Armstrong 2023-12-01  3163  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3164  static int wcd939x_typec_mux_set(struct typec_mux_dev *mux,
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3165  				 struct typec_mux_state *state)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3166  {
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3167  	struct wcd939x_priv *wcd939x = typec_mux_get_drvdata(mux);
6c302e2f95b1d1 Neil Armstrong 2023-12-01 @3168  	unsigned int previous_mode = wcd939x->typec_mode;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3169  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3170  	if (!wcd939x->wcd_mbhc)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3171  		return -EINVAL;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3172  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3173  	if (wcd939x->typec_mode != state->mode) {
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3174  		wcd939x->typec_mode = state->mode;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3175  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3176  		if (wcd939x->typec_mode == TYPEC_MODE_AUDIO)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3177  			return wcd_mbhc_typec_report_plug(wcd939x->wcd_mbhc);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3178  		else if (previous_mode == TYPEC_MODE_AUDIO)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3179  			return wcd_mbhc_typec_report_unplug(wcd939x->wcd_mbhc);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3180  	}
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3181  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3182  	return 0;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3183  }
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3184  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3185  static void wcd939x_dt_parse_micbias_info(struct device *dev, struct wcd939x_priv *wcd)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3186  {
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3187  	struct device_node *np = dev->of_node;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3188  	u32 prop_val = 0;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3189  	int rc = 0;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3190  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3191  	rc = of_property_read_u32(np, "qcom,micbias1-microvolt",  &prop_val);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3192  	if (!rc)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3193  		wcd->micb1_mv = prop_val / 1000;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3194  	else
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3195  		dev_info(dev, "%s: Micbias1 DT property not found\n", __func__);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3196  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3197  	rc = of_property_read_u32(np, "qcom,micbias2-microvolt",  &prop_val);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3198  	if (!rc)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3199  		wcd->micb2_mv = prop_val / 1000;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3200  	else
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3201  		dev_info(dev, "%s: Micbias2 DT property not found\n", __func__);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3202  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3203  	rc = of_property_read_u32(np, "qcom,micbias3-microvolt", &prop_val);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3204  	if (!rc)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3205  		wcd->micb3_mv = prop_val / 1000;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3206  	else
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3207  		dev_info(dev, "%s: Micbias3 DT property not found\n", __func__);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3208  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3209  	rc = of_property_read_u32(np, "qcom,micbias4-microvolt",  &prop_val);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3210  	if (!rc)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3211  		wcd->micb4_mv = prop_val / 1000;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3212  	else
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3213  		dev_info(dev, "%s: Micbias4 DT property not found\n", __func__);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3214  }
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3215  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3216  static bool wcd939x_swap_gnd_mic(struct snd_soc_component *component, bool active)
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3217  {
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3218  	struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3219  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3220  	if (!wcd939x->typec_analog_mux || !wcd939x->typec_switch)
6c302e2f95b1d1 Neil Armstrong 2023-12-01 @3221  		return -EINVAL;
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3222  
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3223  	/* Report inversion via Type Switch of USBSS */
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3224  	return typec_switch_set(wcd939x->typec_switch,
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3225  				wcd939x->typec_orientation == TYPEC_ORIENTATION_REVERSE ?
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3226  					TYPEC_ORIENTATION_NORMAL : TYPEC_ORIENTATION_REVERSE);
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3227  }
6c302e2f95b1d1 Neil Armstrong 2023-12-01  3228  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH v2 0/5] ASoC: codecs: add support for WCD939x Codec
@ 2023-12-01 15:08 Neil Armstrong
  2023-12-01 15:08 ` [PATCH v2 5/5] ASoC: codecs: Add WCD939x Codec driver Neil Armstrong
  0 siblings, 1 reply; 7+ messages in thread
From: Neil Armstrong @ 2023-12-01 15:08 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, alsa-devel, linux-sound, devicetree, linux-kernel,
	Neil Armstrong, Krzysztof Kozlowski

Add the main WCD9390/WCD9395 Audio Codec driver to support:
- 4 ADC inputs for up to 5 Analog Microphones
- 4 DMIC inputs for up to 8 Digital Microphones
- 4 Microphone BIAS
- Stereo Headphone output
- Mono EAR output
- MBHC engine for Headset Detection

This adds:
- bindings
- MBHC changes to support Type-C muc
- Soundwire Slave driver
- Code driver

The USB Mux subsystem support will be submitted separalety
since it's a functionally separate subsystem connected over
I2C with it's own reset signal.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v2:
- Bindings:
  - Dropped all references to "Slave" or "Host" terminology when possible
  - Collected review for first patch
  - Added wcd9395 as fallback of wcd9390
  - Fixes typos errors
- MBHC:
  - Dropped all references to "Slave" or "Host" terminology when possible
  - Fixed EXPORT_SYMBOL into EXPORT_SYMBOL_GPL
  - Fixed typo in commit message
- Soundwire Devices driver
  - Dropped all references to "Slave" or "Host" terminology when possible
  - Dropped comments and unused code
  - Reworked wcd939x_swr_get_current_bank()
  - Added comments to wcd9390_interrupt_callback()
  - Reworked regmap's wcd939x_readonly/volatile_register checks
  - Added comments explaining while bind/unbind are empty
  - Added comment on SDW_SLAVE_ENTRY meaning
  - Added more register fields defines
  - Style fixes
- Codec driver
  - Dropped all references to "Slave" or "Host" terminology when possible
  - Added MICB_BIAS_ values enum and used them in the code
  - Moved zdet_param to the top
  - Added TLV data for ear_pa_gain and used it
  - Defined as much as possible every bit field used on/from register
  - Replaced 1/0 to true/false when writing to single bit fields
  - Replaced for loop on all bits with ffs(), simplified code
  - Simplified MICB fields handling code
  - Reworked and simplified wcd939x_get/set_compander and other kcontrol get/setters
  - Reworked and simplified MHGC impedance/zdet/qval code, dropped dead code
  - Added comments on wcd939x_wd_handle_irq() utility
  - Added comment on the interrupt handling architecture
- I've not moved common code yet, I'll probably do later since it would alter wcd939x code
- Link to v1: https://lore.kernel.org/r/20231123-topic-sm8650-upstream-wcd939x-codec-v1-0-21d4ad9276de@linaro.org

---
Neil Armstrong (5):
      ASoC: dt-bindings: qcom,wcd938x: move out common properties
      ASoC: dt-bindings: document WCD939x Audio Codec
      ASoC: codec: wcd-mbhc-v2: add support when connected behind an USB-C audio mux
      ASoC: codecs: Add WCD939x Soundwire devices driver
      ASoC: codecs: Add WCD939x Codec driver

 .../devicetree/bindings/sound/qcom,wcd938x.yaml    |   81 +-
 .../bindings/sound/qcom,wcd939x-sdw.yaml           |   69 +
 .../devicetree/bindings/sound/qcom,wcd939x.yaml    |   96 +
 .../bindings/sound/qcom,wcd93xx-common.yaml        |   95 +
 sound/soc/codecs/Kconfig                           |   18 +
 sound/soc/codecs/Makefile                          |    7 +
 sound/soc/codecs/wcd-clsh-v2.h                     |    1 +
 sound/soc/codecs/wcd-mbhc-v2.c                     |   95 +-
 sound/soc/codecs/wcd-mbhc-v2.h                     |    3 +
 sound/soc/codecs/wcd939x-sdw.c                     | 1584 +++++++++
 sound/soc/codecs/wcd939x.c                         | 3655 ++++++++++++++++++++
 sound/soc/codecs/wcd939x.h                         |  983 ++++++
 12 files changed, 6592 insertions(+), 95 deletions(-)
---
base-commit: 07b677953b9dca02928be323e2db853511305fa9
change-id: 20231123-topic-sm8650-upstream-wcd939x-codec-c46f621b55d4

Best regards,
-- 
Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-06  8:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05 17:45 [PATCH v2 5/5] ASoC: codecs: Add WCD939x Codec driver kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-12-01 15:08 [PATCH v2 0/5] ASoC: codecs: add support for WCD939x Codec Neil Armstrong
2023-12-01 15:08 ` [PATCH v2 5/5] ASoC: codecs: Add WCD939x Codec driver Neil Armstrong
2023-12-05 17:12   ` kernel test robot
2023-12-05 17:22   ` kernel test robot
2023-12-06  5:39   ` Dan Carpenter
2023-12-06  8:10     ` Neil Armstrong
2023-12-06  7:10   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.