diff options
| -rw-r--r-- | Documentation/devicetree/bindings/sound/da7218.txt | 2 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/sound/da7219.txt | 2 | ||||
| -rw-r--r-- | sound/soc/amd/acp-pcm-dma.c | 7 | ||||
| -rw-r--r-- | sound/soc/atmel/Kconfig | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/da7218.c | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/wm_adsp.c | 12 | ||||
| -rw-r--r-- | sound/soc/fsl/fsl_asrc.h | 4 | ||||
| -rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 44 |
8 files changed, 53 insertions, 22 deletions
diff --git a/Documentation/devicetree/bindings/sound/da7218.txt b/Documentation/devicetree/bindings/sound/da7218.txt index 5ca5a709b6aa..3ab9dfef38d1 100644 --- a/Documentation/devicetree/bindings/sound/da7218.txt +++ b/Documentation/devicetree/bindings/sound/da7218.txt | |||
| @@ -73,7 +73,7 @@ Example: | |||
| 73 | compatible = "dlg,da7218"; | 73 | compatible = "dlg,da7218"; |
| 74 | reg = <0x1a>; | 74 | reg = <0x1a>; |
| 75 | interrupt-parent = <&gpio6>; | 75 | interrupt-parent = <&gpio6>; |
| 76 | interrupts = <11 IRQ_TYPE_LEVEL_HIGH>; | 76 | interrupts = <11 IRQ_TYPE_LEVEL_LOW>; |
| 77 | wakeup-source; | 77 | wakeup-source; |
| 78 | 78 | ||
| 79 | VDD-supply = <®_audio>; | 79 | VDD-supply = <®_audio>; |
diff --git a/Documentation/devicetree/bindings/sound/da7219.txt b/Documentation/devicetree/bindings/sound/da7219.txt index cf61681826b6..5b54d2d045c3 100644 --- a/Documentation/devicetree/bindings/sound/da7219.txt +++ b/Documentation/devicetree/bindings/sound/da7219.txt | |||
| @@ -77,7 +77,7 @@ Example: | |||
| 77 | reg = <0x1a>; | 77 | reg = <0x1a>; |
| 78 | 78 | ||
| 79 | interrupt-parent = <&gpio6>; | 79 | interrupt-parent = <&gpio6>; |
| 80 | interrupts = <11 IRQ_TYPE_LEVEL_HIGH>; | 80 | interrupts = <11 IRQ_TYPE_LEVEL_LOW>; |
| 81 | 81 | ||
| 82 | VDD-supply = <®_audio>; | 82 | VDD-supply = <®_audio>; |
| 83 | VDDMIC-supply = <®_audio>; | 83 | VDDMIC-supply = <®_audio>; |
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 9f521a55d610..b5e41df6bb3a 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c | |||
| @@ -1051,6 +1051,11 @@ static int acp_audio_probe(struct platform_device *pdev) | |||
| 1051 | struct resource *res; | 1051 | struct resource *res; |
| 1052 | const u32 *pdata = pdev->dev.platform_data; | 1052 | const u32 *pdata = pdev->dev.platform_data; |
| 1053 | 1053 | ||
| 1054 | if (!pdata) { | ||
| 1055 | dev_err(&pdev->dev, "Missing platform data\n"); | ||
| 1056 | return -ENODEV; | ||
| 1057 | } | ||
| 1058 | |||
| 1054 | audio_drv_data = devm_kzalloc(&pdev->dev, sizeof(struct audio_drv_data), | 1059 | audio_drv_data = devm_kzalloc(&pdev->dev, sizeof(struct audio_drv_data), |
| 1055 | GFP_KERNEL); | 1060 | GFP_KERNEL); |
| 1056 | if (audio_drv_data == NULL) | 1061 | if (audio_drv_data == NULL) |
| @@ -1058,6 +1063,8 @@ static int acp_audio_probe(struct platform_device *pdev) | |||
| 1058 | 1063 | ||
| 1059 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1064 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 1060 | audio_drv_data->acp_mmio = devm_ioremap_resource(&pdev->dev, res); | 1065 | audio_drv_data->acp_mmio = devm_ioremap_resource(&pdev->dev, res); |
| 1066 | if (IS_ERR(audio_drv_data->acp_mmio)) | ||
| 1067 | return PTR_ERR(audio_drv_data->acp_mmio); | ||
| 1061 | 1068 | ||
| 1062 | /* The following members gets populated in device 'open' | 1069 | /* The following members gets populated in device 'open' |
| 1063 | * function. Till then interrupts are disabled in 'acp_init' | 1070 | * function. Till then interrupts are disabled in 'acp_init' |
diff --git a/sound/soc/atmel/Kconfig b/sound/soc/atmel/Kconfig index 4a56f3dfba51..dcee145dd179 100644 --- a/sound/soc/atmel/Kconfig +++ b/sound/soc/atmel/Kconfig | |||
| @@ -64,7 +64,7 @@ config SND_AT91_SOC_SAM9X5_WM8731 | |||
| 64 | config SND_ATMEL_SOC_CLASSD | 64 | config SND_ATMEL_SOC_CLASSD |
| 65 | tristate "Atmel ASoC driver for boards using CLASSD" | 65 | tristate "Atmel ASoC driver for boards using CLASSD" |
| 66 | depends on ARCH_AT91 || COMPILE_TEST | 66 | depends on ARCH_AT91 || COMPILE_TEST |
| 67 | select SND_ATMEL_SOC_DMA | 67 | select SND_SOC_GENERIC_DMAENGINE_PCM |
| 68 | select REGMAP_MMIO | 68 | select REGMAP_MMIO |
| 69 | help | 69 | help |
| 70 | Say Y if you want to add support for Atmel ASoC driver for boards using | 70 | Say Y if you want to add support for Atmel ASoC driver for boards using |
diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c index b2d42ec1dcd9..56564ce90cb6 100644 --- a/sound/soc/codecs/da7218.c +++ b/sound/soc/codecs/da7218.c | |||
| @@ -2520,7 +2520,7 @@ static struct da7218_pdata *da7218_of_to_pdata(struct snd_soc_codec *codec) | |||
| 2520 | } | 2520 | } |
| 2521 | 2521 | ||
| 2522 | if (da7218->dev_id == DA7218_DEV_ID) { | 2522 | if (da7218->dev_id == DA7218_DEV_ID) { |
| 2523 | hpldet_np = of_find_node_by_name(np, "da7218_hpldet"); | 2523 | hpldet_np = of_get_child_by_name(np, "da7218_hpldet"); |
| 2524 | if (!hpldet_np) | 2524 | if (!hpldet_np) |
| 2525 | return pdata; | 2525 | return pdata; |
| 2526 | 2526 | ||
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 65c059b5ffd7..66e32f5d2917 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
| @@ -1733,7 +1733,7 @@ static int wm_adsp_load(struct wm_adsp *dsp) | |||
| 1733 | le64_to_cpu(footer->timestamp)); | 1733 | le64_to_cpu(footer->timestamp)); |
| 1734 | 1734 | ||
| 1735 | while (pos < firmware->size && | 1735 | while (pos < firmware->size && |
| 1736 | pos - firmware->size > sizeof(*region)) { | 1736 | sizeof(*region) < firmware->size - pos) { |
| 1737 | region = (void *)&(firmware->data[pos]); | 1737 | region = (void *)&(firmware->data[pos]); |
| 1738 | region_name = "Unknown"; | 1738 | region_name = "Unknown"; |
| 1739 | reg = 0; | 1739 | reg = 0; |
| @@ -1782,8 +1782,8 @@ static int wm_adsp_load(struct wm_adsp *dsp) | |||
| 1782 | regions, le32_to_cpu(region->len), offset, | 1782 | regions, le32_to_cpu(region->len), offset, |
| 1783 | region_name); | 1783 | region_name); |
| 1784 | 1784 | ||
| 1785 | if ((pos + le32_to_cpu(region->len) + sizeof(*region)) > | 1785 | if (le32_to_cpu(region->len) > |
| 1786 | firmware->size) { | 1786 | firmware->size - pos - sizeof(*region)) { |
| 1787 | adsp_err(dsp, | 1787 | adsp_err(dsp, |
| 1788 | "%s.%d: %s region len %d bytes exceeds file length %zu\n", | 1788 | "%s.%d: %s region len %d bytes exceeds file length %zu\n", |
| 1789 | file, regions, region_name, | 1789 | file, regions, region_name, |
| @@ -2253,7 +2253,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
| 2253 | 2253 | ||
| 2254 | blocks = 0; | 2254 | blocks = 0; |
| 2255 | while (pos < firmware->size && | 2255 | while (pos < firmware->size && |
| 2256 | pos - firmware->size > sizeof(*blk)) { | 2256 | sizeof(*blk) < firmware->size - pos) { |
| 2257 | blk = (void *)(&firmware->data[pos]); | 2257 | blk = (void *)(&firmware->data[pos]); |
| 2258 | 2258 | ||
| 2259 | type = le16_to_cpu(blk->type); | 2259 | type = le16_to_cpu(blk->type); |
| @@ -2327,8 +2327,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
| 2327 | } | 2327 | } |
| 2328 | 2328 | ||
| 2329 | if (reg) { | 2329 | if (reg) { |
| 2330 | if ((pos + le32_to_cpu(blk->len) + sizeof(*blk)) > | 2330 | if (le32_to_cpu(blk->len) > |
| 2331 | firmware->size) { | 2331 | firmware->size - pos - sizeof(*blk)) { |
| 2332 | adsp_err(dsp, | 2332 | adsp_err(dsp, |
| 2333 | "%s.%d: %s region len %d bytes exceeds file length %zu\n", | 2333 | "%s.%d: %s region len %d bytes exceeds file length %zu\n", |
| 2334 | file, blocks, region_name, | 2334 | file, blocks, region_name, |
diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h index 0f163abe4ba3..52c27a358933 100644 --- a/sound/soc/fsl/fsl_asrc.h +++ b/sound/soc/fsl/fsl_asrc.h | |||
| @@ -260,8 +260,8 @@ | |||
| 260 | #define ASRFSTi_OUTPUT_FIFO_SHIFT 12 | 260 | #define ASRFSTi_OUTPUT_FIFO_SHIFT 12 |
| 261 | #define ASRFSTi_OUTPUT_FIFO_MASK (((1 << ASRFSTi_OUTPUT_FIFO_WIDTH) - 1) << ASRFSTi_OUTPUT_FIFO_SHIFT) | 261 | #define ASRFSTi_OUTPUT_FIFO_MASK (((1 << ASRFSTi_OUTPUT_FIFO_WIDTH) - 1) << ASRFSTi_OUTPUT_FIFO_SHIFT) |
| 262 | #define ASRFSTi_IAEi_SHIFT 11 | 262 | #define ASRFSTi_IAEi_SHIFT 11 |
| 263 | #define ASRFSTi_IAEi_MASK (1 << ASRFSTi_OAFi_SHIFT) | 263 | #define ASRFSTi_IAEi_MASK (1 << ASRFSTi_IAEi_SHIFT) |
| 264 | #define ASRFSTi_IAEi (1 << ASRFSTi_OAFi_SHIFT) | 264 | #define ASRFSTi_IAEi (1 << ASRFSTi_IAEi_SHIFT) |
| 265 | #define ASRFSTi_INPUT_FIFO_WIDTH 7 | 265 | #define ASRFSTi_INPUT_FIFO_WIDTH 7 |
| 266 | #define ASRFSTi_INPUT_FIFO_SHIFT 0 | 266 | #define ASRFSTi_INPUT_FIFO_SHIFT 0 |
| 267 | #define ASRFSTi_INPUT_FIFO_MASK ((1 << ASRFSTi_INPUT_FIFO_WIDTH) - 1) | 267 | #define ASRFSTi_INPUT_FIFO_MASK ((1 << ASRFSTi_INPUT_FIFO_WIDTH) - 1) |
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index f2f51e06e22c..424bafaf51ef 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/ctype.h> | 38 | #include <linux/ctype.h> |
| 39 | #include <linux/device.h> | 39 | #include <linux/device.h> |
| 40 | #include <linux/delay.h> | 40 | #include <linux/delay.h> |
| 41 | #include <linux/mutex.h> | ||
| 41 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
| 42 | #include <linux/spinlock.h> | 43 | #include <linux/spinlock.h> |
| 43 | #include <linux/of.h> | 44 | #include <linux/of.h> |
| @@ -265,6 +266,8 @@ struct fsl_ssi_private { | |||
| 265 | 266 | ||
| 266 | u32 fifo_watermark; | 267 | u32 fifo_watermark; |
| 267 | u32 dma_maxburst; | 268 | u32 dma_maxburst; |
| 269 | |||
| 270 | struct mutex ac97_reg_lock; | ||
| 268 | }; | 271 | }; |
| 269 | 272 | ||
| 270 | /* | 273 | /* |
| @@ -1260,11 +1263,13 @@ static void fsl_ssi_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
| 1260 | if (reg > 0x7f) | 1263 | if (reg > 0x7f) |
| 1261 | return; | 1264 | return; |
| 1262 | 1265 | ||
| 1266 | mutex_lock(&fsl_ac97_data->ac97_reg_lock); | ||
| 1267 | |||
| 1263 | ret = clk_prepare_enable(fsl_ac97_data->clk); | 1268 | ret = clk_prepare_enable(fsl_ac97_data->clk); |
| 1264 | if (ret) { | 1269 | if (ret) { |
| 1265 | pr_err("ac97 write clk_prepare_enable failed: %d\n", | 1270 | pr_err("ac97 write clk_prepare_enable failed: %d\n", |
| 1266 | ret); | 1271 | ret); |
| 1267 | return; | 1272 | goto ret_unlock; |
| 1268 | } | 1273 | } |
| 1269 | 1274 | ||
| 1270 | lreg = reg << 12; | 1275 | lreg = reg << 12; |
| @@ -1278,6 +1283,9 @@ static void fsl_ssi_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
| 1278 | udelay(100); | 1283 | udelay(100); |
| 1279 | 1284 | ||
| 1280 | clk_disable_unprepare(fsl_ac97_data->clk); | 1285 | clk_disable_unprepare(fsl_ac97_data->clk); |
| 1286 | |||
| 1287 | ret_unlock: | ||
| 1288 | mutex_unlock(&fsl_ac97_data->ac97_reg_lock); | ||
| 1281 | } | 1289 | } |
| 1282 | 1290 | ||
| 1283 | static unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97, | 1291 | static unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97, |
| @@ -1285,16 +1293,18 @@ static unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97, | |||
| 1285 | { | 1293 | { |
| 1286 | struct regmap *regs = fsl_ac97_data->regs; | 1294 | struct regmap *regs = fsl_ac97_data->regs; |
| 1287 | 1295 | ||
| 1288 | unsigned short val = -1; | 1296 | unsigned short val = 0; |
| 1289 | u32 reg_val; | 1297 | u32 reg_val; |
| 1290 | unsigned int lreg; | 1298 | unsigned int lreg; |
| 1291 | int ret; | 1299 | int ret; |
| 1292 | 1300 | ||
| 1301 | mutex_lock(&fsl_ac97_data->ac97_reg_lock); | ||
| 1302 | |||
| 1293 | ret = clk_prepare_enable(fsl_ac97_data->clk); | 1303 | ret = clk_prepare_enable(fsl_ac97_data->clk); |
| 1294 | if (ret) { | 1304 | if (ret) { |
| 1295 | pr_err("ac97 read clk_prepare_enable failed: %d\n", | 1305 | pr_err("ac97 read clk_prepare_enable failed: %d\n", |
| 1296 | ret); | 1306 | ret); |
| 1297 | return -1; | 1307 | goto ret_unlock; |
| 1298 | } | 1308 | } |
| 1299 | 1309 | ||
| 1300 | lreg = (reg & 0x7f) << 12; | 1310 | lreg = (reg & 0x7f) << 12; |
| @@ -1309,6 +1319,8 @@ static unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97, | |||
| 1309 | 1319 | ||
| 1310 | clk_disable_unprepare(fsl_ac97_data->clk); | 1320 | clk_disable_unprepare(fsl_ac97_data->clk); |
| 1311 | 1321 | ||
| 1322 | ret_unlock: | ||
| 1323 | mutex_unlock(&fsl_ac97_data->ac97_reg_lock); | ||
| 1312 | return val; | 1324 | return val; |
| 1313 | } | 1325 | } |
| 1314 | 1326 | ||
| @@ -1458,12 +1470,6 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
| 1458 | sizeof(fsl_ssi_ac97_dai)); | 1470 | sizeof(fsl_ssi_ac97_dai)); |
| 1459 | 1471 | ||
| 1460 | fsl_ac97_data = ssi_private; | 1472 | fsl_ac97_data = ssi_private; |
| 1461 | |||
| 1462 | ret = snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev); | ||
| 1463 | if (ret) { | ||
| 1464 | dev_err(&pdev->dev, "could not set AC'97 ops\n"); | ||
| 1465 | return ret; | ||
| 1466 | } | ||
| 1467 | } else { | 1473 | } else { |
| 1468 | /* Initialize this copy of the CPU DAI driver structure */ | 1474 | /* Initialize this copy of the CPU DAI driver structure */ |
| 1469 | memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template, | 1475 | memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template, |
| @@ -1574,6 +1580,15 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
| 1574 | return ret; | 1580 | return ret; |
| 1575 | } | 1581 | } |
| 1576 | 1582 | ||
| 1583 | if (fsl_ssi_is_ac97(ssi_private)) { | ||
| 1584 | mutex_init(&ssi_private->ac97_reg_lock); | ||
| 1585 | ret = snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev); | ||
| 1586 | if (ret) { | ||
| 1587 | dev_err(&pdev->dev, "could not set AC'97 ops\n"); | ||
| 1588 | goto error_ac97_ops; | ||
| 1589 | } | ||
| 1590 | } | ||
| 1591 | |||
| 1577 | ret = devm_snd_soc_register_component(&pdev->dev, &fsl_ssi_component, | 1592 | ret = devm_snd_soc_register_component(&pdev->dev, &fsl_ssi_component, |
| 1578 | &ssi_private->cpu_dai_drv, 1); | 1593 | &ssi_private->cpu_dai_drv, 1); |
| 1579 | if (ret) { | 1594 | if (ret) { |
| @@ -1657,6 +1672,13 @@ error_sound_card: | |||
| 1657 | fsl_ssi_debugfs_remove(&ssi_private->dbg_stats); | 1672 | fsl_ssi_debugfs_remove(&ssi_private->dbg_stats); |
| 1658 | 1673 | ||
| 1659 | error_asoc_register: | 1674 | error_asoc_register: |
| 1675 | if (fsl_ssi_is_ac97(ssi_private)) | ||
| 1676 | snd_soc_set_ac97_ops(NULL); | ||
| 1677 | |||
| 1678 | error_ac97_ops: | ||
| 1679 | if (fsl_ssi_is_ac97(ssi_private)) | ||
| 1680 | mutex_destroy(&ssi_private->ac97_reg_lock); | ||
| 1681 | |||
| 1660 | if (ssi_private->soc->imx) | 1682 | if (ssi_private->soc->imx) |
| 1661 | fsl_ssi_imx_clean(pdev, ssi_private); | 1683 | fsl_ssi_imx_clean(pdev, ssi_private); |
| 1662 | 1684 | ||
| @@ -1675,8 +1697,10 @@ static int fsl_ssi_remove(struct platform_device *pdev) | |||
| 1675 | if (ssi_private->soc->imx) | 1697 | if (ssi_private->soc->imx) |
| 1676 | fsl_ssi_imx_clean(pdev, ssi_private); | 1698 | fsl_ssi_imx_clean(pdev, ssi_private); |
| 1677 | 1699 | ||
| 1678 | if (fsl_ssi_is_ac97(ssi_private)) | 1700 | if (fsl_ssi_is_ac97(ssi_private)) { |
| 1679 | snd_soc_set_ac97_ops(NULL); | 1701 | snd_soc_set_ac97_ops(NULL); |
| 1702 | mutex_destroy(&ssi_private->ac97_reg_lock); | ||
| 1703 | } | ||
| 1680 | 1704 | ||
| 1681 | return 0; | 1705 | return 0; |
| 1682 | } | 1706 | } |
