kirkwood-i2s.c (681e4a5e13c1c8315694eb4f44e0cdd84c9082d2) | kirkwood-i2s.c (e919c71665d2386eec6dc2ecd58d01bae69fc0fd) |
---|---|
1/* 2 * kirkwood-i2s.c 3 * 4 * (c) 2010 Arnaud Patard <apatard@mandriva.com> 5 * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org> 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the 9 * Free Software Foundation; either version 2 of the License, or (at your 10 * option) any later version. 11 */ 12 13#include <linux/init.h> 14#include <linux/module.h> 15#include <linux/platform_device.h> 16#include <linux/io.h> 17#include <linux/slab.h> 18#include <linux/mbus.h> 19#include <linux/delay.h> | 1/* 2 * kirkwood-i2s.c 3 * 4 * (c) 2010 Arnaud Patard <apatard@mandriva.com> 5 * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org> 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the 9 * Free Software Foundation; either version 2 of the License, or (at your 10 * option) any later version. 11 */ 12 13#include <linux/init.h> 14#include <linux/module.h> 15#include <linux/platform_device.h> 16#include <linux/io.h> 17#include <linux/slab.h> 18#include <linux/mbus.h> 19#include <linux/delay.h> |
20#include <linux/clk.h> |
|
20#include <sound/pcm.h> 21#include <sound/pcm_params.h> 22#include <sound/soc.h> 23#include <plat/audio.h> 24#include "kirkwood.h" 25 26#define DRV_NAME "kirkwood-i2s" 27 --- 416 unchanged lines hidden (view full) --- 444 if (!data) { 445 dev_err(&pdev->dev, "no platform data ?!\n"); 446 err = -EINVAL; 447 goto err_ioremap; 448 } 449 450 priv->burst = data->burst; 451 | 21#include <sound/pcm.h> 22#include <sound/pcm_params.h> 23#include <sound/soc.h> 24#include <plat/audio.h> 25#include "kirkwood.h" 26 27#define DRV_NAME "kirkwood-i2s" 28 --- 416 unchanged lines hidden (view full) --- 445 if (!data) { 446 dev_err(&pdev->dev, "no platform data ?!\n"); 447 err = -EINVAL; 448 goto err_ioremap; 449 } 450 451 priv->burst = data->burst; 452 |
453 priv->clk = clk_get(&pdev->dev, NULL); 454 if (IS_ERR(priv->clk)) { 455 dev_err(&pdev->dev, "no clock\n"); 456 err = PTR_ERR(priv->clk); 457 goto err_ioremap; 458 } 459 clk_prepare_enable(priv->clk); 460 |
|
452 return snd_soc_register_dai(&pdev->dev, &kirkwood_i2s_dai); 453 454err_ioremap: 455 iounmap(priv->io); 456err_iomem: 457 release_mem_region(priv->mem->start, SZ_16K); 458err_alloc: 459 kfree(priv); 460error: 461 return err; 462} 463 464static __devexit int kirkwood_i2s_dev_remove(struct platform_device *pdev) 465{ 466 struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); 467 468 snd_soc_unregister_dai(&pdev->dev); | 461 return snd_soc_register_dai(&pdev->dev, &kirkwood_i2s_dai); 462 463err_ioremap: 464 iounmap(priv->io); 465err_iomem: 466 release_mem_region(priv->mem->start, SZ_16K); 467err_alloc: 468 kfree(priv); 469error: 470 return err; 471} 472 473static __devexit int kirkwood_i2s_dev_remove(struct platform_device *pdev) 474{ 475 struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); 476 477 snd_soc_unregister_dai(&pdev->dev); |
478 479 clk_disable_unprepare(priv->clk); 480 clk_put(priv->clk); 481 |
|
469 iounmap(priv->io); 470 release_mem_region(priv->mem->start, SZ_16K); 471 kfree(priv); 472 473 return 0; 474} 475 476static struct platform_driver kirkwood_i2s_driver = { --- 15 unchanged lines hidden --- | 482 iounmap(priv->io); 483 release_mem_region(priv->mem->start, SZ_16K); 484 kfree(priv); 485 486 return 0; 487} 488 489static struct platform_driver kirkwood_i2s_driver = { --- 15 unchanged lines hidden --- |