diff options
author | Hans de Goede <hdegoede@redhat.com> | 2018-07-05 00:59:33 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-07-10 18:49:26 +0100 |
commit | df1569f2006b157caa944367d0d431eb4ea08624 (patch) | |
tree | d1a9d89d2d167409d5960aabea6dc459a1d9742e /sound/soc/codecs/rt5651.h | |
parent | 34c906ddacd237511808fb2bbd941e6b91e9095a (diff) | |
download | linux-df1569f2006b157caa944367d0d431eb4ea08624.tar.bz2 |
ASoC: rt5651: Add button press support
Enable button press detection for headsets by using the ovcd IRQ to get
notified of button presses.
This is modelled after (almost exactly copied from) the button press code
for the rt5640 which has identical ovcd hardware.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5651.h')
-rw-r--r-- | sound/soc/codecs/rt5651.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5651.h b/sound/soc/codecs/rt5651.h index 3a0968c53fde..ac6de6fb5414 100644 --- a/sound/soc/codecs/rt5651.h +++ b/sound/soc/codecs/rt5651.h @@ -2071,8 +2071,16 @@ struct rt5651_pll_code { struct rt5651_priv { struct snd_soc_component *component; struct regmap *regmap; + /* Jack and button detect data */ struct snd_soc_jack *hp_jack; struct work_struct jack_detect_work; + struct delayed_work bp_work; + bool ovcd_irq_enabled; + bool pressed; + bool press_reported; + int press_count; + int release_count; + int poll_count; unsigned int jd_src; unsigned int ovcd_th; unsigned int ovcd_sf; |