public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt5682: Add option to select pulse IRQ in jack detect
@ 2019-12-20  6:12 Akshu Agrawal
  2019-12-23  6:26 ` kbuild test robot
  2019-12-23  7:58 ` [alsa-devel] " Shuming [范書銘]
  0 siblings, 2 replies; 4+ messages in thread
From: Akshu Agrawal @ 2019-12-20  6:12 UTC (permalink / raw)
  Cc: akshu.agrawal, yuhsuan, Bard Liao, Oder Chiou, Jaroslav Kysela,
	Takashi Iwai, Liam Girdwood, Mark Brown, moderated list:SOUND,
	open list

Some SoC need to set IRQ type as pulse along with other JD1 options.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
---
 include/sound/rt5682.h    | 1 +
 sound/soc/codecs/rt5682.c | 3 +++
 sound/soc/codecs/rt5682.h | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/include/sound/rt5682.h b/include/sound/rt5682.h
index bc2c31734df1..64cfa77ec9ee 100644
--- a/include/sound/rt5682.h
+++ b/include/sound/rt5682.h
@@ -22,6 +22,7 @@ enum rt5682_dmic1_clk_pin {
 enum rt5682_jd_src {
 	RT5682_JD_NULL,
 	RT5682_JD1,
+	RT5682_JD2,
 };
 
 struct rt5682_platform_data {
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index ae6f6121bc1b..5135d7757361 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -1009,6 +1009,9 @@ static int rt5682_set_jack_detect(struct snd_soc_component *component,
 	}
 
 	switch (rt5682->pdata.jd_src) {
+	case RT5682_JD2:
+		regmap_update_bits(rt5682->regmap, RT5682_IRQ_CTRL_2,
+			RT5682_JD1_PULSE_MASK, RT5682_JD1_PULSE_EN);
 	case RT5682_JD1:
 		snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_2,
 			RT5682_EXT_JD_SRC, RT5682_EXT_JD_SRC_MANUAL);
diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h
index 18faaa2a49a0..434b1c9778b2 100644
--- a/sound/soc/codecs/rt5682.h
+++ b/sound/soc/codecs/rt5682.h
@@ -1091,6 +1091,8 @@
 #define RT5682_JD1_POL_MASK			(0x1 << 13)
 #define RT5682_JD1_POL_NOR			(0x0 << 13)
 #define RT5682_JD1_POL_INV			(0x1 << 13)
+#define RT5682_JD1_PULSE_MASK			(0x1 << 10)
+#define RT5682_JD1_PULSE_EN			(0x1 << 10)
 
 /* IRQ Control 3 (0x00b8) */
 #define RT5682_IL_IRQ_MASK			(0x1 << 7)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-23  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-20  6:12 [PATCH] ASoC: rt5682: Add option to select pulse IRQ in jack detect Akshu Agrawal
2019-12-23  6:26 ` kbuild test robot
2019-12-23  7:58 ` [alsa-devel] " Shuming [范書銘]
2019-12-23  9:38   ` Agrawal, Akshu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox