diff options
author | Mark Brown <broonie@linaro.org> | 2013-06-17 12:20:27 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-17 12:20:27 -0400 |
commit | 14345a589826089b4793b401ccc356dbb9947e3e (patch) | |
tree | 34da633442267f9d6baeae34a3dca66e70e91216 /sound/soc/fsl | |
parent | 1ee9271d67eca42853a4037d26504d9e3e1e1f9c (diff) | |
parent | b9840124d699614f1429748e43827b1fb35c1138 (diff) |
Merge remote-tracking branch 'asoc/topic/sgtl5000' into asoc-next
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index a60aaa053d28..7a8bc1220b2e 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c | |||
@@ -128,21 +128,11 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
128 | goto fail; | 128 | goto fail; |
129 | } | 129 | } |
130 | 130 | ||
131 | data->codec_clk = clk_get(&codec_dev->dev, NULL); | 131 | data->codec_clk = devm_clk_get(&codec_dev->dev, NULL); |
132 | if (IS_ERR(data->codec_clk)) { | 132 | if (IS_ERR(data->codec_clk)) |
133 | /* assuming clock enabled by default */ | 133 | goto fail; |
134 | data->codec_clk = NULL; | 134 | |
135 | ret = of_property_read_u32(codec_np, "clock-frequency", | 135 | data->clk_frequency = clk_get_rate(data->codec_clk); |
136 | &data->clk_frequency); | ||
137 | if (ret) { | ||
138 | dev_err(&codec_dev->dev, | ||
139 | "clock-frequency missing or invalid\n"); | ||
140 | goto fail; | ||
141 | } | ||
142 | } else { | ||
143 | data->clk_frequency = clk_get_rate(data->codec_clk); | ||
144 | clk_prepare_enable(data->codec_clk); | ||
145 | } | ||
146 | 136 | ||
147 | data->dai.name = "HiFi"; | 137 | data->dai.name = "HiFi"; |
148 | data->dai.stream_name = "HiFi"; | 138 | data->dai.stream_name = "HiFi"; |
@@ -157,10 +147,10 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
157 | data->card.dev = &pdev->dev; | 147 | data->card.dev = &pdev->dev; |
158 | ret = snd_soc_of_parse_card_name(&data->card, "model"); | 148 | ret = snd_soc_of_parse_card_name(&data->card, "model"); |
159 | if (ret) | 149 | if (ret) |
160 | goto clk_fail; | 150 | goto fail; |
161 | ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing"); | 151 | ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing"); |
162 | if (ret) | 152 | if (ret) |
163 | goto clk_fail; | 153 | goto fail; |
164 | data->card.num_links = 1; | 154 | data->card.num_links = 1; |
165 | data->card.owner = THIS_MODULE; | 155 | data->card.owner = THIS_MODULE; |
166 | data->card.dai_link = &data->dai; | 156 | data->card.dai_link = &data->dai; |
@@ -170,7 +160,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
170 | ret = snd_soc_register_card(&data->card); | 160 | ret = snd_soc_register_card(&data->card); |
171 | if (ret) { | 161 | if (ret) { |
172 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); | 162 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); |
173 | goto clk_fail; | 163 | goto fail; |
174 | } | 164 | } |
175 | 165 | ||
176 | platform_set_drvdata(pdev, data); | 166 | platform_set_drvdata(pdev, data); |
@@ -179,8 +169,6 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
179 | 169 | ||
180 | return 0; | 170 | return 0; |
181 | 171 | ||
182 | clk_fail: | ||
183 | clk_put(data->codec_clk); | ||
184 | fail: | 172 | fail: |
185 | if (ssi_np) | 173 | if (ssi_np) |
186 | of_node_put(ssi_np); | 174 | of_node_put(ssi_np); |
@@ -194,10 +182,6 @@ static int imx_sgtl5000_remove(struct platform_device *pdev) | |||
194 | { | 182 | { |
195 | struct imx_sgtl5000_data *data = platform_get_drvdata(pdev); | 183 | struct imx_sgtl5000_data *data = platform_get_drvdata(pdev); |
196 | 184 | ||
197 | if (data->codec_clk) { | ||
198 | clk_disable_unprepare(data->codec_clk); | ||
199 | clk_put(data->codec_clk); | ||
200 | } | ||
201 | snd_soc_unregister_card(&data->card); | 185 | snd_soc_unregister_card(&data->card); |
202 | 186 | ||
203 | return 0; | 187 | return 0; |