alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Xing Zheng <zhengxing@rock-chips.com>
To: linux-rockchip@lists.infradead.org
Cc: heiko@sntech.de, Adam.Thomson@diasemi.com,
	sugar.zhang@rock-chips.com, jay.xu@rock-chips.com,
	broonie@kernel.org, Xing Zheng <zhengxing@rock-chips.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec
Date: Mon, 18 Apr 2016 16:17:30 +0800	[thread overview]
Message-ID: <1460967452-24574-2-git-send-email-zhengxing@rock-chips.com> (raw)
In-Reply-To: <1460967452-24574-1-git-send-email-zhengxing@rock-chips.com>

This patch add a callback when a codec have the jack detect feature.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
---

 include/sound/soc.h  |    6 ++++++
 sound/soc/soc-jack.c |    8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 02b4a21..ff105a4 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -547,6 +547,10 @@ static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
 }
 #endif
 
+/* init jack detect via codec */
+void snd_soc_jack_codec_detect(struct snd_soc_codec *codec,
+				struct snd_soc_jack *jack);
+
 /* codec register bit access */
 int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
 				unsigned int mask, unsigned int value);
@@ -920,6 +924,8 @@ struct snd_soc_codec_driver {
 			     enum snd_soc_dapm_type, int);
 
 	bool ignore_pmdown_time;  /* Doesn't benefit from pmdown delay */
+
+	void (*detect_jack)(struct snd_soc_codec *codec, struct snd_soc_jack *jack);
 };
 
 /* SoC platform interface */
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index fbaa1bb..e292fb4 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -436,3 +436,11 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
 }
 EXPORT_SYMBOL_GPL(snd_soc_jack_free_gpios);
 #endif	/* CONFIG_GPIOLIB */
+
+void snd_soc_jack_codec_detect(struct snd_soc_codec *codec,
+				struct snd_soc_jack *jack)
+{
+	if (codec && codec->driver && codec->driver->detect_jack)
+		codec->driver->detect_jack(codec, jack);
+}
+EXPORT_SYMBOL_GPL(snd_soc_jack_codec_detect);
-- 
1.7.9.5

  reply	other threads:[~2016-04-18  8:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  8:17 [PATCH 0/3] Add support simple-card parse jack detection via external codec Xing Zheng
2016-04-18  8:17 ` Xing Zheng [this message]
     [not found]   ` <1460967452-24574-2-git-send-email-zhengxing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-04-18  9:22     ` [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Mark Brown
2016-04-18  9:43       ` Xing Zheng
     [not found]         ` <5714AC57.2070901-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-04-18  9:53           ` Mark Brown
2016-04-18 10:03             ` Xing Zheng
2016-04-18 10:20               ` Xing Zheng
     [not found]                 ` <5714B4D0.90406-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-04-18 11:46                   ` Mark Brown
2016-04-18 16:40                     ` Dylan Reid
2016-04-18  8:17 ` [PATCH 2/3] ASoC: simple-card: Add support jack detection " Xing Zheng
2016-04-21 14:19   ` Rob Herring
2016-04-22  1:17     ` Xing Zheng
     [not found]       ` <57197BBA.50304-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-04-22  9:22         ` Mark Brown
     [not found]           ` <20160422092250.GA3217-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-04-22 16:37             ` [alsa-devel] " Jeremy McDermond
2016-04-25 12:55               ` Mark Brown
     [not found]                 ` <20160425125504.GL3217-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-04-25 18:17                   ` [alsa-devel] " Jeremy McDermond
2016-04-22 16:40           ` Jeremy McDermond
2016-04-18  8:17 ` [PATCH 3/3] ASoC: da7219: Add detect_jack callback in the snd_soc_codec_driver Xing Zheng

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=1460967452-24574-2-git-send-email-zhengxing@rock-chips.com \
    --to=zhengxing@rock-chips.com \
    --cc=Adam.Thomson@diasemi.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=heiko@sntech.de \
    --cc=jay.xu@rock-chips.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=perex@perex.cz \
    --cc=sugar.zhang@rock-chips.com \
    --cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).