ASoC: tas2764: Export highpass filter setting
authorMartin Povišer <povik+lin@cutebit.org>
Thu, 25 Aug 2022 14:02:41 +0000 (16:02 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 25 Aug 2022 17:00:00 +0000 (18:00 +0100)
Expose a control for the setting of 'DC blocker' highpass filter in the
playback path of TAS2764.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220825140241.53963-6-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2764.c
sound/soc/codecs/tas2764.h

index e99a46f..51b87a9 100644 (file)
@@ -593,11 +593,21 @@ static int tas2764_codec_probe(struct snd_soc_component *component)
 static DECLARE_TLV_DB_SCALE(tas2764_digital_tlv, 1100, 50, 0);
 static DECLARE_TLV_DB_SCALE(tas2764_playback_volume, -10050, 50, 1);
 
+static const char * const tas2764_hpf_texts[] = {
+       "Disabled", "2 Hz", "50 Hz", "100 Hz", "200 Hz",
+       "400 Hz", "800 Hz"
+};
+
+static SOC_ENUM_SINGLE_DECL(
+       tas2764_hpf_enum, TAS2764_DC_BLK0,
+       TAS2764_DC_BLK0_HPF_FREQ_PB_SHIFT, tas2764_hpf_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),
 };
 
 static const struct snd_soc_component_driver soc_component_driver_tas2764 = {
index 960b337..168af77 100644 (file)
 #define TAS2764_VSENSE_POWER_EN                3
 #define TAS2764_ISENSE_POWER_EN                4
 
+/* DC Blocker Control */
+#define TAS2764_DC_BLK0                        TAS2764_REG(0x0, 0x04)
+#define TAS2764_DC_BLK0_HPF_FREQ_PB_SHIFT  0
+
 /* Digital Volume Control */
 #define TAS2764_DVC    TAS2764_REG(0X0, 0x1a)
 #define TAS2764_DVC_MAX        0xc9