diff options
author | Mark Brown <broonie@kernel.org> | 2019-04-04 15:07:34 +0700 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-04-04 15:07:34 +0700 |
commit | 072cb68a43663eacae7fe84dcbfd1a81dc692185 (patch) | |
tree | 95107e9ba2b85f6aabee0c830603a2cc48d32d07 /sound/soc/generic | |
parent | 252163a66a06859f468ef1e00fa5a1f377b16eed (diff) | |
parent | 86a7b6ffd90095d81d9fa0d8b48955b7c83b2e2f (diff) | |
download | linux-072cb68a43663eacae7fe84dcbfd1a81dc692185.tar.gz linux-072cb68a43663eacae7fe84dcbfd1a81dc692185.tar.bz2 linux-072cb68a43663eacae7fe84dcbfd1a81dc692185.zip |
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 @@ #include <linux/string.h> #include <sound/simple_card_utils.h> +#define DPCM_SELECTABLE 1 + #define PREFIX "audio-graph-card," 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, struct device_node *codec_port; struct device_node *codec_port_old = NULL; struct asoc_simple_data adata; + uintptr_t dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); int rc, ret; /* loop for all listed CPU port */ @@ -445,8 +448,9 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, * if Codec port has many endpoints, * or has convert-xxx property */ - if ((of_get_child_count(codec_port) > 1) || - adata.convert_rate || adata.convert_channels) + if (dpcm_selectable && + ((of_get_child_count(codec_port) > 1) || + adata.convert_rate || adata.convert_channels)) ret = func_dpcm(priv, cpu_ep, codec_ep, li, (codec_port_old == codec_port)); /* else normal sound */ @@ -679,7 +683,8 @@ static int graph_remove(struct platform_device *pdev) static const struct of_device_id graph_of_match[] = { { .compatible = "audio-graph-card", }, - { .compatible = "audio-graph-scu-card", }, + { .compatible = "audio-graph-scu-card", + .data = (void *)DPCM_SELECTABLE }, {}, }; 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 @@ #include <linux/device.h> #include <linux/module.h> #include <linux/of.h> +#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/string.h> #include <sound/simple_card.h> #include <sound/soc-dai.h> #include <sound/soc.h> +#define DPCM_SELECTABLE 1 + #define DAI "sound-dai" #define CELL "#sound-dai-cells" #define PREFIX "simple-audio-card," @@ -349,6 +352,7 @@ static int simple_for_each_link(struct asoc_simple_priv *priv, struct device *dev = simple_priv_to_dev(priv); struct device_node *top = dev->of_node; struct device_node *node; + uintptr_t dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); bool is_top = 0; int ret = 0; @@ -388,8 +392,9 @@ static int simple_for_each_link(struct asoc_simple_priv *priv, * if it has many CPUs, * or has convert-xxx property */ - if (num > 2 || - adata.convert_rate || adata.convert_channels) + if (dpcm_selectable && + (num > 2 || + adata.convert_rate || adata.convert_channels)) ret = func_dpcm(priv, np, codec, li, is_top); /* else normal sound */ else @@ -705,7 +710,8 @@ static int simple_remove(struct platform_device *pdev) static const struct of_device_id simple_of_match[] = { { .compatible = "simple-audio-card", }, - { .compatible = "simple-scu-audio-card", }, + { .compatible = "simple-scu-audio-card", + .data = (void *)DPCM_SELECTABLE }, {}, }; MODULE_DEVICE_TABLE(of, simple_of_match); |