diff options
| -rw-r--r-- | sound/soc/fsl/eukrea-tlv320.c | 15 | ||||
| -rw-r--r-- | sound/soc/fsl/fsl_spdif.c | 9 | ||||
| -rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 22 | ||||
| -rw-r--r-- | sound/soc/fsl/imx-audmux.c | 9 | ||||
| -rw-r--r-- | sound/soc/fsl/imx-mc13783.c | 1 | ||||
| -rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 1 | ||||
| -rw-r--r-- | sound/soc/fsl/imx-ssi.c | 3 | ||||
| -rw-r--r-- | sound/soc/fsl/imx-wm8962.c | 4 |
8 files changed, 28 insertions, 36 deletions
diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c index 9a4a0ca2c1de..5983740be123 100644 --- a/sound/soc/fsl/eukrea-tlv320.c +++ b/sound/soc/fsl/eukrea-tlv320.c | |||
| @@ -42,7 +42,8 @@ static int eukrea_tlv320_hw_params(struct snd_pcm_substream *substream, | |||
| 42 | SND_SOC_DAIFMT_NB_NF | | 42 | SND_SOC_DAIFMT_NB_NF | |
| 43 | SND_SOC_DAIFMT_CBM_CFM); | 43 | SND_SOC_DAIFMT_CBM_CFM); |
| 44 | if (ret) { | 44 | if (ret) { |
| 45 | pr_err("%s: failed set cpu dai format\n", __func__); | 45 | dev_err(cpu_dai->dev, |
| 46 | "Failed to set the cpu dai format.\n"); | ||
| 46 | return ret; | 47 | return ret; |
| 47 | } | 48 | } |
| 48 | 49 | ||
| @@ -50,14 +51,16 @@ static int eukrea_tlv320_hw_params(struct snd_pcm_substream *substream, | |||
| 50 | SND_SOC_DAIFMT_NB_NF | | 51 | SND_SOC_DAIFMT_NB_NF | |
| 51 | SND_SOC_DAIFMT_CBM_CFM); | 52 | SND_SOC_DAIFMT_CBM_CFM); |
| 52 | if (ret) { | 53 | if (ret) { |
| 53 | pr_err("%s: failed set codec dai format\n", __func__); | 54 | dev_err(cpu_dai->dev, |
| 55 | "Failed to set the codec format.\n"); | ||
| 54 | return ret; | 56 | return ret; |
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, | 59 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, |
| 58 | CODEC_CLOCK, SND_SOC_CLOCK_OUT); | 60 | CODEC_CLOCK, SND_SOC_CLOCK_OUT); |
| 59 | if (ret) { | 61 | if (ret) { |
| 60 | pr_err("%s: failed setting codec sysclk\n", __func__); | 62 | dev_err(cpu_dai->dev, |
| 63 | "Failed to set the codec sysclk.\n"); | ||
| 61 | return ret; | 64 | return ret; |
| 62 | } | 65 | } |
| 63 | snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffc, 0xffffffc, 2, 0); | 66 | snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffc, 0xffffffc, 2, 0); |
| @@ -65,7 +68,8 @@ static int eukrea_tlv320_hw_params(struct snd_pcm_substream *substream, | |||
| 65 | ret = snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0, | 68 | ret = snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0, |
| 66 | SND_SOC_CLOCK_IN); | 69 | SND_SOC_CLOCK_IN); |
| 67 | if (ret) { | 70 | if (ret) { |
| 68 | pr_err("can't set CPU system clock IMX_SSP_SYS_CLK\n"); | 71 | dev_err(cpu_dai->dev, |
| 72 | "Can't set the IMX_SSP_SYS_CLK CPU system clock.\n"); | ||
| 69 | return ret; | 73 | return ret; |
| 70 | } | 74 | } |
| 71 | 75 | ||
| @@ -155,7 +159,8 @@ static struct platform_driver eukrea_tlv320_driver = { | |||
| 155 | .owner = THIS_MODULE, | 159 | .owner = THIS_MODULE, |
| 156 | }, | 160 | }, |
| 157 | .probe = eukrea_tlv320_probe, | 161 | .probe = eukrea_tlv320_probe, |
| 158 | .remove = eukrea_tlv320_remove,}; | 162 | .remove = eukrea_tlv320_remove, |
| 163 | }; | ||
| 159 | 164 | ||
| 160 | module_platform_driver(eukrea_tlv320_driver); | 165 | module_platform_driver(eukrea_tlv320_driver); |
| 161 | 166 | ||
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 44378e6e2696..55193a5596ca 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c | |||
| @@ -963,7 +963,7 @@ static bool fsl_spdif_readable_reg(struct device *dev, unsigned int reg) | |||
| 963 | return true; | 963 | return true; |
| 964 | default: | 964 | default: |
| 965 | return false; | 965 | return false; |
| 966 | }; | 966 | } |
| 967 | } | 967 | } |
| 968 | 968 | ||
| 969 | static bool fsl_spdif_writeable_reg(struct device *dev, unsigned int reg) | 969 | static bool fsl_spdif_writeable_reg(struct device *dev, unsigned int reg) |
| @@ -982,7 +982,7 @@ static bool fsl_spdif_writeable_reg(struct device *dev, unsigned int reg) | |||
| 982 | return true; | 982 | return true; |
| 983 | default: | 983 | default: |
| 984 | return false; | 984 | return false; |
| 985 | }; | 985 | } |
| 986 | } | 986 | } |
| 987 | 987 | ||
| 988 | static const struct regmap_config fsl_spdif_regmap_config = { | 988 | static const struct regmap_config fsl_spdif_regmap_config = { |
| @@ -1107,11 +1107,6 @@ static int fsl_spdif_probe(struct platform_device *pdev) | |||
| 1107 | 1107 | ||
| 1108 | /* Get the addresses and IRQ */ | 1108 | /* Get the addresses and IRQ */ |
| 1109 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1109 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 1110 | if (IS_ERR(res)) { | ||
| 1111 | dev_err(&pdev->dev, "could not determine device resources\n"); | ||
| 1112 | return PTR_ERR(res); | ||
| 1113 | } | ||
| 1114 | |||
| 1115 | regs = devm_ioremap_resource(&pdev->dev, res); | 1110 | regs = devm_ioremap_resource(&pdev->dev, res); |
| 1116 | if (IS_ERR(regs)) | 1111 | if (IS_ERR(regs)) |
| 1117 | return PTR_ERR(regs); | 1112 | return PTR_ERR(regs); |
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 6b81d0ce2c44..35e277379b86 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
| @@ -469,19 +469,12 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream, | |||
| 469 | * parameters, then the second stream may be | 469 | * parameters, then the second stream may be |
| 470 | * constrained to the wrong sample rate or size. | 470 | * constrained to the wrong sample rate or size. |
| 471 | */ | 471 | */ |
| 472 | if (!first_runtime->sample_bits) { | 472 | if (first_runtime->sample_bits) { |
| 473 | dev_err(substream->pcm->card->dev, | 473 | snd_pcm_hw_constraint_minmax(substream->runtime, |
| 474 | "set sample size in %s stream first\n", | 474 | SNDRV_PCM_HW_PARAM_SAMPLE_BITS, |
| 475 | substream->stream == | ||
| 476 | SNDRV_PCM_STREAM_PLAYBACK | ||
| 477 | ? "capture" : "playback"); | ||
| 478 | return -EAGAIN; | ||
| 479 | } | ||
| 480 | |||
| 481 | snd_pcm_hw_constraint_minmax(substream->runtime, | ||
| 482 | SNDRV_PCM_HW_PARAM_SAMPLE_BITS, | ||
| 483 | first_runtime->sample_bits, | 475 | first_runtime->sample_bits, |
| 484 | first_runtime->sample_bits); | 476 | first_runtime->sample_bits); |
| 477 | } | ||
| 485 | } | 478 | } |
| 486 | 479 | ||
| 487 | ssi_private->second_stream = substream; | 480 | ssi_private->second_stream = substream; |
| @@ -748,7 +741,7 @@ static void fsl_ssi_ac97_init(void) | |||
| 748 | fsl_ssi_setup(fsl_ac97_data); | 741 | fsl_ssi_setup(fsl_ac97_data); |
| 749 | } | 742 | } |
| 750 | 743 | ||
| 751 | void fsl_ssi_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | 744 | static void fsl_ssi_ac97_write(struct snd_ac97 *ac97, unsigned short reg, |
| 752 | unsigned short val) | 745 | unsigned short val) |
| 753 | { | 746 | { |
| 754 | struct ccsr_ssi *ssi = fsl_ac97_data->ssi; | 747 | struct ccsr_ssi *ssi = fsl_ac97_data->ssi; |
| @@ -770,7 +763,7 @@ void fsl_ssi_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
| 770 | udelay(100); | 763 | udelay(100); |
| 771 | } | 764 | } |
| 772 | 765 | ||
| 773 | unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97, | 766 | static unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97, |
| 774 | unsigned short reg) | 767 | unsigned short reg) |
| 775 | { | 768 | { |
| 776 | struct ccsr_ssi *ssi = fsl_ac97_data->ssi; | 769 | struct ccsr_ssi *ssi = fsl_ac97_data->ssi; |
| @@ -936,7 +929,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
| 936 | ssi_private->ssi_phys = res.start; | 929 | ssi_private->ssi_phys = res.start; |
| 937 | 930 | ||
| 938 | ssi_private->irq = irq_of_parse_and_map(np, 0); | 931 | ssi_private->irq = irq_of_parse_and_map(np, 0); |
| 939 | if (ssi_private->irq == 0) { | 932 | if (!ssi_private->irq) { |
| 940 | dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); | 933 | dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); |
| 941 | return -ENXIO; | 934 | return -ENXIO; |
| 942 | } | 935 | } |
| @@ -1135,7 +1128,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) | |||
| 1135 | if (ssi_private->ssi_on_imx) | 1128 | if (ssi_private->ssi_on_imx) |
| 1136 | imx_pcm_dma_exit(pdev); | 1129 | imx_pcm_dma_exit(pdev); |
| 1137 | snd_soc_unregister_component(&pdev->dev); | 1130 | snd_soc_unregister_component(&pdev->dev); |
| 1138 | dev_set_drvdata(&pdev->dev, NULL); | ||
| 1139 | device_remove_file(&pdev->dev, &ssi_private->dev_attr); | 1131 | device_remove_file(&pdev->dev, &ssi_private->dev_attr); |
| 1140 | if (ssi_private->ssi_on_imx) | 1132 | if (ssi_private->ssi_on_imx) |
| 1141 | clk_disable_unprepare(ssi_private->clk); | 1133 | clk_disable_unprepare(ssi_private->clk); |
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c index d3bf71a0ec56..ac869931d7f1 100644 --- a/sound/soc/fsl/imx-audmux.c +++ b/sound/soc/fsl/imx-audmux.c | |||
| @@ -66,13 +66,10 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf, | |||
| 66 | size_t count, loff_t *ppos) | 66 | size_t count, loff_t *ppos) |
| 67 | { | 67 | { |
| 68 | ssize_t ret; | 68 | ssize_t ret; |
| 69 | char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); | 69 | char *buf; |
| 70 | int port = (int)file->private_data; | 70 | int port = (int)file->private_data; |
| 71 | u32 pdcr, ptcr; | 71 | u32 pdcr, ptcr; |
| 72 | 72 | ||
| 73 | if (!buf) | ||
| 74 | return -ENOMEM; | ||
| 75 | |||
| 76 | if (audmux_clk) { | 73 | if (audmux_clk) { |
| 77 | ret = clk_prepare_enable(audmux_clk); | 74 | ret = clk_prepare_enable(audmux_clk); |
| 78 | if (ret) | 75 | if (ret) |
| @@ -85,6 +82,10 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf, | |||
| 85 | if (audmux_clk) | 82 | if (audmux_clk) |
| 86 | clk_disable_unprepare(audmux_clk); | 83 | clk_disable_unprepare(audmux_clk); |
| 87 | 84 | ||
| 85 | buf = kmalloc(PAGE_SIZE, GFP_KERNEL); | ||
| 86 | if (!buf) | ||
| 87 | return -ENOMEM; | ||
| 88 | |||
| 88 | ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n", | 89 | ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n", |
| 89 | pdcr, ptcr); | 90 | pdcr, ptcr); |
| 90 | 91 | ||
diff --git a/sound/soc/fsl/imx-mc13783.c b/sound/soc/fsl/imx-mc13783.c index a2fd7321b5a9..79cee782dbbf 100644 --- a/sound/soc/fsl/imx-mc13783.c +++ b/sound/soc/fsl/imx-mc13783.c | |||
| @@ -160,6 +160,7 @@ static struct platform_driver imx_mc13783_audio_driver = { | |||
| 160 | .driver = { | 160 | .driver = { |
| 161 | .name = "imx_mc13783", | 161 | .name = "imx_mc13783", |
| 162 | .owner = THIS_MODULE, | 162 | .owner = THIS_MODULE, |
| 163 | .pm = &snd_soc_pm_ops, | ||
| 163 | }, | 164 | }, |
| 164 | .probe = imx_mc13783_probe, | 165 | .probe = imx_mc13783_probe, |
| 165 | .remove = imx_mc13783_remove | 166 | .remove = imx_mc13783_remove |
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index ed6ba1eba557..f2beae78969f 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c | |||
| @@ -201,6 +201,7 @@ static struct platform_driver imx_sgtl5000_driver = { | |||
| 201 | .driver = { | 201 | .driver = { |
| 202 | .name = "imx-sgtl5000", | 202 | .name = "imx-sgtl5000", |
| 203 | .owner = THIS_MODULE, | 203 | .owner = THIS_MODULE, |
| 204 | .pm = &snd_soc_pm_ops, | ||
| 204 | .of_match_table = imx_sgtl5000_dt_ids, | 205 | .of_match_table = imx_sgtl5000_dt_ids, |
| 205 | }, | 206 | }, |
| 206 | .probe = imx_sgtl5000_probe, | 207 | .probe = imx_sgtl5000_probe, |
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index 57d6941676ff..f5f248c91c16 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c | |||
| @@ -613,7 +613,6 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
| 613 | failed_pcm: | 613 | failed_pcm: |
| 614 | snd_soc_unregister_component(&pdev->dev); | 614 | snd_soc_unregister_component(&pdev->dev); |
| 615 | failed_register: | 615 | failed_register: |
| 616 | release_mem_region(res->start, resource_size(res)); | ||
| 617 | clk_disable_unprepare(ssi->clk); | 616 | clk_disable_unprepare(ssi->clk); |
| 618 | failed_clk: | 617 | failed_clk: |
| 619 | snd_soc_set_ac97_ops(NULL); | 618 | snd_soc_set_ac97_ops(NULL); |
| @@ -623,7 +622,6 @@ failed_clk: | |||
| 623 | 622 | ||
| 624 | static int imx_ssi_remove(struct platform_device *pdev) | 623 | static int imx_ssi_remove(struct platform_device *pdev) |
| 625 | { | 624 | { |
| 626 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 627 | struct imx_ssi *ssi = platform_get_drvdata(pdev); | 625 | struct imx_ssi *ssi = platform_get_drvdata(pdev); |
| 628 | 626 | ||
| 629 | if (!ssi->dma_init) | 627 | if (!ssi->dma_init) |
| @@ -637,7 +635,6 @@ static int imx_ssi_remove(struct platform_device *pdev) | |||
| 637 | if (ssi->flags & IMX_SSI_USE_AC97) | 635 | if (ssi->flags & IMX_SSI_USE_AC97) |
| 638 | ac97_ssi = NULL; | 636 | ac97_ssi = NULL; |
| 639 | 637 | ||
| 640 | release_mem_region(res->start, resource_size(res)); | ||
| 641 | clk_disable_unprepare(ssi->clk); | 638 | clk_disable_unprepare(ssi->clk); |
| 642 | snd_soc_set_ac97_ops(NULL); | 639 | snd_soc_set_ac97_ops(NULL); |
| 643 | 640 | ||
diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c index 6c6066618f3b..361f94f09b11 100644 --- a/sound/soc/fsl/imx-wm8962.c +++ b/sound/soc/fsl/imx-wm8962.c | |||
| @@ -279,8 +279,7 @@ static int imx_wm8962_probe(struct platform_device *pdev) | |||
| 279 | return 0; | 279 | return 0; |
| 280 | 280 | ||
| 281 | clk_fail: | 281 | clk_fail: |
| 282 | if (!IS_ERR(data->codec_clk)) | 282 | clk_disable_unprepare(data->codec_clk); |
| 283 | clk_disable_unprepare(data->codec_clk); | ||
| 284 | fail: | 283 | fail: |
| 285 | if (ssi_np) | 284 | if (ssi_np) |
| 286 | of_node_put(ssi_np); | 285 | of_node_put(ssi_np); |
| @@ -310,6 +309,7 @@ static struct platform_driver imx_wm8962_driver = { | |||
| 310 | .driver = { | 309 | .driver = { |
| 311 | .name = "imx-wm8962", | 310 | .name = "imx-wm8962", |
| 312 | .owner = THIS_MODULE, | 311 | .owner = THIS_MODULE, |
| 312 | .pm = &snd_soc_pm_ops, | ||
| 313 | .of_match_table = imx_wm8962_dt_ids, | 313 | .of_match_table = imx_wm8962_dt_ids, |
| 314 | }, | 314 | }, |
| 315 | .probe = imx_wm8962_probe, | 315 | .probe = imx_wm8962_probe, |
