Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/rl6347a', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next

+655 -116
+2 -4
Documentation/devicetree/bindings/sound/rockchip-i2s.txt
··· 12 12 - reg: physical base address of the controller and length of memory mapped 13 13 region. 14 14 - interrupts: should contain the I2S interrupt. 15 - - #address-cells: should be 1. 16 - - #size-cells: should be 0. 17 15 - dmas: DMA specifiers for tx and rx dma. See the DMA client binding, 18 16 Documentation/devicetree/bindings/dma/dma.txt 19 17 - dma-names: should include "tx" and "rx". ··· 19 21 - clock-names: should contain followings: 20 22 - "i2s_hclk": clock for I2S BUS 21 23 - "i2s_clk" : clock for I2S controller 24 + - rockchip,capture-channels: max capture channels, if not set, 2 channels default. 22 25 23 26 Example for rk3288 I2S controller: 24 27 ··· 27 28 compatible = "rockchip,rk3288-i2s", "rockchip,rk3066-i2s"; 28 29 reg = <0xff890000 0x10000>; 29 30 interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; 30 - #address-cells = <1>; 31 - #size-cells = <0>; 32 31 dmas = <&pdma1 0>, <&pdma1 1>; 33 32 dma-names = "tx", "rx"; 34 33 clock-names = "i2s_hclk", "i2s_clk"; 35 34 clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>; 35 + rockchip,capture-channels = <2>; 36 36 };
+40
Documentation/devicetree/bindings/sound/rockchip-spdif.txt
··· 1 + * Rockchip SPDIF transceiver 2 + 3 + The S/PDIF audio block is a stereo transceiver that allows the 4 + processor to receive and transmit digital audio via an coaxial cable or 5 + a fibre cable. 6 + 7 + Required properties: 8 + 9 + - compatible: should be one of the following: 10 + - "rockchip,rk3288-spdif", "rockchip,rk3188-spdif" or 11 + "rockchip,rk3066-spdif" 12 + - reg: physical base address of the controller and length of memory mapped 13 + region. 14 + - interrupts: should contain the SPDIF interrupt. 15 + - dmas: DMA specifiers for tx dma. See the DMA client binding, 16 + Documentation/devicetree/bindings/dma/dma.txt 17 + - dma-names: should be "tx" 18 + - clocks: a list of phandle + clock-specifier pairs, one for each entry 19 + in clock-names. 20 + - clock-names: should contain following: 21 + - "hclk": clock for SPDIF controller 22 + - "mclk" : clock for SPDIF bus 23 + 24 + Required properties on RK3288: 25 + - rockchip,grf: the phandle of the syscon node for the general register 26 + file (GRF) 27 + 28 + Example for the rk3188 SPDIF controller: 29 + 30 + spdif: spdif@0x1011e000 { 31 + compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif"; 32 + reg = <0x1011e000 0x2000>; 33 + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; 34 + dmas = <&dmac1_s 8>; 35 + dma-names = "tx"; 36 + clock-names = "hclk", "mclk"; 37 + clocks = <&cru HCLK_SPDIF>, <&cru SCLK_SPDIF>; 38 + status = "disabled"; 39 + #sound-dai-cells = <0>; 40 + };
include/sound/rcar_snd.h sound/soc/sh/rcar/rcar_snd.h
+1 -18
sound/soc/codecs/rl6347a.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 - #include <linux/moduleparam.h> 15 - #include <linux/init.h> 16 - #include <linux/delay.h> 17 - #include <linux/pm.h> 18 14 #include <linux/i2c.h> 19 - #include <linux/platform_device.h> 20 - #include <linux/spi/spi.h> 21 - #include <linux/dmi.h> 22 - #include <linux/acpi.h> 23 - #include <sound/core.h> 24 - #include <sound/pcm.h> 25 - #include <sound/pcm_params.h> 26 - #include <sound/soc.h> 27 - #include <sound/soc-dapm.h> 28 - #include <sound/initval.h> 29 - #include <sound/tlv.h> 30 - #include <sound/jack.h> 31 - #include <linux/workqueue.h> 32 - #include <sound/hda_verbs.h> 15 + #include <linux/regmap.h> 33 16 34 17 #include "rl6347a.h" 35 18
+2
sound/soc/codecs/rl6347a.h
··· 12 12 #ifndef __RL6347A_H__ 13 13 #define __RL6347A_H__ 14 14 15 + #include <sound/hda_verbs.h> 16 + 15 17 #define VERB_CMD(V, N, D) ((N << 20) | (V << 8) | D) 16 18 17 19 #define RL6347A_VENDOR_REGISTERS 0x20
+6 -3
sound/soc/codecs/rt286.c
··· 29 29 #include <sound/jack.h> 30 30 #include <linux/workqueue.h> 31 31 #include <sound/rt286.h> 32 - #include <sound/hda_verbs.h> 33 32 34 33 #include "rl6347a.h" 35 34 #include "rt286.h" ··· 37 38 #define RT288_VENDOR_ID 0x10ec0288 38 39 39 40 struct rt286_priv { 40 - const struct reg_default *index_cache; 41 + struct reg_default *index_cache; 41 42 int index_cache_size; 42 43 struct regmap *regmap; 43 44 struct snd_soc_codec *codec; ··· 1160 1161 return -ENODEV; 1161 1162 } 1162 1163 1163 - rt286->index_cache = rt286_index_def; 1164 + rt286->index_cache = devm_kmemdup(&i2c->dev, rt286_index_def, 1165 + sizeof(rt286_index_def), GFP_KERNEL); 1166 + if (!rt286->index_cache) 1167 + return -ENOMEM; 1168 + 1164 1169 rt286->index_cache_size = INDEX_CACHE_SIZE; 1165 1170 rt286->i2c = i2c; 1166 1171 i2c_set_clientdata(i2c, rt286);
-1
sound/soc/codecs/rt298.c
··· 28 28 #include <sound/jack.h> 29 29 #include <linux/workqueue.h> 30 30 #include <sound/rt298.h> 31 - #include <sound/hda_verbs.h> 32 31 33 32 #include "rl6347a.h" 34 33 #include "rt298.h"
+8
sound/soc/rockchip/Kconfig
··· 15 15 Rockchip I2S device. The device supports upto maximum of 16 16 8 channels each for play and record. 17 17 18 + config SND_SOC_ROCKCHIP_SPDIF 19 + tristate "Rockchip SPDIF Device Driver" 20 + depends on CLKDEV_LOOKUP && SND_SOC_ROCKCHIP 21 + select SND_SOC_GENERIC_DMAENGINE_PCM 22 + help 23 + Say Y or M if you want to add support for SPDIF driver for 24 + Rockchip SPDIF transceiver device. 25 + 18 26 config SND_SOC_ROCKCHIP_MAX98090 19 27 tristate "ASoC support for Rockchip boards using a MAX98090 codec" 20 28 depends on SND_SOC_ROCKCHIP && I2C && GPIOLIB && CLKDEV_LOOKUP
+4 -2
sound/soc/rockchip/Makefile
··· 1 1 # ROCKCHIP Platform Support 2 - snd-soc-i2s-objs := rockchip_i2s.o 2 + snd-soc-rockchip-i2s-objs := rockchip_i2s.o 3 + snd-soc-rockchip-spdif-objs := rockchip_spdif.o 3 4 4 - obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-i2s.o 5 + obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-rockchip-i2s.o 6 + obj-$(CONFIG_SND_SOC_ROCKCHIP_SPDIF) += snd-soc-rockchip-spdif.o 5 7 6 8 snd-soc-rockchip-max98090-objs := rockchip_max98090.o 7 9 snd-soc-rockchip-rt5645-objs := rockchip_rt5645.o
+46 -2
sound/soc/rockchip/rockchip_i2s.c
··· 226 226 struct snd_soc_dai *dai) 227 227 { 228 228 struct rk_i2s_dev *i2s = to_info(dai); 229 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 229 230 unsigned int val = 0; 230 231 231 232 switch (params_format(params)) { ··· 246 245 return -EINVAL; 247 246 } 248 247 249 - regmap_update_bits(i2s->regmap, I2S_TXCR, I2S_TXCR_VDW_MASK, val); 250 - regmap_update_bits(i2s->regmap, I2S_RXCR, I2S_RXCR_VDW_MASK, val); 248 + switch (params_channels(params)) { 249 + case 8: 250 + val |= I2S_CHN_8; 251 + break; 252 + case 6: 253 + val |= I2S_CHN_6; 254 + break; 255 + case 4: 256 + val |= I2S_CHN_4; 257 + break; 258 + case 2: 259 + val |= I2S_CHN_2; 260 + break; 261 + default: 262 + dev_err(i2s->dev, "invalid channel: %d\n", 263 + params_channels(params)); 264 + return -EINVAL; 265 + } 266 + 267 + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) 268 + regmap_update_bits(i2s->regmap, I2S_RXCR, 269 + I2S_RXCR_VDW_MASK | I2S_RXCR_CSR_MASK, 270 + val); 271 + else 272 + regmap_update_bits(i2s->regmap, I2S_TXCR, 273 + I2S_TXCR_VDW_MASK | I2S_TXCR_CSR_MASK, 274 + val); 275 + 251 276 regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_TDL_MASK, 252 277 I2S_DMACR_TDL(16)); 253 278 regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_RDL_MASK, 254 279 I2S_DMACR_RDL(16)); 255 280 281 + val = I2S_CKR_TRCM_TXRX; 282 + if (dai->driver->symmetric_rates || rtd->dai_link->symmetric_rates) 283 + val = I2S_CKR_TRCM_TXSHARE; 284 + 285 + regmap_update_bits(i2s->regmap, I2S_CKR, 286 + I2S_CKR_TRCM_MASK, 287 + val); 256 288 return 0; 257 289 } 258 290 ··· 449 415 450 416 static int rockchip_i2s_probe(struct platform_device *pdev) 451 417 { 418 + struct device_node *node = pdev->dev.of_node; 452 419 struct rk_i2s_dev *i2s; 453 420 struct resource *res; 454 421 void __iomem *regs; 455 422 int ret; 423 + int val; 456 424 457 425 i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); 458 426 if (!i2s) { ··· 509 473 ret = i2s_runtime_resume(&pdev->dev); 510 474 if (ret) 511 475 goto err_pm_disable; 476 + } 477 + 478 + /* refine capture channels */ 479 + if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) { 480 + if (val >= 2 && val <= 8) 481 + rockchip_i2s_dai.capture.channels_max = val; 482 + else 483 + rockchip_i2s_dai.capture.channels_max = 2; 512 484 } 513 485 514 486 ret = devm_snd_soc_register_component(&pdev->dev,
+16
sound/soc/rockchip/rockchip_i2s.h
··· 49 49 * RXCR 50 50 * receive operation control register 51 51 */ 52 + #define I2S_RXCR_CSR_SHIFT 15 53 + #define I2S_RXCR_CSR(x) (x << I2S_RXCR_CSR_SHIFT) 54 + #define I2S_RXCR_CSR_MASK (3 << I2S_RXCR_CSR_SHIFT) 52 55 #define I2S_RXCR_HWT BIT(14) 53 56 #define I2S_RXCR_SJM_SHIFT 12 54 57 #define I2S_RXCR_SJM_R (0 << I2S_RXCR_SJM_SHIFT) ··· 78 75 * CKR 79 76 * clock generation register 80 77 */ 78 + #define I2S_CKR_TRCM_SHIFT 28 79 + #define I2S_CKR_TRCM(x) (x << I2S_CKR_TRCM_SHIFT) 80 + #define I2S_CKR_TRCM_TXRX (0 << I2S_CKR_TRCM_SHIFT) 81 + #define I2S_CKR_TRCM_TXSHARE (1 << I2S_CKR_TRCM_SHIFT) 82 + #define I2S_CKR_TRCM_RXSHARE (2 << I2S_CKR_TRCM_SHIFT) 83 + #define I2S_CKR_TRCM_MASK (3 << I2S_CKR_TRCM_SHIFT) 81 84 #define I2S_CKR_MSS_SHIFT 27 82 85 #define I2S_CKR_MSS_MASTER (0 << I2S_CKR_MSS_SHIFT) 83 86 #define I2S_CKR_MSS_SLAVE (1 << I2S_CKR_MSS_SHIFT) ··· 215 206 ROCKCHIP_DIV_MCLK = 0, 216 207 ROCKCHIP_DIV_BCLK, 217 208 }; 209 + 210 + /* channel select */ 211 + #define I2S_CSR_SHIFT 15 212 + #define I2S_CHN_2 (0 << I2S_CSR_SHIFT) 213 + #define I2S_CHN_4 (1 << I2S_CSR_SHIFT) 214 + #define I2S_CHN_6 (2 << I2S_CSR_SHIFT) 215 + #define I2S_CHN_8 (3 << I2S_CSR_SHIFT) 218 216 219 217 /* I2S REGS */ 220 218 #define I2S_TXCR (0x0000)
+405
sound/soc/rockchip/rockchip_spdif.c
··· 1 + /* sound/soc/rockchip/rk_spdif.c 2 + * 3 + * ALSA SoC Audio Layer - Rockchip I2S Controller driver 4 + * 5 + * Copyright (c) 2014 Rockchip Electronics Co. Ltd. 6 + * Author: Jianqun <jay.xu@rock-chips.com> 7 + * Copyright (c) 2015 Collabora Ltd. 8 + * Author: Sjoerd Simons <sjoerd.simons@collabora.co.uk> 9 + * 10 + * This program is free software; you can redistribute it and/or modify 11 + * it under the terms of the GNU General Public License version 2 as 12 + * published by the Free Software Foundation. 13 + */ 14 + 15 + #include <linux/module.h> 16 + #include <linux/delay.h> 17 + #include <linux/of_gpio.h> 18 + #include <linux/clk.h> 19 + #include <linux/pm_runtime.h> 20 + #include <linux/mfd/syscon.h> 21 + #include <linux/regmap.h> 22 + #include <sound/pcm_params.h> 23 + #include <sound/dmaengine_pcm.h> 24 + 25 + #include "rockchip_spdif.h" 26 + 27 + enum rk_spdif_type { 28 + RK_SPDIF_RK3066, 29 + RK_SPDIF_RK3188, 30 + RK_SPDIF_RK3288, 31 + }; 32 + 33 + #define RK3288_GRF_SOC_CON2 0x24c 34 + 35 + struct rk_spdif_dev { 36 + struct device *dev; 37 + 38 + struct clk *mclk; 39 + struct clk *hclk; 40 + 41 + struct snd_dmaengine_dai_dma_data playback_dma_data; 42 + 43 + struct regmap *regmap; 44 + }; 45 + 46 + static const struct of_device_id rk_spdif_match[] = { 47 + { .compatible = "rockchip,rk3066-spdif", 48 + .data = (void *) RK_SPDIF_RK3066 }, 49 + { .compatible = "rockchip,rk3188-spdif", 50 + .data = (void *) RK_SPDIF_RK3188 }, 51 + { .compatible = "rockchip,rk3288-spdif", 52 + .data = (void *) RK_SPDIF_RK3288 }, 53 + {}, 54 + }; 55 + MODULE_DEVICE_TABLE(of, rk_spdif_match); 56 + 57 + static int rk_spdif_runtime_suspend(struct device *dev) 58 + { 59 + struct rk_spdif_dev *spdif = dev_get_drvdata(dev); 60 + 61 + clk_disable_unprepare(spdif->mclk); 62 + clk_disable_unprepare(spdif->hclk); 63 + 64 + return 0; 65 + } 66 + 67 + static int rk_spdif_runtime_resume(struct device *dev) 68 + { 69 + struct rk_spdif_dev *spdif = dev_get_drvdata(dev); 70 + int ret; 71 + 72 + ret = clk_prepare_enable(spdif->mclk); 73 + if (ret) { 74 + dev_err(spdif->dev, "mclk clock enable failed %d\n", ret); 75 + return ret; 76 + } 77 + 78 + ret = clk_prepare_enable(spdif->hclk); 79 + if (ret) { 80 + dev_err(spdif->dev, "hclk clock enable failed %d\n", ret); 81 + return ret; 82 + } 83 + 84 + return 0; 85 + } 86 + 87 + static int rk_spdif_hw_params(struct snd_pcm_substream *substream, 88 + struct snd_pcm_hw_params *params, 89 + struct snd_soc_dai *dai) 90 + { 91 + struct rk_spdif_dev *spdif = snd_soc_dai_get_drvdata(dai); 92 + unsigned int val = SPDIF_CFGR_HALFWORD_ENABLE; 93 + int srate, mclk; 94 + int ret; 95 + 96 + srate = params_rate(params); 97 + switch (srate) { 98 + case 32000: 99 + case 48000: 100 + case 96000: 101 + mclk = 96000 * 128; /* 12288000 hz */ 102 + break; 103 + case 44100: 104 + mclk = 44100 * 256; /* 11289600 hz */ 105 + break; 106 + case 192000: 107 + mclk = 192000 * 128; /* 24576000 hz */ 108 + break; 109 + default: 110 + return -EINVAL; 111 + } 112 + 113 + switch (params_format(params)) { 114 + case SNDRV_PCM_FORMAT_S16_LE: 115 + val |= SPDIF_CFGR_VDW_16; 116 + break; 117 + case SNDRV_PCM_FORMAT_S20_3LE: 118 + val |= SPDIF_CFGR_VDW_20; 119 + break; 120 + case SNDRV_PCM_FORMAT_S24_LE: 121 + val |= SPDIF_CFGR_VDW_24; 122 + break; 123 + default: 124 + return -EINVAL; 125 + } 126 + 127 + /* Set clock and calculate divider */ 128 + ret = clk_set_rate(spdif->mclk, mclk); 129 + if (ret != 0) { 130 + dev_err(spdif->dev, "Failed to set module clock rate: %d\n", 131 + ret); 132 + return ret; 133 + } 134 + 135 + val |= SPDIF_CFGR_CLK_DIV(mclk/(srate * 256)); 136 + ret = regmap_update_bits(spdif->regmap, SPDIF_CFGR, 137 + SPDIF_CFGR_CLK_DIV_MASK | SPDIF_CFGR_HALFWORD_ENABLE | 138 + SDPIF_CFGR_VDW_MASK, 139 + val); 140 + 141 + return ret; 142 + } 143 + 144 + static int rk_spdif_trigger(struct snd_pcm_substream *substream, 145 + int cmd, struct snd_soc_dai *dai) 146 + { 147 + struct rk_spdif_dev *spdif = snd_soc_dai_get_drvdata(dai); 148 + int ret; 149 + 150 + switch (cmd) { 151 + case SNDRV_PCM_TRIGGER_START: 152 + case SNDRV_PCM_TRIGGER_RESUME: 153 + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 154 + ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR, 155 + SPDIF_DMACR_TDE_ENABLE, 156 + SPDIF_DMACR_TDE_ENABLE); 157 + 158 + if (ret != 0) 159 + return ret; 160 + 161 + ret = regmap_update_bits(spdif->regmap, SPDIF_XFER, 162 + SPDIF_XFER_TXS_START, 163 + SPDIF_XFER_TXS_START); 164 + break; 165 + case SNDRV_PCM_TRIGGER_SUSPEND: 166 + case SNDRV_PCM_TRIGGER_STOP: 167 + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 168 + ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR, 169 + SPDIF_DMACR_TDE_ENABLE, 170 + SPDIF_DMACR_TDE_DISABLE); 171 + 172 + if (ret != 0) 173 + return ret; 174 + 175 + ret = regmap_update_bits(spdif->regmap, SPDIF_XFER, 176 + SPDIF_XFER_TXS_START, 177 + SPDIF_XFER_TXS_STOP); 178 + break; 179 + default: 180 + ret = -EINVAL; 181 + break; 182 + } 183 + 184 + return ret; 185 + } 186 + 187 + static int rk_spdif_dai_probe(struct snd_soc_dai *dai) 188 + { 189 + struct rk_spdif_dev *spdif = snd_soc_dai_get_drvdata(dai); 190 + 191 + dai->playback_dma_data = &spdif->playback_dma_data; 192 + 193 + return 0; 194 + } 195 + 196 + static const struct snd_soc_dai_ops rk_spdif_dai_ops = { 197 + .hw_params = rk_spdif_hw_params, 198 + .trigger = rk_spdif_trigger, 199 + }; 200 + 201 + static struct snd_soc_dai_driver rk_spdif_dai = { 202 + .probe = rk_spdif_dai_probe, 203 + .playback = { 204 + .stream_name = "Playback", 205 + .channels_min = 2, 206 + .channels_max = 2, 207 + .rates = (SNDRV_PCM_RATE_32000 | 208 + SNDRV_PCM_RATE_44100 | 209 + SNDRV_PCM_RATE_48000 | 210 + SNDRV_PCM_RATE_96000 | 211 + SNDRV_PCM_RATE_192000), 212 + .formats = (SNDRV_PCM_FMTBIT_S16_LE | 213 + SNDRV_PCM_FMTBIT_S20_3LE | 214 + SNDRV_PCM_FMTBIT_S24_LE), 215 + }, 216 + .ops = &rk_spdif_dai_ops, 217 + }; 218 + 219 + static const struct snd_soc_component_driver rk_spdif_component = { 220 + .name = "rockchip-spdif", 221 + }; 222 + 223 + static bool rk_spdif_wr_reg(struct device *dev, unsigned int reg) 224 + { 225 + switch (reg) { 226 + case SPDIF_CFGR: 227 + case SPDIF_DMACR: 228 + case SPDIF_INTCR: 229 + case SPDIF_XFER: 230 + case SPDIF_SMPDR: 231 + return true; 232 + default: 233 + return false; 234 + } 235 + } 236 + 237 + static bool rk_spdif_rd_reg(struct device *dev, unsigned int reg) 238 + { 239 + switch (reg) { 240 + case SPDIF_CFGR: 241 + case SPDIF_SDBLR: 242 + case SPDIF_INTCR: 243 + case SPDIF_INTSR: 244 + case SPDIF_XFER: 245 + return true; 246 + default: 247 + return false; 248 + } 249 + } 250 + 251 + static bool rk_spdif_volatile_reg(struct device *dev, unsigned int reg) 252 + { 253 + switch (reg) { 254 + case SPDIF_INTSR: 255 + case SPDIF_SDBLR: 256 + return true; 257 + default: 258 + return false; 259 + } 260 + } 261 + 262 + static const struct regmap_config rk_spdif_regmap_config = { 263 + .reg_bits = 32, 264 + .reg_stride = 4, 265 + .val_bits = 32, 266 + .max_register = SPDIF_SMPDR, 267 + .writeable_reg = rk_spdif_wr_reg, 268 + .readable_reg = rk_spdif_rd_reg, 269 + .volatile_reg = rk_spdif_volatile_reg, 270 + .cache_type = REGCACHE_FLAT, 271 + }; 272 + 273 + static int rk_spdif_probe(struct platform_device *pdev) 274 + { 275 + struct device_node *np = pdev->dev.of_node; 276 + struct rk_spdif_dev *spdif; 277 + const struct of_device_id *match; 278 + struct resource *res; 279 + void __iomem *regs; 280 + int ret; 281 + 282 + match = of_match_node(rk_spdif_match, np); 283 + if ((int) match->data == RK_SPDIF_RK3288) { 284 + struct regmap *grf; 285 + 286 + grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); 287 + if (IS_ERR(grf)) { 288 + dev_err(&pdev->dev, 289 + "rockchip_spdif missing 'rockchip,grf' \n"); 290 + return PTR_ERR(grf); 291 + } 292 + 293 + /* Select the 8 channel SPDIF solution on RK3288 as 294 + * the 2 channel one does not appear to work 295 + */ 296 + regmap_write(grf, RK3288_GRF_SOC_CON2, BIT(1) << 16); 297 + } 298 + 299 + spdif = devm_kzalloc(&pdev->dev, sizeof(*spdif), GFP_KERNEL); 300 + if (!spdif) 301 + return -ENOMEM; 302 + 303 + spdif->hclk = devm_clk_get(&pdev->dev, "hclk"); 304 + if (IS_ERR(spdif->hclk)) { 305 + dev_err(&pdev->dev, "Can't retrieve rk_spdif bus clock\n"); 306 + return PTR_ERR(spdif->hclk); 307 + } 308 + ret = clk_prepare_enable(spdif->hclk); 309 + if (ret) { 310 + dev_err(spdif->dev, "hclock enable failed %d\n", ret); 311 + return ret; 312 + } 313 + 314 + spdif->mclk = devm_clk_get(&pdev->dev, "mclk"); 315 + if (IS_ERR(spdif->mclk)) { 316 + dev_err(&pdev->dev, "Can't retrieve rk_spdif master clock\n"); 317 + return PTR_ERR(spdif->mclk); 318 + } 319 + 320 + ret = clk_prepare_enable(spdif->mclk); 321 + if (ret) { 322 + dev_err(spdif->dev, "clock enable failed %d\n", ret); 323 + return ret; 324 + } 325 + 326 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 327 + regs = devm_ioremap_resource(&pdev->dev, res); 328 + if (IS_ERR(regs)) 329 + return PTR_ERR(regs); 330 + 331 + spdif->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "hclk", regs, 332 + &rk_spdif_regmap_config); 333 + if (IS_ERR(spdif->regmap)) { 334 + dev_err(&pdev->dev, 335 + "Failed to initialise managed register map\n"); 336 + return PTR_ERR(spdif->regmap); 337 + } 338 + 339 + spdif->playback_dma_data.addr = res->start + SPDIF_SMPDR; 340 + spdif->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 341 + spdif->playback_dma_data.maxburst = 4; 342 + 343 + spdif->dev = &pdev->dev; 344 + dev_set_drvdata(&pdev->dev, spdif); 345 + 346 + pm_runtime_set_active(&pdev->dev); 347 + pm_runtime_enable(&pdev->dev); 348 + pm_request_idle(&pdev->dev); 349 + 350 + ret = devm_snd_soc_register_component(&pdev->dev, 351 + &rk_spdif_component, 352 + &rk_spdif_dai, 1); 353 + if (ret) { 354 + dev_err(&pdev->dev, "Could not register DAI\n"); 355 + goto err_pm_runtime; 356 + } 357 + 358 + ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); 359 + if (ret) { 360 + dev_err(&pdev->dev, "Could not register PCM\n"); 361 + goto err_pm_runtime; 362 + } 363 + 364 + return 0; 365 + 366 + err_pm_runtime: 367 + pm_runtime_disable(&pdev->dev); 368 + 369 + return ret; 370 + } 371 + 372 + static int rk_spdif_remove(struct platform_device *pdev) 373 + { 374 + struct rk_spdif_dev *spdif = dev_get_drvdata(&pdev->dev); 375 + 376 + pm_runtime_disable(&pdev->dev); 377 + if (!pm_runtime_status_suspended(&pdev->dev)) 378 + rk_spdif_runtime_suspend(&pdev->dev); 379 + 380 + clk_disable_unprepare(spdif->mclk); 381 + clk_disable_unprepare(spdif->hclk); 382 + 383 + return 0; 384 + } 385 + 386 + static const struct dev_pm_ops rk_spdif_pm_ops = { 387 + SET_RUNTIME_PM_OPS(rk_spdif_runtime_suspend, rk_spdif_runtime_resume, 388 + NULL) 389 + }; 390 + 391 + static struct platform_driver rk_spdif_driver = { 392 + .probe = rk_spdif_probe, 393 + .remove = rk_spdif_remove, 394 + .driver = { 395 + .name = "rockchip-spdif", 396 + .of_match_table = of_match_ptr(rk_spdif_match), 397 + .pm = &rk_spdif_pm_ops, 398 + }, 399 + }; 400 + module_platform_driver(rk_spdif_driver); 401 + 402 + MODULE_ALIAS("platform:rockchip-spdif"); 403 + MODULE_DESCRIPTION("ROCKCHIP SPDIF transceiver Interface"); 404 + MODULE_AUTHOR("Sjoerd Simons <sjoerd.simons@collabora.co.uk>"); 405 + MODULE_LICENSE("GPL v2");
+63
sound/soc/rockchip/rockchip_spdif.h
··· 1 + /* 2 + * ALSA SoC Audio Layer - Rockchip SPDIF transceiver driver 3 + * 4 + * Copyright (c) 2015 Collabora Ltd. 5 + * Author: Sjoerd Simons <sjoerd.simons@collabora.co.uk> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * published by the Free Software Foundation. 10 + */ 11 + 12 + #ifndef _ROCKCHIP_SPDIF_H 13 + #define _ROCKCHIP_SPDIF_H 14 + 15 + /* 16 + * CFGR 17 + * transfer configuration register 18 + */ 19 + #define SPDIF_CFGR_CLK_DIV_SHIFT (16) 20 + #define SPDIF_CFGR_CLK_DIV_MASK (0xff << SPDIF_CFGR_CLK_DIV_SHIFT) 21 + #define SPDIF_CFGR_CLK_DIV(x) (x << SPDIF_CFGR_CLK_DIV_SHIFT) 22 + 23 + #define SPDIF_CFGR_HALFWORD_SHIFT 2 24 + #define SPDIF_CFGR_HALFWORD_DISABLE (0 << SPDIF_CFGR_HALFWORD_SHIFT) 25 + #define SPDIF_CFGR_HALFWORD_ENABLE (1 << SPDIF_CFGR_HALFWORD_SHIFT) 26 + 27 + #define SPDIF_CFGR_VDW_SHIFT 0 28 + #define SPDIF_CFGR_VDW(x) (x << SPDIF_CFGR_VDW_SHIFT) 29 + #define SDPIF_CFGR_VDW_MASK (0xf << SPDIF_CFGR_VDW_SHIFT) 30 + 31 + #define SPDIF_CFGR_VDW_16 SPDIF_CFGR_VDW(0x00) 32 + #define SPDIF_CFGR_VDW_20 SPDIF_CFGR_VDW(0x01) 33 + #define SPDIF_CFGR_VDW_24 SPDIF_CFGR_VDW(0x10) 34 + 35 + /* 36 + * DMACR 37 + * DMA control register 38 + */ 39 + #define SPDIF_DMACR_TDE_SHIFT 5 40 + #define SPDIF_DMACR_TDE_DISABLE (0 << SPDIF_DMACR_TDE_SHIFT) 41 + #define SPDIF_DMACR_TDE_ENABLE (1 << SPDIF_DMACR_TDE_SHIFT) 42 + 43 + #define SPDIF_DMACR_TDL_SHIFT 0 44 + #define SPDIF_DMACR_TDL(x) ((x) << SPDIF_DMACR_TDL_SHIFT) 45 + #define SPDIF_DMACR_TDL_MASK (0x1f << SDPIF_DMACR_TDL_SHIFT) 46 + 47 + /* 48 + * XFER 49 + * Transfer control register 50 + */ 51 + #define SPDIF_XFER_TXS_SHIFT 0 52 + #define SPDIF_XFER_TXS_STOP (0 << SPDIF_XFER_TXS_SHIFT) 53 + #define SPDIF_XFER_TXS_START (1 << SPDIF_XFER_TXS_SHIFT) 54 + 55 + #define SPDIF_CFGR (0x0000) 56 + #define SPDIF_SDBLR (0x0004) 57 + #define SPDIF_DMACR (0x0008) 58 + #define SPDIF_INTCR (0x000c) 59 + #define SPDIF_INTSR (0x0010) 60 + #define SPDIF_XFER (0x0018) 61 + #define SPDIF_SMPDR (0x0020) 62 + 63 + #endif /* _ROCKCHIP_SPDIF_H */
+1 -2
sound/soc/sh/rcar/adg.c
··· 69 69 static u32 rsnd_adg_ssi_ws_timing_gen2(struct rsnd_dai_stream *io) 70 70 { 71 71 struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io); 72 - struct rsnd_priv *priv = rsnd_mod_to_priv(mod); 73 72 int id = rsnd_mod_id(mod); 74 73 int ws = id; 75 74 76 - if (rsnd_ssi_is_pin_sharing(rsnd_ssi_mod_get(priv, id))) { 75 + if (rsnd_ssi_is_pin_sharing(io)) { 77 76 switch (id) { 78 77 case 1: 79 78 case 2:
+15 -39
sound/soc/sh/rcar/core.c
··· 300 300 /* 301 301 * rsnd_dai functions 302 302 */ 303 - #define __rsnd_mod_call(mod, io, func, param...) \ 303 + #define rsnd_mod_call(mod, io, func, param...) \ 304 304 ({ \ 305 305 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \ 306 306 struct device *dev = rsnd_priv_to_dev(priv); \ ··· 308 308 u8 val = (mod->status >> __rsnd_mod_shift_##func) & 0xF; \ 309 309 u8 add = ((val + __rsnd_mod_add_##func) & 0xF); \ 310 310 int ret = 0; \ 311 - int called = 0; \ 312 - if (val == __rsnd_mod_call_##func) { \ 313 - called = 1; \ 314 - ret = (mod)->ops->func(mod, io, param); \ 315 - } \ 311 + int call = (val == __rsnd_mod_call_##func) && (mod)->ops->func; \ 316 312 mod->status = (mod->status & ~mask) + \ 317 313 (add << __rsnd_mod_shift_##func); \ 318 - dev_dbg(dev, "%s[%d] 0x%08x %s\n", \ 319 - rsnd_mod_name(mod), rsnd_mod_id(mod), mod->status, \ 320 - called ? #func : ""); \ 314 + dev_dbg(dev, "%s[%d]\t0x%08x %s\n", \ 315 + rsnd_mod_name(mod), rsnd_mod_id(mod), \ 316 + mod->status, call ? #func : ""); \ 317 + if (call) \ 318 + ret = (mod)->ops->func(mod, io, param); \ 321 319 ret; \ 322 320 }) 323 - 324 - #define rsnd_mod_call(mod, io, func, param...) \ 325 - (!(mod) ? -ENODEV : \ 326 - !((mod)->ops->func) ? 0 : \ 327 - __rsnd_mod_call(mod, io, func, param)) 328 321 329 322 #define rsnd_dai_call(fn, io, param...) \ 330 323 ({ \ ··· 327 334 mod = (io)->mod[i]; \ 328 335 if (!mod) \ 329 336 continue; \ 330 - ret = rsnd_mod_call(mod, io, fn, param); \ 331 - if (ret < 0) \ 332 - break; \ 337 + ret |= rsnd_mod_call(mod, io, fn, param); \ 333 338 } \ 334 339 ret; \ 335 340 }) ··· 493 502 break; 494 503 case SNDRV_PCM_TRIGGER_STOP: 495 504 ret = rsnd_dai_call(stop, io, priv); 496 - if (ret < 0) 497 - goto dai_trigger_end; 498 505 499 - ret = rsnd_dai_call(quit, io, priv); 500 - if (ret < 0) 501 - goto dai_trigger_end; 506 + ret |= rsnd_dai_call(quit, io, priv); 502 507 503 - ret = rsnd_platform_call(priv, dai, stop, ssi_id); 504 - if (ret < 0) 505 - goto dai_trigger_end; 508 + ret |= rsnd_platform_call(priv, dai, stop, ssi_id); 506 509 507 510 rsnd_dai_stream_quit(io); 508 511 break; ··· 1221 1236 }; 1222 1237 int ret, i; 1223 1238 1224 - info = NULL; 1225 - of_data = NULL; 1226 - if (of_id) { 1227 - info = devm_kzalloc(&pdev->dev, 1228 - sizeof(struct rcar_snd_info), GFP_KERNEL); 1229 - of_data = of_id->data; 1230 - } else { 1231 - info = pdev->dev.platform_data; 1232 - } 1233 - 1234 - if (!info) { 1235 - dev_err(dev, "driver needs R-Car sound information\n"); 1236 - return -ENODEV; 1237 - } 1239 + info = devm_kzalloc(&pdev->dev, sizeof(struct rcar_snd_info), 1240 + GFP_KERNEL); 1241 + if (!info) 1242 + return -ENOMEM; 1243 + of_data = of_id->data; 1238 1244 1239 1245 /* 1240 1246 * init priv data
+4 -6
sound/soc/sh/rcar/ctu.c
··· 35 35 struct rsnd_dai_stream *io, 36 36 struct rsnd_priv *priv) 37 37 { 38 - rsnd_mod_hw_start(mod); 38 + rsnd_mod_power_on(mod); 39 39 40 40 rsnd_ctu_initialize_lock(mod); 41 41 ··· 50 50 struct rsnd_dai_stream *io, 51 51 struct rsnd_priv *priv) 52 52 { 53 - rsnd_mod_hw_stop(mod); 53 + rsnd_mod_power_off(mod); 54 54 55 55 return 0; 56 56 } ··· 118 118 int i, nr, ret; 119 119 120 120 /* This driver doesn't support Gen1 at this point */ 121 - if (rsnd_is_gen1(priv)) { 122 - dev_warn(dev, "CTU is not supported on Gen1\n"); 123 - return -EINVAL; 124 - } 121 + if (rsnd_is_gen1(priv)) 122 + return 0; 125 123 126 124 rsnd_of_parse_ctu(pdev, of_data, priv); 127 125
+1 -1
sound/soc/sh/rcar/dma.c
··· 470 470 dev_err(dev, "DVC is selected without SRC\n"); 471 471 472 472 /* use SSIU or SSI ? */ 473 - if (is_ssi && rsnd_ssi_use_busif(io, mod)) 473 + if (is_ssi && rsnd_ssi_use_busif(io)) 474 474 is_ssi++; 475 475 476 476 return (is_from) ?
+4 -6
sound/soc/sh/rcar/dvc.c
··· 153 153 struct rsnd_dai_stream *io, 154 154 struct rsnd_priv *priv) 155 155 { 156 - rsnd_mod_hw_start(mod); 156 + rsnd_mod_power_on(mod); 157 157 158 158 rsnd_dvc_soft_reset(mod); 159 159 ··· 175 175 struct rsnd_dai_stream *io, 176 176 struct rsnd_priv *priv) 177 177 { 178 - rsnd_mod_hw_stop(mod); 178 + rsnd_mod_power_off(mod); 179 179 180 180 return 0; 181 181 } ··· 333 333 int i, nr, ret; 334 334 335 335 /* This driver doesn't support Gen1 at this point */ 336 - if (rsnd_is_gen1(priv)) { 337 - dev_warn(dev, "CMD is not supported on Gen1\n"); 338 - return -EINVAL; 339 - } 336 + if (rsnd_is_gen1(priv)) 337 + return 0; 340 338 341 339 rsnd_of_parse_dvc(pdev, of_data, priv); 342 340
+9 -5
sound/soc/sh/rcar/gen.c
··· 22 22 #include "rsnd.h" 23 23 24 24 struct rsnd_gen { 25 - void __iomem *base[RSND_BASE_MAX]; 26 - 27 25 struct rsnd_gen_ops *ops; 28 26 27 + /* RSND_BASE_MAX base */ 28 + void __iomem *base[RSND_BASE_MAX]; 29 + phys_addr_t res[RSND_BASE_MAX]; 29 30 struct regmap *regmap[RSND_BASE_MAX]; 31 + 32 + /* RSND_REG_MAX base */ 30 33 struct regmap_field *regs[RSND_REG_MAX]; 31 - phys_addr_t res[RSND_REG_MAX]; 32 34 }; 33 35 34 36 #define rsnd_priv_to_gen(p) ((struct rsnd_gen *)(p)->gen) ··· 81 79 if (!rsnd_is_accessible_reg(priv, gen, reg)) 82 80 return 0; 83 81 82 + regmap_fields_read(gen->regs[reg], rsnd_mod_id(mod), &val); 83 + 84 84 dev_dbg(dev, "r %s[%d] - %4d : %08x\n", 85 85 rsnd_mod_name(mod), rsnd_mod_id(mod), reg, val); 86 - 87 - regmap_fields_read(gen->regs[reg], rsnd_mod_id(mod), &val); 88 86 89 87 return val; 90 88 } ··· 184 182 if (IS_ERR(regmap)) 185 183 return PTR_ERR(regmap); 186 184 185 + /* RSND_BASE_MAX base */ 187 186 gen->base[reg_id] = base; 188 187 gen->regmap[reg_id] = regmap; 189 188 gen->res[reg_id] = res->start; ··· 201 198 if (IS_ERR(regs)) 202 199 return PTR_ERR(regs); 203 200 201 + /* RSND_REG_MAX base */ 204 202 gen->regs[conf[i].idx] = regs; 205 203 } 206 204
+4 -6
sound/soc/sh/rcar/mix.c
··· 58 58 struct rsnd_dai_stream *io, 59 59 struct rsnd_priv *priv) 60 60 { 61 - rsnd_mod_hw_start(mod); 61 + rsnd_mod_power_on(mod); 62 62 63 63 rsnd_mix_soft_reset(mod); 64 64 ··· 83 83 struct rsnd_dai_stream *io, 84 84 struct rsnd_priv *priv) 85 85 { 86 - rsnd_mod_hw_stop(mod); 86 + rsnd_mod_power_off(mod); 87 87 88 88 return 0; 89 89 } ··· 151 151 int i, nr, ret; 152 152 153 153 /* This driver doesn't support Gen1 at this point */ 154 - if (rsnd_is_gen1(priv)) { 155 - dev_warn(dev, "MIX is not supported on Gen1\n"); 156 - return -EINVAL; 157 - } 154 + if (rsnd_is_gen1(priv)) 155 + return 0; 158 156 159 157 rsnd_of_parse_mix(pdev, of_data, priv); 160 158
+9 -5
sound/soc/sh/rcar/rsnd.h
··· 21 21 #include <linux/of_irq.h> 22 22 #include <linux/sh_dma.h> 23 23 #include <linux/workqueue.h> 24 - #include <sound/rcar_snd.h> 25 24 #include <sound/soc.h> 26 25 #include <sound/pcm_params.h> 26 + 27 + #include "rcar_snd.h" 27 28 28 29 /* 29 30 * pseudo register ··· 330 329 #define rsnd_mod_to_priv(mod) ((mod)->priv) 331 330 #define rsnd_mod_to_dma(mod) (&(mod)->dma) 332 331 #define rsnd_mod_id(mod) ((mod) ? (mod)->id : -1) 333 - #define rsnd_mod_hw_start(mod) clk_enable((mod)->clk) 334 - #define rsnd_mod_hw_stop(mod) clk_disable((mod)->clk) 332 + #define rsnd_mod_power_on(mod) clk_enable((mod)->clk) 333 + #define rsnd_mod_power_off(mod) clk_disable((mod)->clk) 335 334 #define rsnd_mod_get(ip) (&(ip)->mod) 336 335 337 336 int rsnd_mod_init(struct rsnd_priv *priv, ··· 572 571 void rsnd_ssi_remove(struct platform_device *pdev, 573 572 struct rsnd_priv *priv); 574 573 struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); 575 - int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); 576 574 int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod); 577 - int rsnd_ssi_use_busif(struct rsnd_dai_stream *io, struct rsnd_mod *mod); 575 + int rsnd_ssi_use_busif(struct rsnd_dai_stream *io); 576 + 577 + #define rsnd_ssi_is_pin_sharing(io) \ 578 + __rsnd_ssi_is_pin_sharing(rsnd_io_to_mod_ssi(io)) 579 + int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); 578 580 579 581 /* 580 582 * R-Car SRC
+6 -4
sound/soc/sh/rcar/src.c
··· 159 159 /* 160 160 * SSI_MODE1 161 161 */ 162 - if (rsnd_ssi_is_pin_sharing(ssi_mod)) { 162 + if (rsnd_ssi_is_pin_sharing(io)) { 163 163 int shift = -1; 164 164 switch (ssi_id) { 165 165 case 1: ··· 352 352 { 353 353 struct rsnd_src *src = rsnd_mod_to_src(mod); 354 354 355 - rsnd_mod_hw_start(mod); 355 + rsnd_mod_power_on(mod); 356 356 357 357 rsnd_src_soft_reset(mod); 358 358 ··· 373 373 struct rsnd_src *src = rsnd_mod_to_src(mod); 374 374 struct device *dev = rsnd_priv_to_dev(priv); 375 375 376 - rsnd_mod_hw_stop(mod); 376 + rsnd_mod_power_off(mod); 377 377 378 378 if (src->err) 379 379 dev_warn(dev, "%s[%d] under/over flow err = %d\n", ··· 1036 1036 int i, nr, ret; 1037 1037 1038 1038 ops = NULL; 1039 - if (rsnd_is_gen1(priv)) 1039 + if (rsnd_is_gen1(priv)) { 1040 1040 ops = &rsnd_src_gen1_ops; 1041 + dev_warn(dev, "Gen1 support will be removed soon\n"); 1042 + } 1041 1043 if (rsnd_is_gen2(priv)) 1042 1044 ops = &rsnd_src_gen2_ops; 1043 1045 if (!ops) {
+9 -12
sound/soc/sh/rcar/ssi.c
··· 79 79 80 80 #define rsnd_ssi_nr(priv) ((priv)->ssi_nr) 81 81 #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod) 82 - #define rsnd_dma_to_ssi(dma) rsnd_mod_to_ssi(rsnd_dma_to_mod(dma)) 83 82 #define rsnd_ssi_pio_available(ssi) ((ssi)->info->irq > 0) 84 83 #define rsnd_ssi_parent(ssi) ((ssi)->parent) 85 84 #define rsnd_ssi_mode_flags(p) ((p)->info->flags) ··· 86 87 #define rsnd_ssi_of_node(priv) \ 87 88 of_get_child_by_name(rsnd_priv_to_dev(priv)->of_node, "rcar_sound,ssi") 88 89 89 - int rsnd_ssi_use_busif(struct rsnd_dai_stream *io, struct rsnd_mod *mod) 90 + int rsnd_ssi_use_busif(struct rsnd_dai_stream *io) 90 91 { 92 + struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io); 91 93 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 92 94 int use_busif = 0; 93 95 ··· 184 184 u32 cr; 185 185 186 186 if (0 == ssi->usrcnt) { 187 - rsnd_mod_hw_start(mod); 187 + rsnd_mod_power_on(mod); 188 188 189 189 if (rsnd_rdai_is_clk_master(rdai)) { 190 190 struct rsnd_ssi *ssi_parent = rsnd_ssi_parent(ssi); ··· 265 265 rsnd_ssi_master_clk_stop(ssi); 266 266 } 267 267 268 - rsnd_mod_hw_stop(mod); 268 + rsnd_mod_power_off(mod); 269 269 270 270 ssi->chan = 0; 271 271 } ··· 395 395 { 396 396 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 397 397 398 - rsnd_src_ssiu_start(mod, io, rsnd_ssi_use_busif(io, mod)); 398 + rsnd_src_ssiu_start(mod, io, rsnd_ssi_use_busif(io)); 399 399 400 400 rsnd_ssi_hw_start(ssi, io); 401 401 ··· 555 555 rsnd_dma_quit(io, rsnd_mod_to_dma(mod)); 556 556 557 557 /* PIO will request IRQ again */ 558 - devm_free_irq(dev, irq, ssi); 558 + devm_free_irq(dev, irq, mod); 559 559 560 560 return 0; 561 561 } ··· 614 614 int is_play = rsnd_io_is_play(io); 615 615 char *name; 616 616 617 - if (rsnd_ssi_use_busif(io, mod)) 617 + if (rsnd_ssi_use_busif(io)) 618 618 name = is_play ? "rxu" : "txu"; 619 619 else 620 620 name = is_play ? "rx" : "tx"; ··· 660 660 return rsnd_mod_get((struct rsnd_ssi *)(priv->ssi) + id); 661 661 } 662 662 663 - int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod) 663 + int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod) 664 664 { 665 665 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 666 666 ··· 671 671 { 672 672 struct rsnd_mod *mod = rsnd_mod_get(ssi); 673 673 674 - if (!rsnd_ssi_is_pin_sharing(mod)) 674 + if (!__rsnd_ssi_is_pin_sharing(mod)) 675 675 return; 676 676 677 677 switch (rsnd_mod_id(mod)) { ··· 699 699 struct rcar_snd_info *info = rsnd_priv_to_info(priv); 700 700 struct device *dev = &pdev->dev; 701 701 int nr, i; 702 - 703 - if (!of_data) 704 - return; 705 702 706 703 node = rsnd_ssi_of_node(priv); 707 704 if (!node)