summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/arizona.h
diff options
context:
space:
mode:
authorCharles Keepax2015-06-25 10:35:12 +0200
committerMark Brown2015-07-07 14:15:12 +0200
commit5f8e671a49e1d608fcf52c8944ea7818cd4c99a9 (patch)
tree8802ff671911422dd7866a21d5ebe56b900eac5d /sound/soc/codecs/arizona.h
parentASoC: arizona: Implement stability check for EQ coefficients (diff)
downloadkernel-qcow2-linux-5f8e671a49e1d608fcf52c8944ea7818cd4c99a9.tar.gz
kernel-qcow2-linux-5f8e671a49e1d608fcf52c8944ea7818cd4c99a9.tar.xz
kernel-qcow2-linux-5f8e671a49e1d608fcf52c8944ea7818cd4c99a9.zip
ASoC: arizona: Implement stability check for LHPF coefficients
Specifying unstable coefficients for the low/high pass filters can have a severe impact on the audio. This patchs adds a stability check on the coefficients written to the low/high pass filter block to prevent this. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/arizona.h')
-rw-r--r--sound/soc/codecs/arizona.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h
index ebe50cf2f878..13598b0572ee 100644
--- a/sound/soc/codecs/arizona.h
+++ b/sound/soc/codecs/arizona.h
@@ -201,6 +201,13 @@ extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS];
((unsigned long)&(struct soc_bytes) { .base = xbase, \
.num_regs = 20, .mask = ~ARIZONA_EQ1_B1_MODE }) }
+#define ARIZONA_LHPF_CONTROL(xname, xbase) \
+{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
+ .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
+ .put = arizona_lhpf_coeff_put, .private_value = \
+ ((unsigned long)&(struct soc_bytes) { .base = xbase, \
+ .num_regs = 1 }) }
+
#define ARIZONA_RATE_ENUM_SIZE 4
extern const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE];
extern const int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE];
@@ -238,6 +245,8 @@ extern int arizona_hp_ev(struct snd_soc_dapm_widget *w,
extern int arizona_eq_coeff_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
+extern int arizona_lhpf_coeff_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol);
extern int arizona_set_sysclk(struct snd_soc_codec *codec, int clk_id,
int source, unsigned int freq, int dir);