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: tas2770: Factor out set_ivsense_slots

Add a new explicit function for the setting of I/V sense TDM slots.

Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20250227-apple-codec-changes-v3-5-cbb130030acf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Martin Povišer and committed by
Mark Brown
6553ee02 f8d5f28e

+27 -13
+27 -13
sound/soc/codecs/tas2770.c
··· 189 189 return tas2770_update_pwr_ctrl(tas2770); 190 190 } 191 191 192 + static int tas2770_set_ivsense_transmit(struct tas2770_priv *tas2770, 193 + int i_slot, int v_slot) 194 + { 195 + struct snd_soc_component *component = tas2770->component; 196 + int ret; 197 + 198 + ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG5, 199 + TAS2770_TDM_CFG_REG5_VSNS_MASK | 200 + TAS2770_TDM_CFG_REG5_50_MASK, 201 + TAS2770_TDM_CFG_REG5_VSNS_ENABLE | 202 + v_slot); 203 + if (ret < 0) 204 + return ret; 205 + 206 + ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG6, 207 + TAS2770_TDM_CFG_REG6_ISNS_MASK | 208 + TAS2770_TDM_CFG_REG6_50_MASK, 209 + TAS2770_TDM_CFG_REG6_ISNS_ENABLE | 210 + i_slot); 211 + if (ret < 0) 212 + return ret; 213 + 214 + return 0; 215 + } 216 + 192 217 static int tas2770_set_bitwidth(struct tas2770_priv *tas2770, int bitwidth) 193 218 { 194 219 int ret; ··· 246 221 if (ret < 0) 247 222 return ret; 248 223 249 - ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG5, 250 - TAS2770_TDM_CFG_REG5_VSNS_MASK | 251 - TAS2770_TDM_CFG_REG5_50_MASK, 252 - TAS2770_TDM_CFG_REG5_VSNS_ENABLE | 253 - tas2770->v_sense_slot); 254 - if (ret < 0) 255 - return ret; 256 - 257 - ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG6, 258 - TAS2770_TDM_CFG_REG6_ISNS_MASK | 259 - TAS2770_TDM_CFG_REG6_50_MASK, 260 - TAS2770_TDM_CFG_REG6_ISNS_ENABLE | 261 - tas2770->i_sense_slot); 224 + ret = tas2770_set_ivsense_transmit(tas2770, tas2770->i_sense_slot, 225 + tas2770->v_sense_slot); 262 226 if (ret < 0) 263 227 return ret; 264 228