| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ALSA SoC I2S Audio Layer for Broadcom BCM2835 SoC |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 20 | 21 | * Freescale SSI ALSA SoC Digital Audio Interface (DAI) driver |
|---|
| 21 | 22 | * Author: Timur Tabi <timur@freescale.com> |
|---|
| 22 | 23 | * Copyright 2007-2010 Freescale Semiconductor, Inc. |
|---|
| 23 | | - * |
|---|
| 24 | | - * This program is free software; you can redistribute it and/or |
|---|
| 25 | | - * modify it under the terms of the GNU General Public License |
|---|
| 26 | | - * version 2 as published by the Free Software Foundation. |
|---|
| 27 | | - * |
|---|
| 28 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 29 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 30 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 31 | | - * General Public License for more details. |
|---|
| 32 | 24 | */ |
|---|
| 33 | 25 | |
|---|
| 34 | 26 | #include <linux/bitops.h> |
|---|
| .. | .. |
|---|
| 661 | 653 | BCM2835_I2S_CS_A_REG, mask, 0); |
|---|
| 662 | 654 | |
|---|
| 663 | 655 | /* Stop also the clock when not SND_SOC_DAIFMT_CONT */ |
|---|
| 664 | | - if (!dai->active && !(dev->fmt & SND_SOC_DAIFMT_CONT)) |
|---|
| 656 | + if (!snd_soc_dai_active(dai) && !(dev->fmt & SND_SOC_DAIFMT_CONT)) |
|---|
| 665 | 657 | bcm2835_i2s_stop_clock(dev); |
|---|
| 666 | 658 | } |
|---|
| 667 | 659 | |
|---|
| .. | .. |
|---|
| 703 | 695 | { |
|---|
| 704 | 696 | struct bcm2835_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); |
|---|
| 705 | 697 | |
|---|
| 706 | | - if (dai->active) |
|---|
| 698 | + if (snd_soc_dai_active(dai)) |
|---|
| 707 | 699 | return 0; |
|---|
| 708 | 700 | |
|---|
| 709 | 701 | /* Should this still be running stop it */ |
|---|
| .. | .. |
|---|
| 731 | 723 | bcm2835_i2s_stop(dev, substream, dai); |
|---|
| 732 | 724 | |
|---|
| 733 | 725 | /* If both streams are stopped, disable module and clock */ |
|---|
| 734 | | - if (dai->active) |
|---|
| 726 | + if (snd_soc_dai_active(dai)) |
|---|
| 735 | 727 | return; |
|---|
| 736 | 728 | |
|---|
| 737 | 729 | /* Disable the module */ |
|---|
| .. | .. |
|---|
| 836 | 828 | { |
|---|
| 837 | 829 | struct bcm2835_i2s_dev *dev; |
|---|
| 838 | 830 | int ret; |
|---|
| 839 | | - struct resource *mem; |
|---|
| 840 | 831 | void __iomem *base; |
|---|
| 841 | 832 | const __be32 *addr; |
|---|
| 842 | 833 | dma_addr_t dma_base; |
|---|
| .. | .. |
|---|
| 850 | 841 | dev->clk_prepared = false; |
|---|
| 851 | 842 | dev->clk = devm_clk_get(&pdev->dev, NULL); |
|---|
| 852 | 843 | if (IS_ERR(dev->clk)) { |
|---|
| 853 | | - dev_err(&pdev->dev, "could not get clk: %ld\n", |
|---|
| 854 | | - PTR_ERR(dev->clk)); |
|---|
| 855 | | - return PTR_ERR(dev->clk); |
|---|
| 844 | + ret = PTR_ERR(dev->clk); |
|---|
| 845 | + if (ret == -EPROBE_DEFER) |
|---|
| 846 | + dev_dbg(&pdev->dev, "could not get clk: %d\n", ret); |
|---|
| 847 | + else |
|---|
| 848 | + dev_err(&pdev->dev, "could not get clk: %d\n", ret); |
|---|
| 849 | + return ret; |
|---|
| 856 | 850 | } |
|---|
| 857 | 851 | |
|---|
| 858 | 852 | /* Request ioarea */ |
|---|
| 859 | | - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 860 | | - base = devm_ioremap_resource(&pdev->dev, mem); |
|---|
| 853 | + base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 861 | 854 | if (IS_ERR(base)) |
|---|
| 862 | 855 | return PTR_ERR(base); |
|---|
| 863 | 856 | |
|---|