diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-02-21 02:34:20 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-21 04:58:47 -0500 |
commit | 3b8a079516328c06a50396dbe36a0b9f4ea4e9d4 (patch) | |
tree | b3e14a3f9fd81bb5843eb8584c4485a76b8deaf7 /sound/soc/codecs/twl4030.c | |
parent | 26422625d55d94f60e48fa62e05f3b5aa5ad98f4 (diff) |
ASoC: twl4030: Debug code cleanup
Replace the printk(KERN_ERR* instances with dev_err in the driver.
While we are here clean up some of the debug messages as well.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl4030.c')
-rw-r--r-- | sound/soc/codecs/twl4030.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index d7eee0d502e0..170cf9a8fc79 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -1002,8 +1002,8 @@ static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol, | |||
1002 | unsigned short mask, bitmask; | 1002 | unsigned short mask, bitmask; |
1003 | 1003 | ||
1004 | if (twl4030->configured) { | 1004 | if (twl4030->configured) { |
1005 | printk(KERN_ERR "twl4030 operation mode cannot be " | 1005 | dev_err(codec->dev, |
1006 | "changed on-the-fly\n"); | 1006 | "operation mode cannot be changed on-the-fly\n"); |
1007 | return -EBUSY; | 1007 | return -EBUSY; |
1008 | } | 1008 | } |
1009 | 1009 | ||
@@ -1800,7 +1800,7 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream, | |||
1800 | mode |= TWL4030_APLL_RATE_96000; | 1800 | mode |= TWL4030_APLL_RATE_96000; |
1801 | break; | 1801 | break; |
1802 | default: | 1802 | default: |
1803 | printk(KERN_ERR "TWL4030 hw params: unknown rate %d\n", | 1803 | dev_err(codec->dev, "%s: unknown rate %d\n", __func__, |
1804 | params_rate(params)); | 1804 | params_rate(params)); |
1805 | return -EINVAL; | 1805 | return -EINVAL; |
1806 | } | 1806 | } |
@@ -1817,7 +1817,7 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream, | |||
1817 | format |= TWL4030_DATA_WIDTH_32S_24W; | 1817 | format |= TWL4030_DATA_WIDTH_32S_24W; |
1818 | break; | 1818 | break; |
1819 | default: | 1819 | default: |
1820 | printk(KERN_ERR "TWL4030 hw params: unknown format %d\n", | 1820 | dev_err(codec->dev, "%s: unknown format %d\n", __func__, |
1821 | params_format(params)); | 1821 | params_format(params)); |
1822 | return -EINVAL; | 1822 | return -EINVAL; |
1823 | } | 1823 | } |
@@ -1867,13 +1867,13 @@ static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
1867 | case 38400000: | 1867 | case 38400000: |
1868 | break; | 1868 | break; |
1869 | default: | 1869 | default: |
1870 | dev_err(codec->dev, "Unsupported APLL mclk: %u\n", freq); | 1870 | dev_err(codec->dev, "Unsupported HFCLKIN: %u\n", freq); |
1871 | return -EINVAL; | 1871 | return -EINVAL; |
1872 | } | 1872 | } |
1873 | 1873 | ||
1874 | if ((freq / 1000) != twl4030->sysclk) { | 1874 | if ((freq / 1000) != twl4030->sysclk) { |
1875 | dev_err(codec->dev, | 1875 | dev_err(codec->dev, |
1876 | "Mismatch in APLL mclk: %u (configured: %u)\n", | 1876 | "Mismatch in HFCLKIN: %u (configured: %u)\n", |
1877 | freq, twl4030->sysclk * 1000); | 1877 | freq, twl4030->sysclk * 1000); |
1878 | return -EINVAL; | 1878 | return -EINVAL; |
1879 | } | 1879 | } |
@@ -1983,9 +1983,9 @@ static int twl4030_voice_startup(struct snd_pcm_substream *substream, | |||
1983 | * not available. | 1983 | * not available. |
1984 | */ | 1984 | */ |
1985 | if (twl4030->sysclk != 26000) { | 1985 | if (twl4030->sysclk != 26000) { |
1986 | dev_err(codec->dev, "The board is configured for %u Hz, while" | 1986 | dev_err(codec->dev, |
1987 | "the Voice interface needs 26MHz APLL mclk\n", | 1987 | "%s: HFCLKIN is %u KHz, voice interface needs 26MHz\n", |
1988 | twl4030->sysclk * 1000); | 1988 | __func__, twl4030->sysclk); |
1989 | return -EINVAL; | 1989 | return -EINVAL; |
1990 | } | 1990 | } |
1991 | 1991 | ||
@@ -1996,8 +1996,8 @@ static int twl4030_voice_startup(struct snd_pcm_substream *substream, | |||
1996 | & TWL4030_OPT_MODE; | 1996 | & TWL4030_OPT_MODE; |
1997 | 1997 | ||
1998 | if (mode != TWL4030_OPTION_2) { | 1998 | if (mode != TWL4030_OPTION_2) { |
1999 | printk(KERN_ERR "TWL4030 voice startup: " | 1999 | dev_err(codec->dev, "%s: the codec mode is not option2\n", |
2000 | "the codec mode is not option2\n"); | 2000 | __func__); |
2001 | return -EINVAL; | 2001 | return -EINVAL; |
2002 | } | 2002 | } |
2003 | 2003 | ||
@@ -2038,7 +2038,7 @@ static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, | |||
2038 | mode |= TWL4030_SEL_16K; | 2038 | mode |= TWL4030_SEL_16K; |
2039 | break; | 2039 | break; |
2040 | default: | 2040 | default: |
2041 | printk(KERN_ERR "TWL4030 voice hw params: unknown rate %d\n", | 2041 | dev_err(codec->dev, "%s: unknown rate %d\n", __func__, |
2042 | params_rate(params)); | 2042 | params_rate(params)); |
2043 | return -EINVAL; | 2043 | return -EINVAL; |
2044 | } | 2044 | } |
@@ -2067,13 +2067,14 @@ static int twl4030_voice_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
2067 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 2067 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
2068 | 2068 | ||
2069 | if (freq != 26000000) { | 2069 | if (freq != 26000000) { |
2070 | dev_err(codec->dev, "Unsupported APLL mclk: %u, the Voice" | 2070 | dev_err(codec->dev, |
2071 | "interface needs 26MHz APLL mclk\n", freq); | 2071 | "%s: HFCLKIN is %u KHz, voice interface needs 26MHz\n", |
2072 | __func__, freq / 1000); | ||
2072 | return -EINVAL; | 2073 | return -EINVAL; |
2073 | } | 2074 | } |
2074 | if ((freq / 1000) != twl4030->sysclk) { | 2075 | if ((freq / 1000) != twl4030->sysclk) { |
2075 | dev_err(codec->dev, | 2076 | dev_err(codec->dev, |
2076 | "Mismatch in APLL mclk: %u (configured: %u)\n", | 2077 | "Mismatch in HFCLKIN: %u (configured: %u)\n", |
2077 | freq, twl4030->sysclk * 1000); | 2078 | freq, twl4030->sysclk * 1000); |
2078 | return -EINVAL; | 2079 | return -EINVAL; |
2079 | } | 2080 | } |
@@ -2221,7 +2222,7 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec) | |||
2221 | 2222 | ||
2222 | twl4030 = kzalloc(sizeof(struct twl4030_priv), GFP_KERNEL); | 2223 | twl4030 = kzalloc(sizeof(struct twl4030_priv), GFP_KERNEL); |
2223 | if (twl4030 == NULL) { | 2224 | if (twl4030 == NULL) { |
2224 | printk("Can not allocate memory\n"); | 2225 | dev_err(codec->dev, "Can not allocate memory\n"); |
2225 | return -ENOMEM; | 2226 | return -ENOMEM; |
2226 | } | 2227 | } |
2227 | snd_soc_codec_set_drvdata(codec, twl4030); | 2228 | snd_soc_codec_set_drvdata(codec, twl4030); |