summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKatsuhiro Suzuki <suzuki.katsuhiro@socionext.com>2018-06-11 17:32:12 +0900
committerMark Brown <broonie@kernel.org>2018-06-18 12:54:38 +0100
commit62c2c9fcac4341d306dda4cf400b77e7e124480a (patch)
tree139d75b4a37b204fc8925658778b67e02f5b74f6 /include
parentd5a1826c32fa2ec2b161a89df904c6977f7ec44c (diff)
downloadlinux-stable-62c2c9fcac4341d306dda4cf400b77e7e124480a.tar.gz
linux-stable-62c2c9fcac4341d306dda4cf400b77e7e124480a.tar.bz2
linux-stable-62c2c9fcac4341d306dda4cf400b77e7e124480a.zip
ASoC: simple-card-utils: move hp and mic detect gpios from simple-card
This patch moves headphone and microphone jack detection gpios from simple-card driver. It is preparing for using this feature from other drivers. Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/sound/simple_card_utils.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index 7e25afce6566..f82acef3b992 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -12,6 +12,11 @@
#include <sound/soc.h>
+#define asoc_simple_card_init_hp(card, sjack, prefix) \
+ asoc_simple_card_init_jack(card, sjack, 1, prefix)
+#define asoc_simple_card_init_mic(card, sjack, prefix) \
+ asoc_simple_card_init_jack(card, sjack, 0, prefix)
+
struct asoc_simple_dai {
const char *name;
unsigned int sysclk;
@@ -28,6 +33,12 @@ struct asoc_simple_card_data {
u32 convert_channels;
};
+struct asoc_simple_jack {
+ struct snd_soc_jack jack;
+ struct snd_soc_jack_pin pin;
+ struct snd_soc_jack_gpio gpio;
+};
+
int asoc_simple_card_parse_daifmt(struct device *dev,
struct device_node *node,
struct device_node *codec,
@@ -107,4 +118,8 @@ int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
int asoc_simple_card_of_parse_widgets(struct snd_soc_card *card,
char *prefix);
+int asoc_simple_card_init_jack(struct snd_soc_card *card,
+ struct asoc_simple_jack *sjack,
+ int is_hp, char *prefix);
+
#endif /* __SIMPLE_CARD_UTILS_H */