From 9dd90c5db0401061009183e6407feff3724ebc8b Mon Sep 17 00:00:00 2001 From: Rhyland Klein Date: Thu, 15 Mar 2012 15:07:47 -0700 Subject: ASoC: max98095: add jack detection This change adds the logic to support using the jack detect mechanism built in to the codec to detect both when a jack was inserted and what type of jack is present. This change also supports the use of an external mechanism for headphone detection. If this mechanism exists, when the max98095_jack_detect function is called, the hp_jack is simply passed NULL. This change supports both simple headphones, powered headphones, microphones and headsets with both headphones and a mic. Signed-off-by: Rhyland Klein Signed-off-by: Mark Brown --- include/sound/max98095.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/sound/max98095.h') diff --git a/include/sound/max98095.h b/include/sound/max98095.h index 7513a42..65b1c90 100644 --- a/include/sound/max98095.h +++ b/include/sound/max98095.h @@ -49,6 +49,18 @@ struct max98095_pdata { */ unsigned int digmic_left_mode:1; unsigned int digmic_right_mode:1; + + /* Pin5 is the mechanical method of sensing jack insertion + * but it is something that might not be supported. + * 0 = PIN5 not supported + * 1 = PIN5 supported + */ + int jack_detect_pin5en:1; + + /* Slew amount for jack detection. Calculated as 4 * (delay + 1). + * Default delay is 24 to get a time of 100ms. + */ + unsigned int jack_detect_delay; }; #endif -- cgit v1.1