@@ -51,6 +51,8 @@ Optional dai-link subnode properties:
dai-link uses bit clock inversion.
- frame-inversion : bool property. Add this if the
dai-link uses frame clock inversion.
+- remote : DPCM phandle to backend DAI entry.
+ and this DAI will be frontend entry.
For backward compatibility the frame-master and bitclock-master
properties can be used as booleans in codec subnode to indicate if the
@@ -149,3 +151,36 @@ sound {
};
};
};
+
+Example 3 - DPCM:
+
+sound {
+ compatible = "simple-audio-card";
+
+ /* Front End <-> Back End route */
+ simple-audio-card,routing =
+ "yyy Playback", "xxx Playback",
+ "xxx Capture", "yyy Capture";
+
+ simple-audio-card,dai-link@0 { /* Front End */
+ ...
+ remote = <&backend>;
+
+ cpu {
+ sound-dai = <xxx>;
+ };
+ codec {
+ sound-dai = <xxx>;
+ };
+ };
+
+ backend: simple-audio-card,dai-link@1 { /* Back End */
+ ...
+ cpu {
+ sound-dai = <yyy>;
+ };
+ codec {
+ sound-dai = <yyy>;
+ };
+ };
+};
@@ -163,7 +163,8 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
return 0;
}
-static int asoc_simple_card_dai_link_of(struct device_node *node,
+static int asoc_simple_card_dai_link_of(struct device_node *parent_node,
+ struct device_node *node,
struct device *dev,
struct snd_soc_dai_link *dai_link,
struct simple_dai_props *dai_props,
@@ -276,6 +277,32 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
dai_link->ops = &asoc_simple_card_ops;
dai_link->init = asoc_simple_card_dai_init;
+ /* For DPCM */
+ if (parent_node) {
+ struct device_node *e;
+ struct device_node *h;
+
+ for_each_child_of_node(parent_node, e) {
+ h = of_parse_phandle(e, "remote", 0);
+ if (!h)
+ continue;
+
+ /* Front End */
+ if (e == node) {
+ dai_link->dynamic = 1;
+ dai_link->dpcm_playback = 1; /* FIXME */
+ dai_link->dpcm_capture = 1; /* FIXME */
+ }
+
+ /* Back End */
+ if (h == node) {
+ dai_link->no_pcm = 1;
+ dai_link->dpcm_playback = 1; /* FIXME */
+ dai_link->dpcm_capture = 1; /* FIXME */
+ }
+ }
+ }
+
dev_dbg(dev, "\tname : %s\n", dai_link->stream_name);
dev_dbg(dev, "\tcpu : %s / %04x / %d\n",
dai_link->cpu_dai_name,
@@ -350,7 +377,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
for_each_child_of_node(node, np) {
dev_dbg(dev, "\tlink %d:\n", i);
- ret = asoc_simple_card_dai_link_of(np, dev,
+ ret = asoc_simple_card_dai_link_of(node, np, dev,
dai_link + i,
dai_props + i,
false);
@@ -361,7 +388,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
i++;
}
} else {
- ret = asoc_simple_card_dai_link_of(node, dev,
+ ret = asoc_simple_card_dai_link_of(NULL, node, dev,
dai_link, dai_props, true);
if (ret < 0)
return ret;