summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5640.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-01-06 12:01:26 +0100
committerMark Brown <broonie@kernel.org>2022-01-06 13:55:50 +0000
commit701d636a224a77a4371f57ca2d4322ab0401a866 (patch)
tree9512208d0bf7fb3a7dad83e291ad67ffde933c45 /sound/soc/codecs/rt5640.h
parentb35a9ab4904973a68b4473c2985b8ac0b6d57089 (diff)
ASoC: rt5640: Add support for boards with an external jack-detect GPIO
Some boards have the codec IRQ hooked-up as normally, so the driver can still do things like headset vs headphones and button-press detection, but instead of using one of the JD pins of the codec, an external GPIO is used to report the jack-presence switch status of the jack. Add support for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220106110128.66049-5-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.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h
index 2f4da5a8ecb2..9e49b9a0ccaa 100644
--- a/sound/soc/codecs/rt5640.h
+++ b/sound/soc/codecs/rt5640.h
@@ -2124,6 +2124,7 @@ struct rt5640_priv {
int ldo1_en; /* GPIO for LDO1_EN */
int irq;
+ int jd_gpio_irq;
int sysclk;
int sysclk_src;
int lrck[RT5640_AIFS];
@@ -2136,6 +2137,8 @@ struct rt5640_priv {
bool hp_mute;
bool asrc_en;
+ bool irq_requested;
+ bool jd_gpio_irq_requested;
/* Jack and button detect data */
bool ovcd_irq_enabled;
@@ -2147,6 +2150,7 @@ struct rt5640_priv {
struct delayed_work bp_work;
struct delayed_work jack_work;
struct snd_soc_jack *jack;
+ struct gpio_desc *jd_gpio;
unsigned int jd_src;
bool jd_inverted;
unsigned int ovcd_th;
@@ -2155,6 +2159,7 @@ struct rt5640_priv {
struct rt5640_set_jack_data {
int codec_irq_override;
+ struct gpio_desc *jd_gpio;
};
int rt5640_dmic_enable(struct snd_soc_component *component,