diff options
author | Mark Brown <broonie@kernel.org> | 2019-04-04 04:07:34 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-04-04 04:07:34 -0400 |
commit | 072cb68a43663eacae7fe84dcbfd1a81dc692185 (patch) | |
tree | 95107e9ba2b85f6aabee0c830603a2cc48d32d07 /sound/soc/generic | |
parent | 252163a66a06859f468ef1e00fa5a1f377b16eed (diff) | |
parent | 86a7b6ffd90095d81d9fa0d8b48955b7c83b2e2f (diff) |
Merge branch 'asoc-5.1' into asoc-5.2
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/audio-graph-card.c | 11 | ||||
-rw-r--r-- | sound/soc/generic/simple-card.c | 12 |
2 files changed, 17 insertions, 6 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 8114b5ea9319..ec7e673ba475 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
21 | #include <sound/simple_card_utils.h> | 21 | #include <sound/simple_card_utils.h> |
22 | 22 | ||
23 | #define DPCM_SELECTABLE 1 | ||
24 | |||
23 | #define PREFIX "audio-graph-card," | 25 | #define PREFIX "audio-graph-card," |
24 | 26 | ||
25 | static int graph_outdrv_event(struct snd_soc_dapm_widget *w, | 27 | static int graph_outdrv_event(struct snd_soc_dapm_widget *w, |
@@ -415,6 +417,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, | |||
415 | struct device_node *codec_port; | 417 | struct device_node *codec_port; |
416 | struct device_node *codec_port_old = NULL; | 418 | struct device_node *codec_port_old = NULL; |
417 | struct asoc_simple_data adata; | 419 | struct asoc_simple_data adata; |
420 | uintptr_t dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); | ||
418 | int rc, ret; | 421 | int rc, ret; |
419 | 422 | ||
420 | /* loop for all listed CPU port */ | 423 | /* loop for all listed CPU port */ |
@@ -445,8 +448,9 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, | |||
445 | * if Codec port has many endpoints, | 448 | * if Codec port has many endpoints, |
446 | * or has convert-xxx property | 449 | * or has convert-xxx property |
447 | */ | 450 | */ |
448 | if ((of_get_child_count(codec_port) > 1) || | 451 | if (dpcm_selectable && |
449 | adata.convert_rate || adata.convert_channels) | 452 | ((of_get_child_count(codec_port) > 1) || |
453 | adata.convert_rate || adata.convert_channels)) | ||
450 | ret = func_dpcm(priv, cpu_ep, codec_ep, li, | 454 | ret = func_dpcm(priv, cpu_ep, codec_ep, li, |
451 | (codec_port_old == codec_port)); | 455 | (codec_port_old == codec_port)); |
452 | /* else normal sound */ | 456 | /* else normal sound */ |
@@ -679,7 +683,8 @@ static int graph_remove(struct platform_device *pdev) | |||
679 | 683 | ||
680 | static const struct of_device_id graph_of_match[] = { | 684 | static const struct of_device_id graph_of_match[] = { |
681 | { .compatible = "audio-graph-card", }, | 685 | { .compatible = "audio-graph-card", }, |
682 | { .compatible = "audio-graph-scu-card", }, | 686 | { .compatible = "audio-graph-scu-card", |
687 | .data = (void *)DPCM_SELECTABLE }, | ||
683 | {}, | 688 | {}, |
684 | }; | 689 | }; |
685 | MODULE_DEVICE_TABLE(of, graph_of_match); | 690 | MODULE_DEVICE_TABLE(of, graph_of_match); |
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index dd9ac60d61f1..335ead0cbb8a 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -9,12 +9,15 @@ | |||
9 | #include <linux/device.h> | 9 | #include <linux/device.h> |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/of.h> | 11 | #include <linux/of.h> |
12 | #include <linux/of_device.h> | ||
12 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
13 | #include <linux/string.h> | 14 | #include <linux/string.h> |
14 | #include <sound/simple_card.h> | 15 | #include <sound/simple_card.h> |
15 | #include <sound/soc-dai.h> | 16 | #include <sound/soc-dai.h> |
16 | #include <sound/soc.h> | 17 | #include <sound/soc.h> |
17 | 18 | ||
19 | #define DPCM_SELECTABLE 1 | ||
20 | |||
18 | #define DAI "sound-dai" | 21 | #define DAI "sound-dai" |
19 | #define CELL "#sound-dai-cells" | 22 | #define CELL "#sound-dai-cells" |
20 | #define PREFIX "simple-audio-card," | 23 | #define PREFIX "simple-audio-card," |
@@ -349,6 +352,7 @@ static int simple_for_each_link(struct asoc_simple_priv *priv, | |||
349 | struct device *dev = simple_priv_to_dev(priv); | 352 | struct device *dev = simple_priv_to_dev(priv); |
350 | struct device_node *top = dev->of_node; | 353 | struct device_node *top = dev->of_node; |
351 | struct device_node *node; | 354 | struct device_node *node; |
355 | uintptr_t dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); | ||
352 | bool is_top = 0; | 356 | bool is_top = 0; |
353 | int ret = 0; | 357 | int ret = 0; |
354 | 358 | ||
@@ -388,8 +392,9 @@ static int simple_for_each_link(struct asoc_simple_priv *priv, | |||
388 | * if it has many CPUs, | 392 | * if it has many CPUs, |
389 | * or has convert-xxx property | 393 | * or has convert-xxx property |
390 | */ | 394 | */ |
391 | if (num > 2 || | 395 | if (dpcm_selectable && |
392 | adata.convert_rate || adata.convert_channels) | 396 | (num > 2 || |
397 | adata.convert_rate || adata.convert_channels)) | ||
393 | ret = func_dpcm(priv, np, codec, li, is_top); | 398 | ret = func_dpcm(priv, np, codec, li, is_top); |
394 | /* else normal sound */ | 399 | /* else normal sound */ |
395 | else | 400 | else |
@@ -705,7 +710,8 @@ static int simple_remove(struct platform_device *pdev) | |||
705 | 710 | ||
706 | static const struct of_device_id simple_of_match[] = { | 711 | static const struct of_device_id simple_of_match[] = { |
707 | { .compatible = "simple-audio-card", }, | 712 | { .compatible = "simple-audio-card", }, |
708 | { .compatible = "simple-scu-audio-card", }, | 713 | { .compatible = "simple-scu-audio-card", |
714 | .data = (void *)DPCM_SELECTABLE }, | ||
709 | {}, | 715 | {}, |
710 | }; | 716 | }; |
711 | MODULE_DEVICE_TABLE(of, simple_of_match); | 717 | MODULE_DEVICE_TABLE(of, simple_of_match); |