Minor cleanups—no functional change.
diff --git a/sound/soc/omap/tonka.c b/sound/soc/omap/tonka.c
index e3a71ed..a19f506 100644
--- a/sound/soc/omap/tonka.c
+++ b/sound/soc/omap/tonka.c
@@ -23,7 +23,6 @@
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/module.h>
-#include <linux/i2c.h>
#include <sound/core.h>
#include <sound/pcm.h>
@@ -52,10 +51,10 @@
int ret = 0;
unsigned int channels, div;
- /* Codec input clock. */
+ /* Codec reference clock. */
ret = snd_soc_dai_set_sysclk(codec_dai, 0, 12000000, SND_SOC_CLOCK_IN);
if (unlikely(ret < 0)) {
- printk(KERN_ERR "can't set codec DAI clock\n");
+ dev_err(codec_dai->dev, "can't set reference clock\n");
return ret;
}
@@ -65,7 +64,7 @@
SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS);
if (unlikely(ret < 0)) {
- printk(KERN_ERR "can't set cpu DAI format\n");
+ dev_err(cpu_dai->dev, "can't set format\n");
return ret;
}
@@ -85,7 +84,7 @@
ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_FCLK,
24576000, SND_SOC_CLOCK_IN);
if (unlikely(ret < 0)) {
- printk(KERN_ERR "can't set cpu DAI clock\n");
+ dev_err(cpu_dai->dev, "can't set reference clock\n");
return ret;
}
@@ -97,23 +96,23 @@
div = 16;
break;
default:
- printk(KERN_ERR "unknown rate %d\n", params_rate(params));
+ dev_err(cpu_dai->dev, "unknown rate %d\n", params_rate(params));
return -EINVAL;
}
ret = snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV, div);
if (unlikely(ret < 0)) {
- printk(KERN_ERR "can't set cpu clock divider\n");
+ dev_err(cpu_dai->dev, "can't set clock divider\n");
return ret;
}
- return ret;
+ return 0;
}
static struct snd_soc_ops tonka_mcbsp_ops = {
.hw_params = tonka_mcbsp_hw_params,
};
-static int mcbsp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
+static int tonka_mcbsp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
struct snd_interval *channels = hw_param_interval(params,
@@ -187,13 +186,13 @@
};
static const struct snd_soc_dapm_route tonka_dapm_routes_speaker[] = {
- {"Line Out", NULL, "speaker LOUT"},
- {"Line Out", NULL, "speaker ROUT"},
- {"Headphone Jack", NULL, "speaker LHPOUT"},
- {"Headphone Jack", NULL, "speaker RHPOUT"},
- {"speaker LLINEIN", NULL, "Line In"},
- {"speaker RLINEIN", NULL, "Line In"},
- {"speaker MICIN", NULL, "Mic In"},
+ {"Line Out", NULL, "Speaker LOUT"},
+ {"Line Out", NULL, "Speaker ROUT"},
+ {"Headphone Jack", NULL, "Speaker LHPOUT"},
+ {"Headphone Jack", NULL, "Speaker RHPOUT"},
+ {"Speaker LLINEIN", NULL, "Line In"},
+ {"Speaker RLINEIN", NULL, "Line In"},
+ {"Speaker MICIN", NULL, "Mic In"},
};
static int tonka_speaker_init(struct snd_soc_pcm_runtime *rtd)
@@ -223,26 +222,26 @@
return 0;
}
-struct snd_soc_dsp_link fe_media = {
+static struct snd_soc_dsp_link fe_media = {
.playback = true,
.capture = true,
.trigger =
{SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE},
};
-struct snd_soc_dsp_link fe_media_capture = {
+static struct snd_soc_dsp_link fe_media_capture = {
.capture = true,
.trigger =
{SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE},
};
-struct snd_soc_dsp_link fe_tones = {
+static struct snd_soc_dsp_link fe_tones = {
.playback = true,
.trigger =
{SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE},
};
-struct snd_soc_dsp_link fe_lp_media = {
+static struct snd_soc_dsp_link fe_lp_media = {
.playback = true,
.trigger =
{SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE},
@@ -332,7 +331,7 @@
.init = tonka_display_init,
.no_pcm = 1, /* don't create ALSA pcm for this */
- .be_hw_params_fixup = mcbsp_be_hw_params_fixup,
+ .be_hw_params_fixup = tonka_mcbsp_be_hw_params_fixup,
.ops = &tonka_mcbsp_ops,
.be_id = OMAP_ABE_DAI_BT_VX,
},
@@ -349,10 +348,10 @@
.codec_name = "tlv320aic23-codec.3-001a",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS,
- .init = tonka_display_init,
+ //.init = tonka_display_init,
.no_pcm = 1, /* don't create ALSA pcm for this */
- .be_hw_params_fixup = mcbsp_be_hw_params_fixup,
+ .be_hw_params_fixup = tonka_mcbsp_be_hw_params_fixup,
.ops = &tonka_mcbsp_ops,
.be_id = OMAP_ABE_DAI_BT_VX,
},
@@ -372,7 +371,7 @@
.init = tonka_speaker_init,
.no_pcm = 1, /* don't create ALSA pcm for this */
- .be_hw_params_fixup = mcbsp_be_hw_params_fixup,
+ .be_hw_params_fixup = tonka_mcbsp_be_hw_params_fixup,
.ops = &tonka_mcbsp_ops,
.be_id = OMAP_ABE_DAI_MM_FM,
},
@@ -389,10 +388,10 @@
.codec_name = "tlv320aic23-codec.3-001b",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS,
- .init = tonka_speaker_init,
+ //.init = tonka_speaker_init,
.no_pcm = 1, /* don't create ALSA pcm for this */
- .be_hw_params_fixup = mcbsp_be_hw_params_fixup,
+ .be_hw_params_fixup = tonka_mcbsp_be_hw_params_fixup,
.ops = &tonka_mcbsp_ops,
.be_id = OMAP_ABE_DAI_MM_FM,
},
@@ -401,17 +400,17 @@
static struct snd_soc_codec_conf tonka_codec_conf[] = {
{
.dev_name = "tlv320aic23-codec.3-001a",
- .name_prefix = "display",
+ .name_prefix = "Display",
},
{
.dev_name = "tlv320aic23-codec.3-001b",
- .name_prefix = "speaker",
+ .name_prefix = "Speaker",
},
};
/* Audio machine driver */
static struct snd_soc_card snd_soc_tonka = {
- .name = "tonka",
+ .name = "Tonka",
.driver_name = "OMAP4",
.long_name = "TI OMAP4 Board",
.dai_link = tonka_dai,
@@ -431,10 +430,8 @@
printk(KERN_INFO "Tonka SoC init\n");
tonka_snd_device = platform_device_alloc("soc-audio", -1);
- if (!tonka_snd_device) {
- printk(KERN_ERR "Platform device allocation failed\n");
+ if (!tonka_snd_device)
return -ENOMEM;
- }
platform_set_drvdata(tonka_snd_device, &snd_soc_tonka);