ASoC: rt5640: Add button press support

Enable button press detection for headsets by using the ovcd IRQ to get
notified of button presses.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Hans de Goede
2018-05-08 17:35:52 +02:00
committed by Mark Brown
parent 8210804bcf
commit b16188a20f
2 changed files with 159 additions and 7 deletions

View File

@@ -2139,7 +2139,14 @@ struct rt5640_priv {
bool hp_mute;
bool asrc_en;
/* Jack detect data */
/* Jack and button detect data */
bool ovcd_irq_enabled;
bool pressed;
bool press_reported;
int press_count;
int release_count;
int poll_count;
struct delayed_work bp_work;
struct work_struct jack_work;
struct snd_soc_jack *jack;
unsigned int jd_src;