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: f2138aed23 ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210416071147.2149109-2-thierry.reding@gmail.com
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Thierry Reding 2021-04-16 09:11:47 +02:00 committed by Mark Brown
parent 0f687d8267
commit 343e55e718
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0
3 changed files with 7 additions and 5 deletions

View file

@ -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,

View file

@ -619,7 +619,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;
}
@ -642,7 +642,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;
}

View file

@ -482,7 +482,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");
@ -503,7 +503,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");