kirkwood-i2s.c (db43b16fa0e913582b63c971848e08151d50d952) | kirkwood-i2s.c (64ddf1f89cd7a483e1204320395023774234b49a) |
---|---|
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 --- 10 unchanged lines hidden (view full) --- 19#include <linux/delay.h> 20#include <linux/clk.h> 21#include <sound/pcm.h> 22#include <sound/pcm_params.h> 23#include <sound/soc.h> 24#include <linux/platform_data/asoc-kirkwood.h> 25#include "kirkwood.h" 26 | 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 --- 10 unchanged lines hidden (view full) --- 19#include <linux/delay.h> 20#include <linux/clk.h> 21#include <sound/pcm.h> 22#include <sound/pcm_params.h> 23#include <sound/soc.h> 24#include <linux/platform_data/asoc-kirkwood.h> 25#include "kirkwood.h" 26 |
27#define DRV_NAME "kirkwood-i2s" | 27#define DRV_NAME "mvebu-audio" |
28 29#define KIRKWOOD_I2S_FORMATS \ 30 (SNDRV_PCM_FMTBIT_S16_LE | \ 31 SNDRV_PCM_FMTBIT_S24_LE | \ 32 SNDRV_PCM_FMTBIT_S32_LE) 33 34static int kirkwood_i2s_set_fmt(struct snd_soc_dai *cpu_dai, 35 unsigned int fmt) --- 476 unchanged lines hidden (view full) --- 512 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_32; 513 } else { 514 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_128; 515 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128; 516 } 517 518 err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component, 519 soc_dai, 1); | 28 29#define KIRKWOOD_I2S_FORMATS \ 30 (SNDRV_PCM_FMTBIT_S16_LE | \ 31 SNDRV_PCM_FMTBIT_S24_LE | \ 32 SNDRV_PCM_FMTBIT_S32_LE) 33 34static int kirkwood_i2s_set_fmt(struct snd_soc_dai *cpu_dai, 35 unsigned int fmt) --- 476 unchanged lines hidden (view full) --- 512 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_32; 513 } else { 514 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_128; 515 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128; 516 } 517 518 err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component, 519 soc_dai, 1); |
520 if (!err) 521 return 0; 522 dev_err(&pdev->dev, "snd_soc_register_component failed\n"); | 520 if (err) { 521 dev_err(&pdev->dev, "snd_soc_register_component failed\n"); 522 goto err_component; 523 } |
523 | 524 |
525 err = snd_soc_register_platform(&pdev->dev, &kirkwood_soc_platform); 526 if (err) { 527 dev_err(&pdev->dev, "snd_soc_register_platform failed\n"); 528 goto err_platform; 529 } 530 return 0; 531 err_platform: 532 snd_soc_unregister_component(&pdev->dev); 533 err_component: |
|
524 if (!IS_ERR(priv->extclk)) 525 clk_disable_unprepare(priv->extclk); 526 clk_disable_unprepare(priv->clk); 527 528 return err; 529} 530 531static int kirkwood_i2s_dev_remove(struct platform_device *pdev) 532{ 533 struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); 534 | 534 if (!IS_ERR(priv->extclk)) 535 clk_disable_unprepare(priv->extclk); 536 clk_disable_unprepare(priv->clk); 537 538 return err; 539} 540 541static int kirkwood_i2s_dev_remove(struct platform_device *pdev) 542{ 543 struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); 544 |
545 snd_soc_unregister_platform(&pdev->dev); |
|
535 snd_soc_unregister_component(&pdev->dev); 536 537 if (!IS_ERR(priv->extclk)) 538 clk_disable_unprepare(priv->extclk); 539 clk_disable_unprepare(priv->clk); 540 541 return 0; 542} --- 8 unchanged lines hidden (view full) --- 551}; 552 553module_platform_driver(kirkwood_i2s_driver); 554 555/* Module information */ 556MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>"); 557MODULE_DESCRIPTION("Kirkwood I2S SoC Interface"); 558MODULE_LICENSE("GPL"); | 546 snd_soc_unregister_component(&pdev->dev); 547 548 if (!IS_ERR(priv->extclk)) 549 clk_disable_unprepare(priv->extclk); 550 clk_disable_unprepare(priv->clk); 551 552 return 0; 553} --- 8 unchanged lines hidden (view full) --- 562}; 563 564module_platform_driver(kirkwood_i2s_driver); 565 566/* Module information */ 567MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>"); 568MODULE_DESCRIPTION("Kirkwood I2S SoC Interface"); 569MODULE_LICENSE("GPL"); |
559MODULE_ALIAS("platform:kirkwood-i2s"); | 570MODULE_ALIAS("platform:mvebu-audio"); |