diff mbox

[06/49] ASoC: simple-card-core: add asoc_simple_card_parse_tdm()

Message ID 87d1ohrryw.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Kuninori Morimoto May 20, 2016, 9:42 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

simple-card is supporting TDM.
This patch makes this method simple style standard.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/simple_card_core.h     | 12 ++++++++++++
 sound/soc/generic/simple-card-core.c | 11 +++++++++++
 2 files changed, 23 insertions(+)
diff mbox

Patch

diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h
index 7acc798..6bb2c5f 100644
--- a/include/sound/simple_card_core.h
+++ b/include/sound/simple_card_core.h
@@ -12,10 +12,22 @@ 
 
 #include <sound/soc.h>
 
+struct asoc_simple_dai {
+	const char *name;
+	unsigned int sysclk;
+	int slots;
+	int slot_width;
+	unsigned int tx_slot_mask;
+	unsigned int rx_slot_mask;
+	struct clk *clk;
+};
+
 int asoc_simple_card_parse_daifmt(struct device *dev,
 				  struct device_node *node,
 				  struct device_node *codec,
 				  char *prefix,
 				  unsigned int *retfmt);
+int asoc_simple_card_parse_tdm(struct device_node *port_np,
+			       struct asoc_simple_dai *simple_dai);
 
 #endif /* __SIMPLE_CARD_CORE_H */
diff --git a/sound/soc/generic/simple-card-core.c b/sound/soc/generic/simple-card-core.c
index ddef5d1..e3536f4 100644
--- a/sound/soc/generic/simple-card-core.c
+++ b/sound/soc/generic/simple-card-core.c
@@ -52,3 +52,14 @@  int asoc_simple_card_parse_daifmt(struct device *dev,
 	return 0;
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_daifmt);
+
+int asoc_simple_card_parse_tdm(struct device_node *port_np,
+			       struct asoc_simple_dai *simple_dai)
+{
+	return snd_soc_of_parse_tdm_slot(port_np,
+					 &simple_dai->tx_slot_mask,
+					 &simple_dai->rx_slot_mask,
+					 &simple_dai->slots,
+					 &simple_dai->slot_width);
+}
+EXPORT_SYMBOL_GPL(asoc_simple_card_parse_tdm);