From 19c45021c08f80a8e426a1a17c999f569fc9ed3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Wed, 10 Aug 2022 19:27:22 +0200 Subject: [PATCH] untested: ASoC: tas2764: Export highpass filter setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expose a control for the setting of 'DC blocker' highpass filter in the playback path of TAS2764. Signed-off-by: Martin PoviĊĦer --- sound/soc/codecs/tas2764.c | 10 ++++++++++ sound/soc/codecs/tas2764.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c index 4cb788f3e5f7..d1695cd420b5 100644 --- a/sound/soc/codecs/tas2764.c +++ b/sound/soc/codecs/tas2764.c @@ -130,6 +130,15 @@ static int tas2764_codec_resume(struct snd_soc_component *component) #define tas2764_codec_resume NULL #endif +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 char * const tas2764_ASI1_src[] = { "I2C offset", "Left", "Right", "LeftRightDiv2", }; @@ -543,6 +552,7 @@ static const struct snd_kcontrol_new tas2764_snd_controls[] = { 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 Freq", 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 f015f22a083b..ed1656149f3e 100644 --- a/sound/soc/codecs/tas2764.h +++ b/sound/soc/codecs/tas2764.h @@ -33,6 +33,9 @@ #define TAS2764_VSENSE_POWER_EN 3 #define TAS2764_ISENSE_POWER_EN 4 +#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.32.0 (Apple Git-132)