]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: tas2764: Add control concerning overcurrent events
authorMartin Povišer <povik+lin@cutebit.org>
Thu, 27 Feb 2025 12:07:31 +0000 (22:07 +1000)
committerMark Brown <broonie@kernel.org>
Thu, 13 Mar 2025 22:39:02 +0000 (22:39 +0000)
Add control to expose the option of autoretry behavior on overcurrent
events in the codec.

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-4-cbb130030acf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2764.c
sound/soc/codecs/tas2764.h

index d9b4f898789fa9b59c94c97e3b130950b88c3a76..08aa7ee34256896915f3ed6438b8b8827ce240c7 100644 (file)
@@ -634,12 +634,21 @@ static SOC_ENUM_SINGLE_DECL(
        tas2764_hpf_enum, TAS2764_DC_BLK0,
        TAS2764_DC_BLK0_HPF_FREQ_PB_SHIFT, tas2764_hpf_texts);
 
+static const char * const tas2764_oce_texts[] = {
+       "Disable", "Retry",
+};
+
+static SOC_ENUM_SINGLE_DECL(
+       tas2764_oce_enum, TAS2764_MISC_CFG1,
+       TAS2764_MISC_CFG1_OCE_RETRY_SHIFT, tas2764_oce_texts);
+
 static const struct snd_kcontrol_new tas2764_snd_controls[] = {
        SOC_SINGLE_TLV("Speaker Volume", TAS2764_DVC, 0,
                       TAS2764_DVC_MAX, 1, tas2764_playback_volume),
        SOC_SINGLE_TLV("Amp Gain Volume", TAS2764_CHNL_0, 1, 0x14, 0,
                       tas2764_digital_tlv),
        SOC_ENUM("HPF Corner Frequency", tas2764_hpf_enum),
+       SOC_ENUM("OCE Handling", tas2764_oce_enum),
 };
 
 static const struct snd_soc_component_driver soc_component_driver_tas2764 = {
index 69c0f91cb423986f7f0ded0b2160927f024d957d..3251dc0106e07862dd69efd69fa0e40c3858ecb7 100644 (file)
 
 #define TAS2764_CHNL_0  TAS2764_REG(0X0, 0x03)
 
+/* Miscellaneous */
+#define TAS2764_MISC_CFG1              TAS2764_REG(0x0, 0x06)
+#define TAS2764_MISC_CFG1_OCE_RETRY_SHIFT  5
+
 /* TDM Configuration Reg0 */
 #define TAS2764_TDM_CFG0               TAS2764_REG(0X0, 0x08)
 #define TAS2764_TDM_CFG0_SMP_MASK      BIT(5)