Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs530x: Check the DEVID matches the devtype

If the read device ID is not the expected devtype derived from the
compatible device match then fail the probe as other configuration
details may be incorrect.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://patch.msgid.link/20251023090327.58275-9-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Simon Trimmer and committed by
Mark Brown
c37c3e5e 3941abb2

+13 -7
+6
sound/soc/codecs/cs530x.c
··· 1181 1181 dev_id); 1182 1182 } 1183 1183 1184 + if (cs530x->devtype != dev_id) { 1185 + dev_err(dev, "Read device ID 0x%x is not the expected devtype 0x%x\n", 1186 + dev_id, cs530x->devtype); 1187 + return -EINVAL; 1188 + } 1189 + 1184 1190 dev_dbg(dev, "Device ID 0x%x Rev ID 0x%x (%d in %d out)\n", dev_id, rev, 1185 1191 cs530x->num_adcs, cs530x->num_dacs); 1186 1192
+7 -7
sound/soc/codecs/cs530x.h
··· 211 211 #define CS530X_NUM_SUPPLIES 2 212 212 213 213 enum cs530x_type { 214 - CS4282, 215 - CS4302, 216 - CS4304, 217 - CS4308, 218 - CS5302, 219 - CS5304, 220 - CS5308, 214 + CS4282 = CS530X_2CH_CODEC_DEV_ID, 215 + CS4302 = CS530X_2CH_DAC_DEV_ID, 216 + CS4304 = CS530X_4CH_DAC_DEV_ID, 217 + CS4308 = CS530X_8CH_DAC_DEV_ID, 218 + CS5302 = CS530X_2CH_ADC_DEV_ID, 219 + CS5304 = CS530X_4CH_ADC_DEV_ID, 220 + CS5308 = CS530X_8CH_ADC_DEV_ID, 221 221 }; 222 222 223 223 /* codec private data */