Skip to content

Commit

Permalink
ASoC: Error out if we can't determine a suitable WM9081 sysclk
Browse files Browse the repository at this point in the history
Due to the flexibility of the WM9081 FLL this should never happen
in a real system.

Reported-by: Jaswinder Singh Rajput <jaswinder@kernel.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Jul 15, 2009
1 parent e465d54 commit 4b75e94
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sound/soc/codecs/wm9081.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,13 +707,21 @@ static int configure_clock(struct snd_soc_codec *codec)
target > 3000000)
break;
}

if (i == ARRAY_SIZE(clk_sys_rates))
return -EINVAL;

} else if (wm9081->fs) {
for (i = 0; i < ARRAY_SIZE(clk_sys_rates); i++) {
new_sysclk = clk_sys_rates[i].ratio
* wm9081->fs;
if (new_sysclk > 3000000)
break;
}

if (i == ARRAY_SIZE(clk_sys_rates))
return -EINVAL;

} else {
new_sysclk = 12288000;
}
Expand Down

0 comments on commit 4b75e94

Please sign in to comment.