aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-ssm2602.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ssm2602.c')
-rw-r--r--sound/soc/blackfin/bf5xx-ssm2602.c38
1 files changed, 9 insertions, 29 deletions
diff --git a/sound/soc/blackfin/bf5xx-ssm2602.c b/sound/soc/blackfin/bf5xx-ssm2602.c
index 3a00fa4dbe6d..36f2769eb912 100644
--- a/sound/soc/blackfin/bf5xx-ssm2602.c
+++ b/sound/soc/blackfin/bf5xx-ssm2602.c
@@ -42,17 +42,16 @@
42#include "../codecs/ssm2602.h" 42#include "../codecs/ssm2602.h"
43#include "bf5xx-sport.h" 43#include "bf5xx-sport.h"
44#include "bf5xx-i2s-pcm.h" 44#include "bf5xx-i2s-pcm.h"
45#include "bf5xx-i2s.h"
46 45
47static struct snd_soc_card bf5xx_ssm2602; 46static struct snd_soc_card bf5xx_ssm2602;
48 47
49static int bf5xx_ssm2602_startup(struct snd_pcm_substream *substream) 48static int bf5xx_ssm2602_startup(struct snd_pcm_substream *substream)
50{ 49{
51 struct snd_soc_pcm_runtime *rtd = substream->private_data; 50 struct snd_soc_pcm_runtime *rtd = substream->private_data;
52 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 51 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
53 52
54 pr_debug("%s enter\n", __func__); 53 pr_debug("%s enter\n", __func__);
55 cpu_dai->private_data = sport_handle; 54 snd_soc_dai_set_drvdata(cpu_dai, sport_handle);
56 return 0; 55 return 0;
57} 56}
58 57
@@ -60,8 +59,8 @@ static int bf5xx_ssm2602_hw_params(struct snd_pcm_substream *substream,
60 struct snd_pcm_hw_params *params) 59 struct snd_pcm_hw_params *params)
61{ 60{
62 struct snd_soc_pcm_runtime *rtd = substream->private_data; 61 struct snd_soc_pcm_runtime *rtd = substream->private_data;
63 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 62 struct snd_soc_dai *codec_dai = rtd->codec_dai;
64 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 63 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
65 unsigned int clk = 0; 64 unsigned int clk = 0;
66 int ret = 0; 65 int ret = 0;
67 66
@@ -118,36 +117,19 @@ static struct snd_soc_ops bf5xx_ssm2602_ops = {
118static struct snd_soc_dai_link bf5xx_ssm2602_dai = { 117static struct snd_soc_dai_link bf5xx_ssm2602_dai = {
119 .name = "ssm2602", 118 .name = "ssm2602",
120 .stream_name = "SSM2602", 119 .stream_name = "SSM2602",
121 .cpu_dai = &bf5xx_i2s_dai, 120 .cpu_dai_name = "bf5xx-i2s",
122 .codec_dai = &ssm2602_dai, 121 .codec_dai_name = "ssm2602-hifi",
122 .platform_name = "bf5xx-pcm-audio",
123 .codec_name = "ssm2602-codec.0-0x1b",
123 .ops = &bf5xx_ssm2602_ops, 124 .ops = &bf5xx_ssm2602_ops,
124}; 125};
125 126
126/*
127 * SSM2602 2 wire address is determined by CSB
128 * state during powerup.
129 * low = 0x1a
130 * high = 0x1b
131 */
132
133static struct ssm2602_setup_data bf5xx_ssm2602_setup = {
134 .i2c_bus = 0,
135 .i2c_address = 0x1b,
136};
137
138static struct snd_soc_card bf5xx_ssm2602 = { 127static struct snd_soc_card bf5xx_ssm2602 = {
139 .name = "bf5xx_ssm2602", 128 .name = "bf5xx_ssm2602",
140 .platform = &bf5xx_i2s_soc_platform,
141 .dai_link = &bf5xx_ssm2602_dai, 129 .dai_link = &bf5xx_ssm2602_dai,
142 .num_links = 1, 130 .num_links = 1,
143}; 131};
144 132
145static struct snd_soc_device bf5xx_ssm2602_snd_devdata = {
146 .card = &bf5xx_ssm2602,
147 .codec_dev = &soc_codec_dev_ssm2602,
148 .codec_data = &bf5xx_ssm2602_setup,
149};
150
151static struct platform_device *bf5xx_ssm2602_snd_device; 133static struct platform_device *bf5xx_ssm2602_snd_device;
152 134
153static int __init bf5xx_ssm2602_init(void) 135static int __init bf5xx_ssm2602_init(void)
@@ -159,9 +141,7 @@ static int __init bf5xx_ssm2602_init(void)
159 if (!bf5xx_ssm2602_snd_device) 141 if (!bf5xx_ssm2602_snd_device)
160 return -ENOMEM; 142 return -ENOMEM;
161 143
162 platform_set_drvdata(bf5xx_ssm2602_snd_device, 144 platform_set_drvdata(bf5xx_ssm2602_snd_device, &bf5xx_ssm2602);
163 &bf5xx_ssm2602_snd_devdata);
164 bf5xx_ssm2602_snd_devdata.dev = &bf5xx_ssm2602_snd_device->dev;
165 ret = platform_device_add(bf5xx_ssm2602_snd_device); 145 ret = platform_device_add(bf5xx_ssm2602_snd_device);
166 146
167 if (ret) 147 if (ret)