aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2016-08-04 09:38:45 -0400
committerMark Brown <broonie@kernel.org>2016-08-08 06:55:20 -0400
commit2da1e487cab4f3d134cc4b3ce2bd648660683900 (patch)
treee5c232aa9eaf62976ed113392c7f91feff109d65
parent84c5c20395a8e4ca2043136e1f0d128cf758244b (diff)
ASoC: s3c24xx_uda134x: Drop initialization of codec's platform data
It's already taken care by the codec and its platform_data defined in the arch/arm/mach-s3c24xx/mach-mini2440.c board file. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/samsung/s3c24xx_uda134x.c71
1 files changed, 1 insertions, 70 deletions
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c
index 33479e7a0d3e..7119aabf0f78 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -226,78 +226,12 @@ static struct snd_soc_card snd_soc_s3c24xx_uda134x = {
226 .num_links = 1, 226 .num_links = 1,
227}; 227};
228 228
229static struct s3c24xx_uda134x_platform_data *s3c24xx_uda134x_l3_pins;
230
231static void setdat(int v)
232{
233 gpio_set_value(s3c24xx_uda134x_l3_pins->l3_data, v > 0);
234}
235
236static void setclk(int v)
237{
238 gpio_set_value(s3c24xx_uda134x_l3_pins->l3_clk, v > 0);
239}
240
241static void setmode(int v)
242{
243 gpio_set_value(s3c24xx_uda134x_l3_pins->l3_mode, v > 0);
244}
245
246/* FIXME - This must be codec platform data but in which board file ?? */
247static struct uda134x_platform_data s3c24xx_uda134x = {
248 .l3 = {
249 .setdat = setdat,
250 .setclk = setclk,
251 .setmode = setmode,
252 .data_hold = 1,
253 .data_setup = 1,
254 .clock_high = 1,
255 .mode_hold = 1,
256 .mode = 1,
257 .mode_setup = 1,
258 },
259};
260
261static int s3c24xx_uda134x_setup_pin(int pin, char *fun)
262{
263 if (gpio_request(pin, "s3c24xx_uda134x") < 0) {
264 printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
265 "l3 %s pin already in use", fun);
266 return -EBUSY;
267 }
268 gpio_direction_output(pin, 0);
269 return 0;
270}
271
272static int s3c24xx_uda134x_probe(struct platform_device *pdev) 229static int s3c24xx_uda134x_probe(struct platform_device *pdev)
273{ 230{
274 int ret; 231 int ret;
275 232
276 printk(KERN_INFO "S3C24XX_UDA134X SoC Audio driver\n"); 233 printk(KERN_INFO "S3C24XX_UDA134X SoC Audio driver\n");
277 234
278 s3c24xx_uda134x_l3_pins = pdev->dev.platform_data;
279 if (s3c24xx_uda134x_l3_pins == NULL) {
280 printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
281 "unable to find platform data\n");
282 return -ENODEV;
283 }
284 s3c24xx_uda134x.model = s3c24xx_uda134x_l3_pins->model;
285
286 if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_data,
287 "data") < 0)
288 return -EBUSY;
289 if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_clk,
290 "clk") < 0) {
291 gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
292 return -EBUSY;
293 }
294 if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_mode,
295 "mode") < 0) {
296 gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
297 gpio_free(s3c24xx_uda134x_l3_pins->l3_clk);
298 return -EBUSY;
299 }
300
301 s3c24xx_uda134x_snd_device = platform_device_alloc("soc-audio", -1); 235 s3c24xx_uda134x_snd_device = platform_device_alloc("soc-audio", -1);
302 if (!s3c24xx_uda134x_snd_device) { 236 if (!s3c24xx_uda134x_snd_device) {
303 printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: " 237 printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
@@ -307,7 +241,7 @@ static int s3c24xx_uda134x_probe(struct platform_device *pdev)
307 241
308 platform_set_drvdata(s3c24xx_uda134x_snd_device, 242 platform_set_drvdata(s3c24xx_uda134x_snd_device,
309 &snd_soc_s3c24xx_uda134x); 243 &snd_soc_s3c24xx_uda134x);
310 platform_device_add_data(s3c24xx_uda134x_snd_device, &s3c24xx_uda134x, sizeof(s3c24xx_uda134x)); 244
311 ret = platform_device_add(s3c24xx_uda134x_snd_device); 245 ret = platform_device_add(s3c24xx_uda134x_snd_device);
312 if (ret) { 246 if (ret) {
313 printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: Unable to add\n"); 247 printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: Unable to add\n");
@@ -320,9 +254,6 @@ static int s3c24xx_uda134x_probe(struct platform_device *pdev)
320static int s3c24xx_uda134x_remove(struct platform_device *pdev) 254static int s3c24xx_uda134x_remove(struct platform_device *pdev)
321{ 255{
322 platform_device_unregister(s3c24xx_uda134x_snd_device); 256 platform_device_unregister(s3c24xx_uda134x_snd_device);
323 gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
324 gpio_free(s3c24xx_uda134x_l3_pins->l3_clk);
325 gpio_free(s3c24xx_uda134x_l3_pins->l3_mode);
326 return 0; 257 return 0;
327} 258}
328 259