lkml.org 
[lkml]   [2022]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/5] ASoC: tas2764: Export highpass filter setting
Date
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>
---
sound/soc/codecs/tas2764.c | 10 ++++++++++
sound/soc/codecs/tas2764.h | 4 ++++
2 files changed, 14 insertions(+)

diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c
index e99a46fb503f..51b87a936179 100644
--- a/sound/soc/codecs/tas2764.c
+++ b/sound/soc/codecs/tas2764.c
@@ -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 = {
diff --git a/sound/soc/codecs/tas2764.h b/sound/soc/codecs/tas2764.h
index 960b337ed0fc..168af772a898 100644
--- a/sound/soc/codecs/tas2764.h
+++ b/sound/soc/codecs/tas2764.h
@@ -33,6 +33,10 @@
#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
--
2.33.0
\
 
 \ /
  Last update: 2022-08-25 16:05    [W:0.062 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site