aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/jz4740
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-04-22 16:46:33 -0400
committerMark Brown <broonie@linaro.org>2014-04-22 16:53:21 -0400
commit0e746d7b2b2c31a29b78ddb364bca9a01bd64ae7 (patch)
tree02f2f8ea3e94ab14f823b92756f0452b6fd9d9fa /sound/soc/jz4740
parentb8fb837b0c302a2278e4f222e5d875ce7a3b4aea (diff)
ASoC: qi_lb60: Set .dai_fmt instead of calling snd_soc_set_dai_fmt()
Rather than calling snd_soc_set_dai_fmt(), just set the dai_fmt field in the dai_link struct. Both have the same effect, but the later is a bit shorter and also allows us to remove the now unused init callback. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/jz4740')
-rw-r--r--sound/soc/jz4740/qi_lb60.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/sound/soc/jz4740/qi_lb60.c b/sound/soc/jz4740/qi_lb60.c
index 8dd356892f0e..72ce103f7d68 100644
--- a/sound/soc/jz4740/qi_lb60.c
+++ b/sound/soc/jz4740/qi_lb60.c
@@ -46,26 +46,6 @@ static const struct snd_soc_dapm_route qi_lb60_routes[] = {
46 {"Speaker", NULL, "ROUT"}, 46 {"Speaker", NULL, "ROUT"},
47}; 47};
48 48
49#define QI_LB60_DAIFMT (SND_SOC_DAIFMT_I2S | \
50 SND_SOC_DAIFMT_NB_NF | \
51 SND_SOC_DAIFMT_CBM_CFM)
52
53static int qi_lb60_codec_init(struct snd_soc_pcm_runtime *rtd)
54{
55 struct snd_soc_codec *codec = rtd->codec;
56 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
57 struct snd_soc_dapm_context *dapm = &codec->dapm;
58 int ret;
59
60 ret = snd_soc_dai_set_fmt(cpu_dai, QI_LB60_DAIFMT);
61 if (ret < 0) {
62 dev_err(codec->dev, "Failed to set cpu dai format: %d\n", ret);
63 return ret;
64 }
65
66 return 0;
67}
68
69static struct snd_soc_dai_link qi_lb60_dai = { 49static struct snd_soc_dai_link qi_lb60_dai = {
70 .name = "jz4740", 50 .name = "jz4740",
71 .stream_name = "jz4740", 51 .stream_name = "jz4740",
@@ -73,7 +53,8 @@ static struct snd_soc_dai_link qi_lb60_dai = {
73 .platform_name = "jz4740-i2s", 53 .platform_name = "jz4740-i2s",
74 .codec_dai_name = "jz4740-hifi", 54 .codec_dai_name = "jz4740-hifi",
75 .codec_name = "jz4740-codec", 55 .codec_name = "jz4740-codec",
76 .init = qi_lb60_codec_init, 56 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
57 SND_SOC_DAIFMT_CBM_CFM,
77}; 58};
78 59
79static struct snd_soc_card qi_lb60 = { 60static struct snd_soc_card qi_lb60 = {