kirkwood-i2s.c (0d4a42f6bd298e826620585e766a154ab460617a) kirkwood-i2s.c (83d85f53adf38f5021afd921a84efd53c44aff56)
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

--- 437 unchanged lines hidden (view full) ---

446 .rates = SNDRV_PCM_RATE_8000_192000 |
447 SNDRV_PCM_RATE_CONTINUOUS |
448 SNDRV_PCM_RATE_KNOT,
449 .formats = KIRKWOOD_I2S_FORMATS,
450 },
451 .ops = &kirkwood_i2s_dai_ops,
452};
453
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

--- 437 unchanged lines hidden (view full) ---

446 .rates = SNDRV_PCM_RATE_8000_192000 |
447 SNDRV_PCM_RATE_CONTINUOUS |
448 SNDRV_PCM_RATE_KNOT,
449 .formats = KIRKWOOD_I2S_FORMATS,
450 },
451 .ops = &kirkwood_i2s_dai_ops,
452};
453
454static const struct snd_soc_component_driver kirkwood_i2s_component = {
455 .name = DRV_NAME,
456};
457
454static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
455{
456 struct kirkwood_asoc_platform_data *data = pdev->dev.platform_data;
457 struct snd_soc_dai_driver *soc_dai = &kirkwood_i2s_dai;
458 struct kirkwood_dma_data *priv;
459 struct resource *mem;
460 int err;
461

--- 57 unchanged lines hidden (view full) ---

519 if (data->burst == 32) {
520 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_32;
521 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_32;
522 } else {
523 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_128;
524 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128;
525 }
526
458static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
459{
460 struct kirkwood_asoc_platform_data *data = pdev->dev.platform_data;
461 struct snd_soc_dai_driver *soc_dai = &kirkwood_i2s_dai;
462 struct kirkwood_dma_data *priv;
463 struct resource *mem;
464 int err;
465

--- 57 unchanged lines hidden (view full) ---

523 if (data->burst == 32) {
524 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_32;
525 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_32;
526 } else {
527 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_128;
528 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128;
529 }
530
527 err = snd_soc_register_dai(&pdev->dev, soc_dai);
531 err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component,
532 soc_dai, 1);
528 if (!err)
529 return 0;
533 if (!err)
534 return 0;
530 dev_err(&pdev->dev, "snd_soc_register_dai failed\n");
535 dev_err(&pdev->dev, "snd_soc_register_component failed\n");
531
532 if (!IS_ERR(priv->extclk)) {
533 clk_disable_unprepare(priv->extclk);
534 clk_put(priv->extclk);
535 }
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
536
537 if (!IS_ERR(priv->extclk)) {
538 clk_disable_unprepare(priv->extclk);
539 clk_put(priv->extclk);
540 }
541 clk_disable_unprepare(priv->clk);
542
543 return err;
544}
545
546static int kirkwood_i2s_dev_remove(struct platform_device *pdev)
547{
548 struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev);
549
545 snd_soc_unregister_dai(&pdev->dev);
550 snd_soc_unregister_component(&pdev->dev);
546
547 if (!IS_ERR(priv->extclk)) {
548 clk_disable_unprepare(priv->extclk);
549 clk_put(priv->extclk);
550 }
551 clk_disable_unprepare(priv->clk);
552
553 return 0;

--- 18 unchanged lines hidden ---
551
552 if (!IS_ERR(priv->extclk)) {
553 clk_disable_unprepare(priv->extclk);
554 clk_put(priv->extclk);
555 }
556 clk_disable_unprepare(priv->clk);
557
558 return 0;

--- 18 unchanged lines hidden ---