Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1381355

[PATCH 1/3] ASoC: jack: Add a jack detect callback via codec

From Xing Zheng <zhengxing@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec
Date 2016-04-18 10:20 +0200
Message-ID <rpczw-2aB-7@gated-at.bofh.it> (permalink)
References <rpczv-2aB-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] Add support simple-card parse jack detection via external codec Xing Zheng <zhengxing@rock-chips.com> - 2016-04-18 10:20 +0200
  [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Xing Zheng <zhengxing@rock-chips.com> - 2016-04-18 10:20 +0200
    Re: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Mark Brown <broonie@kernel.org> - 2016-04-18 11:30 +0200
      Re: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Xing Zheng <zhengxing@rock-chips.com> - 2016-04-18 11:50 +0200
        Re: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Mark Brown <broonie@kernel.org> - 2016-04-18 12:00 +0200
          Re: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Xing Zheng <zhengxing@rock-chips.com> - 2016-04-18 12:10 +0200
            Re: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Xing Zheng <zhengxing@rock-chips.com> - 2016-04-18 12:30 +0200
              Re: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Mark Brown <broonie@kernel.org> - 2016-04-18 13:50 +0200
                Re: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec Dylan Reid <dgreid@chromium.org> - 2016-04-18 18:50 +0200
  [PATCH 2/3] ASoC: simple-card: Add support jack detection via codec Xing Zheng <zhengxing@rock-chips.com> - 2016-04-18 10:20 +0200
    Re: [PATCH 2/3] ASoC: simple-card: Add support jack detection via  codec Rob Herring <robh@kernel.org> - 2016-04-21 16:20 +0200
      Re: [PATCH 2/3] ASoC: simple-card: Add support jack detection via  codec Xing Zheng <zhengxing@rock-chips.com> - 2016-04-22 03:20 +0200
        Re: [PATCH 2/3] ASoC: simple-card: Add support jack detection via  codec Mark Brown <broonie@kernel.org> - 2016-04-22 11:30 +0200
          Re: [alsa-devel] [PATCH 2/3] ASoC: simple-card: Add support jack detection via codec Jeremy McDermond <nh6z@nh6z.net> - 2016-04-22 18:50 +0200
          Re: [alsa-devel] [PATCH 2/3] ASoC: simple-card: Add support jack detection via codec Jeremy McDermond <mcdermj@xenotropic.com> - 2016-04-22 18:50 +0200
            Re: [alsa-devel] [PATCH 2/3] ASoC: simple-card: Add support jack  detection via codec Mark Brown <broonie@kernel.org> - 2016-04-25 15:00 +0200
              Re: [alsa-devel] [PATCH 2/3] ASoC: simple-card: Add support jack detection via codec Jeremy McDermond <nh6z@nh6z.net> - 2016-04-25 20:20 +0200
  [PATCH 3/3] ASoC: da7219: Add detect_jack callback in the snd_soc_codec_driver Xing Zheng <zhengxing@rock-chips.com> - 2016-04-18 10:20 +0200

csiph-web