mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Akshu Agrawal <akshu.agrawal@amd.com>
To: unlisted-recipients:; (no To-header on input)
Cc: akshu.agrawal@amd.com, yuhsuan@chromium.org,
	Bard Liao <bardliao@realtek.com>,
	Oder Chiou <oder_chiou@realtek.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	alsa-devel@alsa-project.org (moderated list:SOUND),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] ASoC: rt5682: Add option to select pulse IRQ in jack detect
Date: Fri, 20 Dec 2019 11:42:19 +0530	[thread overview]
Message-ID: <20191220061220.229679-1-akshu.agrawal@amd.com> (raw)

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


             reply	other threads:[~2019-12-20  6:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20  6:12 Akshu Agrawal [this message]
2019-12-23  6:26 ` kbuild test robot
2019-12-23  7:58 ` [alsa-devel] " Shuming [范書銘]
2019-12-23  9:38   ` Agrawal, Akshu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191220061220.229679-1-akshu.agrawal@amd.com \
    --to=akshu.agrawal@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=yuhsuan@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®