diff options
Diffstat (limited to 'sound/soc')
-rw-r--r--[-rwxr-xr-x] | sound/soc/codecs/max98090.c | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | sound/soc/codecs/max98090.h | 0 | ||||
-rw-r--r-- | sound/soc/codecs/si476x.c | 1 | ||||
-rw-r--r-- | sound/soc/codecs/wm5102.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm8903.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 5 | ||||
-rw-r--r-- | sound/soc/fsl/imx-ssi.c | 5 | ||||
-rw-r--r-- | sound/soc/fsl/pcm030-audio-fabric.c | 2 | ||||
-rw-r--r-- | sound/soc/samsung/i2s.c | 17 | ||||
-rw-r--r-- | sound/soc/sh/dma-sh7760.c | 4 | ||||
-rw-r--r-- | sound/soc/soc-compress.c | 14 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 10 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 14 | ||||
-rw-r--r-- | sound/soc/spear/spear_pcm.c | 12 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_pcm.c | 24 |
15 files changed, 64 insertions, 48 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index fc176044994d..fc176044994d 100755..100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
diff --git a/sound/soc/codecs/max98090.h b/sound/soc/codecs/max98090.h index 7e103f249053..7e103f249053 100755..100644 --- a/sound/soc/codecs/max98090.h +++ b/sound/soc/codecs/max98090.h | |||
diff --git a/sound/soc/codecs/si476x.c b/sound/soc/codecs/si476x.c index f2d61a187830..566ea3256e2d 100644 --- a/sound/soc/codecs/si476x.c +++ b/sound/soc/codecs/si476x.c | |||
@@ -159,6 +159,7 @@ static int si476x_codec_hw_params(struct snd_pcm_substream *substream, | |||
159 | switch (params_format(params)) { | 159 | switch (params_format(params)) { |
160 | case SNDRV_PCM_FORMAT_S8: | 160 | case SNDRV_PCM_FORMAT_S8: |
161 | width = SI476X_PCM_FORMAT_S8; | 161 | width = SI476X_PCM_FORMAT_S8; |
162 | break; | ||
162 | case SNDRV_PCM_FORMAT_S16_LE: | 163 | case SNDRV_PCM_FORMAT_S16_LE: |
163 | width = SI476X_PCM_FORMAT_S16_LE; | 164 | width = SI476X_PCM_FORMAT_S16_LE; |
164 | break; | 165 | break; |
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index b82bbf584146..34d0201d6a78 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c | |||
@@ -584,7 +584,7 @@ static int wm5102_sysclk_ev(struct snd_soc_dapm_widget *w, | |||
584 | struct snd_kcontrol *kcontrol, int event) | 584 | struct snd_kcontrol *kcontrol, int event) |
585 | { | 585 | { |
586 | struct snd_soc_codec *codec = w->codec; | 586 | struct snd_soc_codec *codec = w->codec; |
587 | struct arizona *arizona = dev_get_drvdata(codec->dev); | 587 | struct arizona *arizona = dev_get_drvdata(codec->dev->parent); |
588 | struct regmap *regmap = codec->control_data; | 588 | struct regmap *regmap = codec->control_data; |
589 | const struct reg_default *patch = NULL; | 589 | const struct reg_default *patch = NULL; |
590 | int i, patch_size; | 590 | int i, patch_size; |
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 134e41c870b9..f8a31ad0b203 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -1083,6 +1083,8 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = { | |||
1083 | { "ROP", NULL, "Right Speaker PGA" }, | 1083 | { "ROP", NULL, "Right Speaker PGA" }, |
1084 | { "RON", NULL, "Right Speaker PGA" }, | 1084 | { "RON", NULL, "Right Speaker PGA" }, |
1085 | 1085 | ||
1086 | { "Charge Pump", NULL, "CLK_DSP" }, | ||
1087 | |||
1086 | { "Left Headphone Output PGA", NULL, "Charge Pump" }, | 1088 | { "Left Headphone Output PGA", NULL, "Charge Pump" }, |
1087 | { "Right Headphone Output PGA", NULL, "Charge Pump" }, | 1089 | { "Right Headphone Output PGA", NULL, "Charge Pump" }, |
1088 | { "Left Line Output PGA", NULL, "Charge Pump" }, | 1090 | { "Left Line Output PGA", NULL, "Charge Pump" }, |
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index f3f7e75f8628..9af1bddc4c62 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
@@ -828,7 +828,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) | |||
828 | &buf_list); | 828 | &buf_list); |
829 | if (!buf) { | 829 | if (!buf) { |
830 | adsp_err(dsp, "Out of memory\n"); | 830 | adsp_err(dsp, "Out of memory\n"); |
831 | return -ENOMEM; | 831 | ret = -ENOMEM; |
832 | goto out_fw; | ||
832 | } | 833 | } |
833 | 834 | ||
834 | adsp_dbg(dsp, "%s.%d: Writing %d bytes at %x\n", | 835 | adsp_dbg(dsp, "%s.%d: Writing %d bytes at %x\n", |
@@ -865,7 +866,7 @@ out_fw: | |||
865 | wm_adsp_buf_free(&buf_list); | 866 | wm_adsp_buf_free(&buf_list); |
866 | out: | 867 | out: |
867 | kfree(file); | 868 | kfree(file); |
868 | return 0; | 869 | return ret; |
869 | } | 870 | } |
870 | 871 | ||
871 | int wm_adsp1_init(struct wm_adsp *adsp) | 872 | int wm_adsp1_init(struct wm_adsp *adsp) |
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index 55464a5b0706..810c7eeb7b03 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c | |||
@@ -496,6 +496,8 @@ static void imx_ssi_ac97_reset(struct snd_ac97 *ac97) | |||
496 | 496 | ||
497 | if (imx_ssi->ac97_reset) | 497 | if (imx_ssi->ac97_reset) |
498 | imx_ssi->ac97_reset(ac97); | 498 | imx_ssi->ac97_reset(ac97); |
499 | /* First read sometimes fails, do a dummy read */ | ||
500 | imx_ssi_ac97_read(ac97, 0); | ||
499 | } | 501 | } |
500 | 502 | ||
501 | static void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97) | 503 | static void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97) |
@@ -504,6 +506,9 @@ static void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97) | |||
504 | 506 | ||
505 | if (imx_ssi->ac97_warm_reset) | 507 | if (imx_ssi->ac97_warm_reset) |
506 | imx_ssi->ac97_warm_reset(ac97); | 508 | imx_ssi->ac97_warm_reset(ac97); |
509 | |||
510 | /* First read sometimes fails, do a dummy read */ | ||
511 | imx_ssi_ac97_read(ac97, 0); | ||
507 | } | 512 | } |
508 | 513 | ||
509 | struct snd_ac97_bus_ops soc_ac97_ops = { | 514 | struct snd_ac97_bus_ops soc_ac97_ops = { |
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index 8e52c1485df3..eb4373840bb6 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c | |||
@@ -51,7 +51,7 @@ static struct snd_soc_card pcm030_card = { | |||
51 | .num_links = ARRAY_SIZE(pcm030_fabric_dai), | 51 | .num_links = ARRAY_SIZE(pcm030_fabric_dai), |
52 | }; | 52 | }; |
53 | 53 | ||
54 | static int __init pcm030_fabric_probe(struct platform_device *op) | 54 | static int pcm030_fabric_probe(struct platform_device *op) |
55 | { | 55 | { |
56 | struct device_node *np = op->dev.of_node; | 56 | struct device_node *np = op->dev.of_node; |
57 | struct device_node *platform_np; | 57 | struct device_node *platform_np; |
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index d7231e336a7c..6bbeb0bf1a73 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -972,6 +972,7 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = { | |||
972 | static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) | 972 | static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) |
973 | { | 973 | { |
974 | struct i2s_dai *i2s; | 974 | struct i2s_dai *i2s; |
975 | int ret; | ||
975 | 976 | ||
976 | i2s = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dai), GFP_KERNEL); | 977 | i2s = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dai), GFP_KERNEL); |
977 | if (i2s == NULL) | 978 | if (i2s == NULL) |
@@ -996,15 +997,17 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) | |||
996 | i2s->i2s_dai_drv.capture.channels_max = 2; | 997 | i2s->i2s_dai_drv.capture.channels_max = 2; |
997 | i2s->i2s_dai_drv.capture.rates = SAMSUNG_I2S_RATES; | 998 | i2s->i2s_dai_drv.capture.rates = SAMSUNG_I2S_RATES; |
998 | i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS; | 999 | i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS; |
1000 | dev_set_drvdata(&i2s->pdev->dev, i2s); | ||
999 | } else { /* Create a new platform_device for Secondary */ | 1001 | } else { /* Create a new platform_device for Secondary */ |
1000 | i2s->pdev = platform_device_register_resndata(NULL, | 1002 | i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1); |
1001 | "samsung-i2s-sec", -1, NULL, 0, NULL, 0); | ||
1002 | if (IS_ERR(i2s->pdev)) | 1003 | if (IS_ERR(i2s->pdev)) |
1003 | return NULL; | 1004 | return NULL; |
1004 | } | ||
1005 | 1005 | ||
1006 | /* Pre-assign snd_soc_dai_set_drvdata */ | 1006 | platform_set_drvdata(i2s->pdev, i2s); |
1007 | dev_set_drvdata(&i2s->pdev->dev, i2s); | 1007 | ret = platform_device_add(i2s->pdev); |
1008 | if (ret < 0) | ||
1009 | return NULL; | ||
1010 | } | ||
1008 | 1011 | ||
1009 | return i2s; | 1012 | return i2s; |
1010 | } | 1013 | } |
@@ -1107,6 +1110,10 @@ static int samsung_i2s_probe(struct platform_device *pdev) | |||
1107 | 1110 | ||
1108 | if (samsung_dai_type == TYPE_SEC) { | 1111 | if (samsung_dai_type == TYPE_SEC) { |
1109 | sec_dai = dev_get_drvdata(&pdev->dev); | 1112 | sec_dai = dev_get_drvdata(&pdev->dev); |
1113 | if (!sec_dai) { | ||
1114 | dev_err(&pdev->dev, "Unable to get drvdata\n"); | ||
1115 | return -EFAULT; | ||
1116 | } | ||
1110 | snd_soc_register_dai(&sec_dai->pdev->dev, | 1117 | snd_soc_register_dai(&sec_dai->pdev->dev, |
1111 | &sec_dai->i2s_dai_drv); | 1118 | &sec_dai->i2s_dai_drv); |
1112 | asoc_dma_platform_register(&pdev->dev); | 1119 | asoc_dma_platform_register(&pdev->dev); |
diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index 19eff8fc4fdd..1a8b03e4b41b 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c | |||
@@ -342,8 +342,8 @@ static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
342 | return 0; | 342 | return 0; |
343 | } | 343 | } |
344 | 344 | ||
345 | static struct snd_soc_platform sh7760_soc_platform = { | 345 | static struct snd_soc_platform_driver sh7760_soc_platform = { |
346 | .pcm_ops = &camelot_pcm_ops, | 346 | .ops = &camelot_pcm_ops, |
347 | .pcm_new = camelot_pcm_new, | 347 | .pcm_new = camelot_pcm_new, |
348 | .pcm_free = camelot_pcm_free, | 348 | .pcm_free = camelot_pcm_free, |
349 | }; | 349 | }; |
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index b5b3db71e253..ed0bfb0ddb96 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c | |||
@@ -211,19 +211,27 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream, | |||
211 | if (platform->driver->compr_ops && platform->driver->compr_ops->set_params) { | 211 | if (platform->driver->compr_ops && platform->driver->compr_ops->set_params) { |
212 | ret = platform->driver->compr_ops->set_params(cstream, params); | 212 | ret = platform->driver->compr_ops->set_params(cstream, params); |
213 | if (ret < 0) | 213 | if (ret < 0) |
214 | goto out; | 214 | goto err; |
215 | } | 215 | } |
216 | 216 | ||
217 | if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->set_params) { | 217 | if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->set_params) { |
218 | ret = rtd->dai_link->compr_ops->set_params(cstream); | 218 | ret = rtd->dai_link->compr_ops->set_params(cstream); |
219 | if (ret < 0) | 219 | if (ret < 0) |
220 | goto out; | 220 | goto err; |
221 | } | 221 | } |
222 | 222 | ||
223 | snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK, | 223 | snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK, |
224 | SND_SOC_DAPM_STREAM_START); | 224 | SND_SOC_DAPM_STREAM_START); |
225 | 225 | ||
226 | out: | 226 | /* cancel any delayed stream shutdown that is pending */ |
227 | rtd->pop_wait = 0; | ||
228 | mutex_unlock(&rtd->pcm_mutex); | ||
229 | |||
230 | cancel_delayed_work_sync(&rtd->delayed_work); | ||
231 | |||
232 | return ret; | ||
233 | |||
234 | err: | ||
227 | mutex_unlock(&rtd->pcm_mutex); | 235 | mutex_unlock(&rtd->pcm_mutex); |
228 | return ret; | 236 | return ret; |
229 | } | 237 | } |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b7e84a7cd9ee..ff4b45a5d796 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -2963,7 +2963,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, | |||
2963 | val = val << shift; | 2963 | val = val << shift; |
2964 | 2964 | ||
2965 | ret = snd_soc_update_bits_locked(codec, reg, val_mask, val); | 2965 | ret = snd_soc_update_bits_locked(codec, reg, val_mask, val); |
2966 | if (ret != 0) | 2966 | if (ret < 0) |
2967 | return ret; | 2967 | return ret; |
2968 | 2968 | ||
2969 | if (snd_soc_volsw_is_stereo(mc)) { | 2969 | if (snd_soc_volsw_is_stereo(mc)) { |
@@ -3140,7 +3140,7 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, | |||
3140 | if (params->mask) { | 3140 | if (params->mask) { |
3141 | ret = regmap_read(codec->control_data, params->base, &val); | 3141 | ret = regmap_read(codec->control_data, params->base, &val); |
3142 | if (ret != 0) | 3142 | if (ret != 0) |
3143 | return ret; | 3143 | goto out; |
3144 | 3144 | ||
3145 | val &= params->mask; | 3145 | val &= params->mask; |
3146 | 3146 | ||
@@ -3158,13 +3158,15 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, | |||
3158 | ((u32 *)data)[0] |= cpu_to_be32(val); | 3158 | ((u32 *)data)[0] |= cpu_to_be32(val); |
3159 | break; | 3159 | break; |
3160 | default: | 3160 | default: |
3161 | return -EINVAL; | 3161 | ret = -EINVAL; |
3162 | goto out; | ||
3162 | } | 3163 | } |
3163 | } | 3164 | } |
3164 | 3165 | ||
3165 | ret = regmap_raw_write(codec->control_data, params->base, | 3166 | ret = regmap_raw_write(codec->control_data, params->base, |
3166 | data, len); | 3167 | data, len); |
3167 | 3168 | ||
3169 | out: | ||
3168 | kfree(data); | 3170 | kfree(data); |
3169 | 3171 | ||
3170 | return ret; | 3172 | return ret; |
@@ -4197,7 +4199,6 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, | |||
4197 | dev_err(card->dev, | 4199 | dev_err(card->dev, |
4198 | "ASoC: Property '%s' index %d could not be read: %d\n", | 4200 | "ASoC: Property '%s' index %d could not be read: %d\n", |
4199 | propname, 2 * i, ret); | 4201 | propname, 2 * i, ret); |
4200 | kfree(routes); | ||
4201 | return -EINVAL; | 4202 | return -EINVAL; |
4202 | } | 4203 | } |
4203 | ret = of_property_read_string_index(np, propname, | 4204 | ret = of_property_read_string_index(np, propname, |
@@ -4206,7 +4207,6 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, | |||
4206 | dev_err(card->dev, | 4207 | dev_err(card->dev, |
4207 | "ASoC: Property '%s' index %d could not be read: %d\n", | 4208 | "ASoC: Property '%s' index %d could not be read: %d\n", |
4208 | propname, (2 * i) + 1, ret); | 4209 | propname, (2 * i) + 1, ret); |
4209 | kfree(routes); | ||
4210 | return -EINVAL; | 4210 | return -EINVAL; |
4211 | } | 4211 | } |
4212 | } | 4212 | } |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 1d6a9b3ceb27..d6d9ba2e6916 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -831,6 +831,9 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget, | |||
831 | if (path->weak) | 831 | if (path->weak) |
832 | continue; | 832 | continue; |
833 | 833 | ||
834 | if (path->walking) | ||
835 | return 1; | ||
836 | |||
834 | if (path->walked) | 837 | if (path->walked) |
835 | continue; | 838 | continue; |
836 | 839 | ||
@@ -838,6 +841,7 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget, | |||
838 | 841 | ||
839 | if (path->sink && path->connect) { | 842 | if (path->sink && path->connect) { |
840 | path->walked = 1; | 843 | path->walked = 1; |
844 | path->walking = 1; | ||
841 | 845 | ||
842 | /* do we need to add this widget to the list ? */ | 846 | /* do we need to add this widget to the list ? */ |
843 | if (list) { | 847 | if (list) { |
@@ -847,11 +851,14 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget, | |||
847 | dev_err(widget->dapm->dev, | 851 | dev_err(widget->dapm->dev, |
848 | "ASoC: could not add widget %s\n", | 852 | "ASoC: could not add widget %s\n", |
849 | widget->name); | 853 | widget->name); |
854 | path->walking = 0; | ||
850 | return con; | 855 | return con; |
851 | } | 856 | } |
852 | } | 857 | } |
853 | 858 | ||
854 | con += is_connected_output_ep(path->sink, list); | 859 | con += is_connected_output_ep(path->sink, list); |
860 | |||
861 | path->walking = 0; | ||
855 | } | 862 | } |
856 | } | 863 | } |
857 | 864 | ||
@@ -931,6 +938,9 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, | |||
931 | if (path->weak) | 938 | if (path->weak) |
932 | continue; | 939 | continue; |
933 | 940 | ||
941 | if (path->walking) | ||
942 | return 1; | ||
943 | |||
934 | if (path->walked) | 944 | if (path->walked) |
935 | continue; | 945 | continue; |
936 | 946 | ||
@@ -938,6 +948,7 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, | |||
938 | 948 | ||
939 | if (path->source && path->connect) { | 949 | if (path->source && path->connect) { |
940 | path->walked = 1; | 950 | path->walked = 1; |
951 | path->walking = 1; | ||
941 | 952 | ||
942 | /* do we need to add this widget to the list ? */ | 953 | /* do we need to add this widget to the list ? */ |
943 | if (list) { | 954 | if (list) { |
@@ -947,11 +958,14 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, | |||
947 | dev_err(widget->dapm->dev, | 958 | dev_err(widget->dapm->dev, |
948 | "ASoC: could not add widget %s\n", | 959 | "ASoC: could not add widget %s\n", |
949 | widget->name); | 960 | widget->name); |
961 | path->walking = 0; | ||
950 | return con; | 962 | return con; |
951 | } | 963 | } |
952 | } | 964 | } |
953 | 965 | ||
954 | con += is_connected_input_ep(path->source, list); | 966 | con += is_connected_input_ep(path->source, list); |
967 | |||
968 | path->walking = 0; | ||
955 | } | 969 | } |
956 | } | 970 | } |
957 | 971 | ||
diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c index 9b76cc5a1148..5e7aebe1e664 100644 --- a/sound/soc/spear/spear_pcm.c +++ b/sound/soc/spear/spear_pcm.c | |||
@@ -149,9 +149,9 @@ static void spear_pcm_free(struct snd_pcm *pcm) | |||
149 | 149 | ||
150 | static u64 spear_pcm_dmamask = DMA_BIT_MASK(32); | 150 | static u64 spear_pcm_dmamask = DMA_BIT_MASK(32); |
151 | 151 | ||
152 | static int spear_pcm_new(struct snd_card *card, | 152 | static int spear_pcm_new(struct snd_soc_pcm_runtime *rtd) |
153 | struct snd_soc_dai *dai, struct snd_pcm *pcm) | ||
154 | { | 153 | { |
154 | struct snd_card *card = rtd->card->snd_card; | ||
155 | int ret; | 155 | int ret; |
156 | 156 | ||
157 | if (!card->dev->dma_mask) | 157 | if (!card->dev->dma_mask) |
@@ -159,16 +159,16 @@ static int spear_pcm_new(struct snd_card *card, | |||
159 | if (!card->dev->coherent_dma_mask) | 159 | if (!card->dev->coherent_dma_mask) |
160 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 160 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
161 | 161 | ||
162 | if (dai->driver->playback.channels_min) { | 162 | if (rtd->cpu_dai->driver->playback.channels_min) { |
163 | ret = spear_pcm_preallocate_dma_buffer(pcm, | 163 | ret = spear_pcm_preallocate_dma_buffer(rtd->pcm, |
164 | SNDRV_PCM_STREAM_PLAYBACK, | 164 | SNDRV_PCM_STREAM_PLAYBACK, |
165 | spear_pcm_hardware.buffer_bytes_max); | 165 | spear_pcm_hardware.buffer_bytes_max); |
166 | if (ret) | 166 | if (ret) |
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |
169 | 169 | ||
170 | if (dai->driver->capture.channels_min) { | 170 | if (rtd->cpu_dai->driver->capture.channels_min) { |
171 | ret = spear_pcm_preallocate_dma_buffer(pcm, | 171 | ret = spear_pcm_preallocate_dma_buffer(rtd->pcm, |
172 | SNDRV_PCM_STREAM_CAPTURE, | 172 | SNDRV_PCM_STREAM_CAPTURE, |
173 | spear_pcm_hardware.buffer_bytes_max); | 173 | spear_pcm_hardware.buffer_bytes_max); |
174 | if (ret) | 174 | if (ret) |
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index c925ab0adeb6..5e2c55c5b255 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c | |||
@@ -43,8 +43,6 @@ | |||
43 | static const struct snd_pcm_hardware tegra_pcm_hardware = { | 43 | static const struct snd_pcm_hardware tegra_pcm_hardware = { |
44 | .info = SNDRV_PCM_INFO_MMAP | | 44 | .info = SNDRV_PCM_INFO_MMAP | |
45 | SNDRV_PCM_INFO_MMAP_VALID | | 45 | SNDRV_PCM_INFO_MMAP_VALID | |
46 | SNDRV_PCM_INFO_PAUSE | | ||
47 | SNDRV_PCM_INFO_RESUME | | ||
48 | SNDRV_PCM_INFO_INTERLEAVED, | 46 | SNDRV_PCM_INFO_INTERLEAVED, |
49 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 47 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
50 | .channels_min = 2, | 48 | .channels_min = 2, |
@@ -127,26 +125,6 @@ static int tegra_pcm_hw_free(struct snd_pcm_substream *substream) | |||
127 | return 0; | 125 | return 0; |
128 | } | 126 | } |
129 | 127 | ||
130 | static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | ||
131 | { | ||
132 | switch (cmd) { | ||
133 | case SNDRV_PCM_TRIGGER_START: | ||
134 | case SNDRV_PCM_TRIGGER_RESUME: | ||
135 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | ||
136 | return snd_dmaengine_pcm_trigger(substream, | ||
137 | SNDRV_PCM_TRIGGER_START); | ||
138 | |||
139 | case SNDRV_PCM_TRIGGER_STOP: | ||
140 | case SNDRV_PCM_TRIGGER_SUSPEND: | ||
141 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | ||
142 | return snd_dmaengine_pcm_trigger(substream, | ||
143 | SNDRV_PCM_TRIGGER_STOP); | ||
144 | default: | ||
145 | return -EINVAL; | ||
146 | } | ||
147 | return 0; | ||
148 | } | ||
149 | |||
150 | static int tegra_pcm_mmap(struct snd_pcm_substream *substream, | 128 | static int tegra_pcm_mmap(struct snd_pcm_substream *substream, |
151 | struct vm_area_struct *vma) | 129 | struct vm_area_struct *vma) |
152 | { | 130 | { |
@@ -164,7 +142,7 @@ static struct snd_pcm_ops tegra_pcm_ops = { | |||
164 | .ioctl = snd_pcm_lib_ioctl, | 142 | .ioctl = snd_pcm_lib_ioctl, |
165 | .hw_params = tegra_pcm_hw_params, | 143 | .hw_params = tegra_pcm_hw_params, |
166 | .hw_free = tegra_pcm_hw_free, | 144 | .hw_free = tegra_pcm_hw_free, |
167 | .trigger = tegra_pcm_trigger, | 145 | .trigger = snd_dmaengine_pcm_trigger, |
168 | .pointer = snd_dmaengine_pcm_pointer, | 146 | .pointer = snd_dmaengine_pcm_pointer, |
169 | .mmap = tegra_pcm_mmap, | 147 | .mmap = tegra_pcm_mmap, |
170 | }; | 148 | }; |