summaryrefslogtreecommitdiffstats
path: root/include/sound/simple_card_utils.h
diff options
context:
space:
mode:
authorKatsuhiro Suzuki2018-06-11 10:32:12 +0200
committerMark Brown2018-06-18 13:54:38 +0200
commit62c2c9fcac4341d306dda4cf400b77e7e124480a (patch)
tree139d75b4a37b204fc8925658778b67e02f5b74f6 /include/sound/simple_card_utils.h
parentASoC: Intel: bytcr_rt5640: Add quirk for the Chuwi Vi10 tablet (diff)
downloadkernel-qcow2-linux-62c2c9fcac4341d306dda4cf400b77e7e124480a.tar.gz
kernel-qcow2-linux-62c2c9fcac4341d306dda4cf400b77e7e124480a.tar.xz
kernel-qcow2-linux-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/sound/simple_card_utils.h')
-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 */