diff options
author | Xiubo Li <Li.Xiubo@freescale.com> | 2014-02-13 20:34:36 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-23 00:26:37 -0500 |
commit | 6ff62eedce4f7756b092d276165d8e11edab9f28 (patch) | |
tree | b52cfb38d78ce03aa49ac270d556b5d0e099c69f /sound/soc/generic | |
parent | ff2878644eed7765a917a02d0af864697ceaf73e (diff) |
ASoC: simple-card: add slot information parsing supports
For some CPU/CODEC DAI devices the slot information maybe needed. This
patch adds the slot information parsing for simple-card driver.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/simple-card.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 4fe8abc6e216..bdd176ddff07 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -9,11 +9,14 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | #include <linux/clk.h> | 11 | #include <linux/clk.h> |
12 | #include <linux/device.h> | ||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/of.h> | 14 | #include <linux/of.h> |
14 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
15 | #include <linux/string.h> | 16 | #include <linux/string.h> |
16 | #include <sound/simple_card.h> | 17 | #include <sound/simple_card.h> |
18 | #include <sound/soc-dai.h> | ||
19 | #include <sound/soc.h> | ||
17 | 20 | ||
18 | struct simple_card_data { | 21 | struct simple_card_data { |
19 | struct snd_soc_card snd_card; | 22 | struct snd_soc_card snd_card; |
@@ -44,6 +47,16 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, | |||
44 | } | 47 | } |
45 | } | 48 | } |
46 | 49 | ||
50 | if (set->slots) { | ||
51 | ret = snd_soc_dai_set_tdm_slot(dai, 0, 0, | ||
52 | set->slots, | ||
53 | set->slot_width); | ||
54 | if (ret && ret != -ENOTSUPP) { | ||
55 | dev_err(dai->dev, "simple-card: set_tdm_slot error\n"); | ||
56 | goto err; | ||
57 | } | ||
58 | } | ||
59 | |||
47 | ret = 0; | 60 | ret = 0; |
48 | 61 | ||
49 | err: | 62 | err: |
@@ -94,6 +107,11 @@ asoc_simple_card_sub_parse_of(struct device_node *np, | |||
94 | if (ret < 0) | 107 | if (ret < 0) |
95 | goto parse_error; | 108 | goto parse_error; |
96 | 109 | ||
110 | /* parse TDM slot */ | ||
111 | ret = snd_soc_of_parse_tdm_slot(np, &dai->slots, &dai->slot_width); | ||
112 | if (ret) | ||
113 | goto parse_error; | ||
114 | |||
97 | /* | 115 | /* |
98 | * bitclock-inversion, frame-inversion | 116 | * bitclock-inversion, frame-inversion |
99 | * bitclock-master, frame-master | 117 | * bitclock-master, frame-master |