On 2/17/20 9:10 AM, ojab // wrote:
On Thu, Jan 16, 2020 at 5:57 PM Mark Brown broonie@kernel.org wrote:
On Wed, Jan 15, 2020 at 07:04:48PM -0600, Pierre-Louis Bossart wrote:
Maybe we could have some sort of boolean flag in the component->driver definition and explicitly request a backwards-compatible behavior (e.g. for all SKL/KBL machine drivers) when that driver is known to be flaky. There's already things like 'fully_routed', maybe we can add something such as 'disable_route_check'?
A quirk for old stuff that can't be fixed sounds like a sensible solution to this.
Any update on this?
Sorry, this is what I had in mind (not even compile-tested). I don't know if the checks need to be disabled twice.
diff --git a/include/sound/soc.h b/include/sound/soc.h index f0e4f36f83bf..7a4643d87e39 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1058,6 +1058,7 @@ struct snd_soc_card { const struct snd_soc_dapm_route *of_dapm_routes; int num_of_dapm_routes; bool fully_routed; + bool disable_route_checks;
/* lists of probed devices belonging to this card */ struct list_head component_dev_list; diff --git a/sound/soc/intel/boards/skl_nau88l25_max98357a.c b/sound/soc/intel/boards/skl_nau88l25_max98357a.c index e6de3b28d840..b57f55731390 100644 --- a/sound/soc/intel/boards/skl_nau88l25_max98357a.c +++ b/sound/soc/intel/boards/skl_nau88l25_max98357a.c @@ -644,6 +644,7 @@ static struct snd_soc_card skylake_audio_card = { .num_dapm_routes = ARRAY_SIZE(skylake_map), .fully_routed = true, .late_probe = skylake_card_late_probe, + .disable_route_checks = true, };
static int skylake_audio_probe(struct platform_device *pdev) diff --git a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c index c99c8b23e509..8f3b724fec27 100644 --- a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c +++ b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c @@ -687,6 +687,7 @@ static struct snd_soc_card skylake_audio_card = { .num_configs = ARRAY_SIZE(ssm4567_codec_conf), .fully_routed = true, .late_probe = skylake_card_late_probe, + .disable_route_checks = true, };
static int skylake_audio_probe(struct platform_device *pdev) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 068d809c349a..d56cb655d89c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1257,7 +1257,10 @@ static int soc_probe_component(struct snd_soc_card *card, component->driver->dapm_routes, component->driver->num_dapm_routes); if (ret < 0) - goto err_probe; + if (card->disable_route_checks) + dev_info(component->dev, "Ignoring errors on snd_soc_dapm_add_routes\n"); + else + goto err_probe;
/* see for_each_card_components */ list_add(&component->card_list, &card->component_dev_list); @@ -1939,7 +1942,10 @@ static int snd_soc_bind_card(struct snd_soc_card *card) ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, card->num_dapm_routes); if (ret < 0) - goto probe_end; + if (card->disable_route_checks) + dev_info(component->dev, "Ignoring errors on snd_soc_dapm_add_routes\n"); + else + goto probe_end;
ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, card->num_of_dapm_routes);