Commit 343e55e7 authored by Thierry Reding's avatar Thierry Reding Committed by Mark Brown

ASoC: simple-card-utils: Increase maximum number of links to 128

On Tegra186 and later, the number of links can go up to 72, so bump the
maximum number of links to the next power of two (128).

Fixes: f2138aed ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210416071147.2149109-2-thierry.reding@gmail.comReviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0f687d82
...@@ -115,10 +115,12 @@ struct asoc_simple_priv { ...@@ -115,10 +115,12 @@ struct asoc_simple_priv {
((codec) = simple_props_to_dai_codec(props, i)); \ ((codec) = simple_props_to_dai_codec(props, i)); \
(i)++) (i)++)
#define SNDRV_MAX_LINKS 128
struct link_info { struct link_info {
int link; /* number of link */ int link; /* number of link */
int cpu; /* turn for CPU / Codec */ int cpu; /* turn for CPU / Codec */
struct prop_nums num[SNDRV_MINOR_DEVICES]; struct prop_nums num[SNDRV_MAX_LINKS];
}; };
int asoc_simple_parse_daifmt(struct device *dev, int asoc_simple_parse_daifmt(struct device *dev,
......
...@@ -619,7 +619,7 @@ static int graph_count_noml(struct asoc_simple_priv *priv, ...@@ -619,7 +619,7 @@ static int graph_count_noml(struct asoc_simple_priv *priv,
{ {
struct device *dev = simple_priv_to_dev(priv); struct device *dev = simple_priv_to_dev(priv);
if (li->link >= SNDRV_MINOR_DEVICES) { if (li->link >= SNDRV_MAX_LINKS) {
dev_err(dev, "too many links\n"); dev_err(dev, "too many links\n");
return -EINVAL; return -EINVAL;
} }
...@@ -642,7 +642,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv, ...@@ -642,7 +642,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
{ {
struct device *dev = simple_priv_to_dev(priv); struct device *dev = simple_priv_to_dev(priv);
if (li->link >= SNDRV_MINOR_DEVICES) { if (li->link >= SNDRV_MAX_LINKS) {
dev_err(dev, "too many links\n"); dev_err(dev, "too many links\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -482,7 +482,7 @@ static int simple_count_noml(struct asoc_simple_priv *priv, ...@@ -482,7 +482,7 @@ static int simple_count_noml(struct asoc_simple_priv *priv,
struct device_node *codec, struct device_node *codec,
struct link_info *li, bool is_top) struct link_info *li, bool is_top)
{ {
if (li->link >= SNDRV_MINOR_DEVICES) { if (li->link >= SNDRV_MAX_LINKS) {
struct device *dev = simple_priv_to_dev(priv); struct device *dev = simple_priv_to_dev(priv);
dev_err(dev, "too many links\n"); dev_err(dev, "too many links\n");
...@@ -503,7 +503,7 @@ static int simple_count_dpcm(struct asoc_simple_priv *priv, ...@@ -503,7 +503,7 @@ static int simple_count_dpcm(struct asoc_simple_priv *priv,
struct device_node *codec, struct device_node *codec,
struct link_info *li, bool is_top) struct link_info *li, bool is_top)
{ {
if (li->link >= SNDRV_MINOR_DEVICES) { if (li->link >= SNDRV_MAX_LINKS) {
struct device *dev = simple_priv_to_dev(priv); struct device *dev = simple_priv_to_dev(priv);
dev_err(dev, "too many links\n"); dev_err(dev, "too many links\n");
......
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