All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: Oder Chiou <oder_chiou@realtek.com>,
	Bard Liao <bardliao@realtek.com>,
	alsa-devel@alsa-project.org, Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH 3/4] ASoC: rt5645: add inv_jd1_1 flag
Date: Wed, 28 Jun 2017 14:49:38 +0200	[thread overview]
Message-ID: <20170628124939.11696-4-tiwai@suse.de> (raw)
In-Reply-To: <20170628124939.11696-1-tiwai@suse.de>

From: Bard Liao <bardliao@realtek.com>

The flag will invert jd1_1 status. Which will be used if the jack
connector is normal closed.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 include/sound/rt5645.h    | 2 ++
 sound/soc/codecs/rt5645.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/include/sound/rt5645.h b/include/sound/rt5645.h
index c427f10a39ae..d0c33a9972b9 100644
--- a/include/sound/rt5645.h
+++ b/include/sound/rt5645.h
@@ -23,6 +23,8 @@ struct rt5645_platform_data {
 	unsigned int jd_mode;
 	/* Use level triggered irq */
 	bool level_trigger_irq;
+	/* Invert JD1_1 status polarity */
+	bool inv_jd1_1;
 };
 
 #endif
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index e0c09bbd3f12..162044d82632 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3833,6 +3833,10 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
 		default:
 			break;
 		}
+		if (rt5645->pdata.inv_jd1_1) {
+			regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
+				RT5645_JD_1_1_MASK, RT5645_JD_1_1_INV);
+		}
 	}
 
 	regmap_update_bits(rt5645->regmap, RT5645_ADDA_CLK1,
-- 
2.13.2

  parent reply	other threads:[~2017-06-28 12:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28 12:49 [PATCH 0/4] ASoC: rt5645: GPD Win jack support Takashi Iwai
2017-06-28 12:49 ` [PATCH 1/4] ASoC: rt5645: read jd1_1 status for jd detection Takashi Iwai
2017-06-28 19:24   ` Applied "ASoC: rt5645: read jd1_1 status for jd detection" to the asoc tree Mark Brown
2017-06-28 12:49 ` [PATCH 2/4] ASoC: rt5645: rename jd_invert flag in platform data Takashi Iwai
2017-06-28 19:24   ` Applied "ASoC: rt5645: rename jd_invert flag in platform data" to the asoc tree Mark Brown
2017-06-28 12:49 ` Takashi Iwai [this message]
2017-06-28 19:24   ` Applied "ASoC: rt5645: add inv_jd1_1 flag" " Mark Brown
2017-06-28 12:49 ` [PATCH 4/4] ASoC: rt5645: Add jack detection workaround for GPD Win Takashi Iwai
2017-06-28 19:23   ` Applied "ASoC: rt5645: Add jack detection workaround for GPD Win" to the asoc tree Mark Brown
2017-06-28 21:07   ` [PATCH 4/4] ASoC: rt5645: Add jack detection workaround for GPD Win Pierre-Louis Bossart
2017-06-29  6:45     ` James Cameron
2017-06-29  7:06     ` Takashi Iwai
2017-06-29  8:10       ` Bard Liao

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=20170628124939.11696-4-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=oder_chiou@realtek.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.