Commit ce7344a4 authored by Nicolin Chen's avatar Nicolin Chen Committed by Mark Brown

ASoC: fsl_sai: Make Synchronous and Asynchronous modes exclusive

The previous patch (ASoC: fsl_sai: Add asynchronous mode support) added
new Device Tree bindings for Asynchronous and Synchronous modes support.
However, these two shall not be present at the same time.

So this patch just simply makes them exclusive so as to avoid incorrect
Device Tree binding usage.
Signed-off-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 08fdf65e
...@@ -38,8 +38,7 @@ Note: ...@@ -38,8 +38,7 @@ Note:
default synchronous mode (sync Rx with Tx) will be used, which means both default synchronous mode (sync Rx with Tx) will be used, which means both
transimitter and receiver will send and receive data by following clocks transimitter and receiver will send and receive data by following clocks
of transimitter. of transimitter.
- fsl,sai-asynchronous will be ignored if fsl,sai-synchronous-rx property is - fsl,sai-asynchronous and fsl,sai-synchronous-rx are exclusive.
already present.
Example: Example:
sai2: sai@40031000 { sai2: sai@40031000 {
......
...@@ -634,6 +634,13 @@ static int fsl_sai_probe(struct platform_device *pdev) ...@@ -634,6 +634,13 @@ static int fsl_sai_probe(struct platform_device *pdev)
fsl_sai_dai.symmetric_channels = 1; fsl_sai_dai.symmetric_channels = 1;
fsl_sai_dai.symmetric_samplebits = 1; fsl_sai_dai.symmetric_samplebits = 1;
if (of_find_property(np, "fsl,sai-synchronous-rx", NULL) &&
of_find_property(np, "fsl,sai-asynchronous", NULL)) {
/* error out if both synchronous and asynchronous are present */
dev_err(&pdev->dev, "invalid binding for synchronous mode\n");
return -EINVAL;
}
if (of_find_property(np, "fsl,sai-synchronous-rx", NULL)) { if (of_find_property(np, "fsl,sai-synchronous-rx", NULL)) {
/* Sync Rx with Tx */ /* Sync Rx with Tx */
sai->synchronous[RX] = false; sai->synchronous[RX] = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment