Skip to content
Permalink
Browse files
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: f2138ae ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Thierry Reding authored and jonhunter committed Apr 16, 2021
1 parent 6d485e2 commit f126d514b77294bbc3e4fa49b095266e0154ff9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
@@ -115,10 +115,12 @@ struct asoc_simple_priv {
((codec) = simple_props_to_dai_codec(props, i)); \
(i)++)

#define SNDRV_MAX_LINKS 128

struct link_info {
int link; /* number of link */
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,
@@ -616,7 +616,7 @@ static int graph_count_noml(struct asoc_simple_priv *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");
return -EINVAL;
}
@@ -639,7 +639,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *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");
return -EINVAL;
}
@@ -484,7 +484,7 @@ static int simple_count_noml(struct asoc_simple_priv *priv,
struct device_node *codec,
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);

dev_err(dev, "too many links\n");
@@ -505,7 +505,7 @@ static int simple_count_dpcm(struct asoc_simple_priv *priv,
struct device_node *codec,
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);

dev_err(dev, "too many links\n");

0 comments on commit f126d51

Please sign in to comment.