Use dev_err()/dev_warn() instead of printk(KERN_ERR/KERN_WARNING. This is
common practice and makes it easy to find out which device generated the
message. While we are at it also align the error messages with the other
AC'97 drivers.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
* to allow rounding later */
#define FIXED_PLL_SIZE ((1 << 22) * 10)
* to allow rounding later */
#define FIXED_PLL_SIZE ((1 << 22) * 10)
-static void pll_factors(struct _pll_div *pll_div, unsigned int source)
+static void pll_factors(struct snd_soc_codec *codec,
+ struct _pll_div *pll_div, unsigned int source)
{
u64 Kpart;
unsigned int K, Ndiv, Nmod, target;
{
u64 Kpart;
unsigned int K, Ndiv, Nmod, target;
Ndiv = target / source;
if ((Ndiv < 5) || (Ndiv > 12))
Ndiv = target / source;
if ((Ndiv < 5) || (Ndiv > 12))
"WM9713 PLL N value %u out of recommended range!\n",
Ndiv);
"WM9713 PLL N value %u out of recommended range!\n",
Ndiv);
- pll_factors(&pll_div, freq_in);
+ pll_factors(codec, &pll_div, freq_in);
if (pll_div.k == 0) {
reg = (pll_div.n << 12) | (pll_div.lf << 11) |
if (pll_div.k == 0) {
reg = (pll_div.n << 12) | (pll_div.lf << 11) |
soc_ac97_ops->reset(codec->ac97);
if (soc_ac97_ops->warm_reset)
soc_ac97_ops->warm_reset(codec->ac97);
soc_ac97_ops->reset(codec->ac97);
if (soc_ac97_ops->warm_reset)
soc_ac97_ops->warm_reset(codec->ac97);
- if (ac97_read(codec, 0) != wm9713_reg[0])
+ if (ac97_read(codec, 0) != wm9713_reg[0]) {
+ dev_err(codec->dev, "Failed to reset: AC97 link error\n");
return 0;
}
EXPORT_SYMBOL_GPL(wm9713_reset);
return 0;
}
EXPORT_SYMBOL_GPL(wm9713_reset);
u16 *cache = codec->reg_cache;
ret = wm9713_reset(codec, 1);
u16 *cache = codec->reg_cache;
ret = wm9713_reset(codec, 1);
- if (ret < 0) {
- printk(KERN_ERR "could not reset AC97 codec\n");
wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
* a warm reset followed by an optional cold reset for codec */
wm9713_reset(codec, 0);
ret = wm9713_reset(codec, 1);
* a warm reset followed by an optional cold reset for codec */
wm9713_reset(codec, 0);
ret = wm9713_reset(codec, 1);
- if (ret < 0) {
- printk(KERN_ERR "Failed to reset WM9713: AC97 link error\n");
wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY);