summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5640.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-08-19 21:05:40 +0200
committerMark Brown <broonie@kernel.org>2021-08-19 23:27:57 +0100
commitd21213b4503ea66777313e4345e116cc8a5366bf (patch)
treec2876025627935da3e0b3b100e86ed01c954f0fe /sound/soc/codecs/rt5640.h
parent15d54840ecf6f00061d03180394a0a21ff8ffa48 (diff)
ASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset()
Some devices don't use the builtin jack-detect but can still benefit from the mic-bias-current over-current-detection headphones vs headset detection done by rt5640_detect_headset(). In this case the jack-inserted check done by rt5640_detect_headset() needs to be done through a GPIO rather then by using the codec's builtin jack-detect. Add an optional hp_det_gpio parameter and export rt5640_detect_headset() for use on machines where jack-detect is handled outside of the codec. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-4-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5640.h')
-rw-r--r--sound/soc/codecs/rt5640.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h
index 4fd47f2b936b..4d19997dd684 100644
--- a/sound/soc/codecs/rt5640.h
+++ b/sound/soc/codecs/rt5640.h
@@ -10,6 +10,7 @@
#define _RT5640_H
#include <linux/clk.h>
+#include <linux/gpio/consumer.h>
#include <linux/workqueue.h>
#include <dt-bindings/sound/rt5640.h>
@@ -2156,5 +2157,6 @@ int rt5640_dmic_enable(struct snd_soc_component *component,
bool dmic1_data_pin, bool dmic2_data_pin);
int rt5640_sel_asrc_clk_src(struct snd_soc_component *component,
unsigned int filter_mask, unsigned int clk_src);
+int rt5640_detect_headset(struct snd_soc_component *component, struct gpio_desc *hp_det_gpio);
#endif