diff options
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ssm2602.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-ssm2602.c | 69 |
1 files changed, 24 insertions, 45 deletions
diff --git a/sound/soc/blackfin/bf5xx-ssm2602.c b/sound/soc/blackfin/bf5xx-ssm2602.c index 3a00fa4dbe6d..767e772a815d 100644 --- a/sound/soc/blackfin/bf5xx-ssm2602.c +++ b/sound/soc/blackfin/bf5xx-ssm2602.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <sound/core.h> | 33 | #include <sound/core.h> |
34 | #include <sound/pcm.h> | 34 | #include <sound/pcm.h> |
35 | #include <sound/soc.h> | 35 | #include <sound/soc.h> |
36 | #include <sound/soc-dapm.h> | ||
37 | #include <sound/pcm_params.h> | 36 | #include <sound/pcm_params.h> |
38 | 37 | ||
39 | #include <asm/dma.h> | 38 | #include <asm/dma.h> |
@@ -42,26 +41,15 @@ | |||
42 | #include "../codecs/ssm2602.h" | 41 | #include "../codecs/ssm2602.h" |
43 | #include "bf5xx-sport.h" | 42 | #include "bf5xx-sport.h" |
44 | #include "bf5xx-i2s-pcm.h" | 43 | #include "bf5xx-i2s-pcm.h" |
45 | #include "bf5xx-i2s.h" | ||
46 | 44 | ||
47 | static struct snd_soc_card bf5xx_ssm2602; | 45 | static struct snd_soc_card bf5xx_ssm2602; |
48 | 46 | ||
49 | static int bf5xx_ssm2602_startup(struct snd_pcm_substream *substream) | ||
50 | { | ||
51 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
52 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | ||
53 | |||
54 | pr_debug("%s enter\n", __func__); | ||
55 | cpu_dai->private_data = sport_handle; | ||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | static int bf5xx_ssm2602_hw_params(struct snd_pcm_substream *substream, | 47 | static int bf5xx_ssm2602_hw_params(struct snd_pcm_substream *substream, |
60 | struct snd_pcm_hw_params *params) | 48 | struct snd_pcm_hw_params *params) |
61 | { | 49 | { |
62 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 50 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
63 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 51 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
64 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 52 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
65 | unsigned int clk = 0; | 53 | unsigned int clk = 0; |
66 | int ret = 0; | 54 | int ret = 0; |
67 | 55 | ||
@@ -111,43 +99,36 @@ static int bf5xx_ssm2602_hw_params(struct snd_pcm_substream *substream, | |||
111 | } | 99 | } |
112 | 100 | ||
113 | static struct snd_soc_ops bf5xx_ssm2602_ops = { | 101 | static struct snd_soc_ops bf5xx_ssm2602_ops = { |
114 | .startup = bf5xx_ssm2602_startup, | ||
115 | .hw_params = bf5xx_ssm2602_hw_params, | 102 | .hw_params = bf5xx_ssm2602_hw_params, |
116 | }; | 103 | }; |
117 | 104 | ||
118 | static struct snd_soc_dai_link bf5xx_ssm2602_dai = { | 105 | static struct snd_soc_dai_link bf5xx_ssm2602_dai[] = { |
119 | .name = "ssm2602", | 106 | { |
120 | .stream_name = "SSM2602", | 107 | .name = "ssm2602", |
121 | .cpu_dai = &bf5xx_i2s_dai, | 108 | .stream_name = "SSM2602", |
122 | .codec_dai = &ssm2602_dai, | 109 | .cpu_dai_name = "bfin-i2s.0", |
123 | .ops = &bf5xx_ssm2602_ops, | 110 | .codec_dai_name = "ssm2602-hifi", |
124 | }; | 111 | .platform_name = "bfin-i2s-pcm-audio", |
125 | 112 | .codec_name = "ssm2602.0-001b", | |
126 | /* | 113 | .ops = &bf5xx_ssm2602_ops, |
127 | * SSM2602 2 wire address is determined by CSB | 114 | }, |
128 | * state during powerup. | 115 | { |
129 | * low = 0x1a | 116 | .name = "ssm2602", |
130 | * high = 0x1b | 117 | .stream_name = "SSM2602", |
131 | */ | 118 | .cpu_dai_name = "bfin-i2s.1", |
132 | 119 | .codec_dai_name = "ssm2602-hifi", | |
133 | static struct ssm2602_setup_data bf5xx_ssm2602_setup = { | 120 | .platform_name = "bfin-i2s-pcm-audio", |
134 | .i2c_bus = 0, | 121 | .codec_name = "ssm2602.0-001b", |
135 | .i2c_address = 0x1b, | 122 | .ops = &bf5xx_ssm2602_ops, |
123 | }, | ||
136 | }; | 124 | }; |
137 | 125 | ||
138 | static struct snd_soc_card bf5xx_ssm2602 = { | 126 | static struct snd_soc_card bf5xx_ssm2602 = { |
139 | .name = "bf5xx_ssm2602", | 127 | .name = "bfin-ssm2602", |
140 | .platform = &bf5xx_i2s_soc_platform, | 128 | .dai_link = &bf5xx_ssm2602_dai[CONFIG_SND_BF5XX_SPORT_NUM], |
141 | .dai_link = &bf5xx_ssm2602_dai, | ||
142 | .num_links = 1, | 129 | .num_links = 1, |
143 | }; | 130 | }; |
144 | 131 | ||
145 | static 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 | |||
151 | static struct platform_device *bf5xx_ssm2602_snd_device; | 132 | static struct platform_device *bf5xx_ssm2602_snd_device; |
152 | 133 | ||
153 | static int __init bf5xx_ssm2602_init(void) | 134 | static int __init bf5xx_ssm2602_init(void) |
@@ -159,9 +140,7 @@ static int __init bf5xx_ssm2602_init(void) | |||
159 | if (!bf5xx_ssm2602_snd_device) | 140 | if (!bf5xx_ssm2602_snd_device) |
160 | return -ENOMEM; | 141 | return -ENOMEM; |
161 | 142 | ||
162 | platform_set_drvdata(bf5xx_ssm2602_snd_device, | 143 | 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); | 144 | ret = platform_device_add(bf5xx_ssm2602_snd_device); |
166 | 145 | ||
167 | if (ret) | 146 | if (ret) |