diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-10-25 15:20:36 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-10-25 15:20:36 -0400 |
commit | c64064ce9376a404e0888ca4a2985c8a4c16cec3 (patch) | |
tree | f34d3b84ca970fdb381dad9a195c1367ce5d10f4 /sound | |
parent | 21b3de881b38a84002c07b1b4bfb91892644e83f (diff) | |
parent | 456ba5a7802e58eccb5aa9751b3ab515ef99b9ca (diff) |
Merge tag 'asoc-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.7
A couple of driver fixes, one that improves the interoperability of
WM8994 with controllers that are sensitive to extra BCLK cycles and some
build break fixes for ux500.
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 18 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.h | 1 | ||||
-rw-r--r-- | sound/soc/ux500/mop500.c | 17 | ||||
-rw-r--r-- | sound/soc/ux500/ux500_msp_i2s.c | 8 |
4 files changed, 38 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 2b2dadc54da..3fddc7ad112 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -1045,6 +1045,7 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w, | |||
1045 | struct snd_kcontrol *kcontrol, int event) | 1045 | struct snd_kcontrol *kcontrol, int event) |
1046 | { | 1046 | { |
1047 | struct snd_soc_codec *codec = w->codec; | 1047 | struct snd_soc_codec *codec = w->codec; |
1048 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
1048 | struct wm8994 *control = codec->control_data; | 1049 | struct wm8994 *control = codec->control_data; |
1049 | int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; | 1050 | int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; |
1050 | int i; | 1051 | int i; |
@@ -1063,6 +1064,10 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w, | |||
1063 | 1064 | ||
1064 | switch (event) { | 1065 | switch (event) { |
1065 | case SND_SOC_DAPM_PRE_PMU: | 1066 | case SND_SOC_DAPM_PRE_PMU: |
1067 | /* Don't enable timeslot 2 if not in use */ | ||
1068 | if (wm8994->channels[0] <= 2) | ||
1069 | mask &= ~(WM8994_AIF1DAC2L_ENA | WM8994_AIF1DAC2R_ENA); | ||
1070 | |||
1066 | val = snd_soc_read(codec, WM8994_AIF1_CONTROL_1); | 1071 | val = snd_soc_read(codec, WM8994_AIF1_CONTROL_1); |
1067 | if ((val & WM8994_AIF1ADCL_SRC) && | 1072 | if ((val & WM8994_AIF1ADCL_SRC) && |
1068 | (val & WM8994_AIF1ADCR_SRC)) | 1073 | (val & WM8994_AIF1ADCR_SRC)) |
@@ -2687,7 +2692,7 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, | |||
2687 | return -EINVAL; | 2692 | return -EINVAL; |
2688 | } | 2693 | } |
2689 | 2694 | ||
2690 | bclk_rate = params_rate(params) * 4; | 2695 | bclk_rate = params_rate(params); |
2691 | switch (params_format(params)) { | 2696 | switch (params_format(params)) { |
2692 | case SNDRV_PCM_FORMAT_S16_LE: | 2697 | case SNDRV_PCM_FORMAT_S16_LE: |
2693 | bclk_rate *= 16; | 2698 | bclk_rate *= 16; |
@@ -2708,6 +2713,17 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, | |||
2708 | return -EINVAL; | 2713 | return -EINVAL; |
2709 | } | 2714 | } |
2710 | 2715 | ||
2716 | wm8994->channels[id] = params_channels(params); | ||
2717 | switch (params_channels(params)) { | ||
2718 | case 1: | ||
2719 | case 2: | ||
2720 | bclk_rate *= 2; | ||
2721 | break; | ||
2722 | default: | ||
2723 | bclk_rate *= 4; | ||
2724 | break; | ||
2725 | } | ||
2726 | |||
2711 | /* Try to find an appropriate sample rate; look for an exact match. */ | 2727 | /* Try to find an appropriate sample rate; look for an exact match. */ |
2712 | for (i = 0; i < ARRAY_SIZE(srs); i++) | 2728 | for (i = 0; i < ARRAY_SIZE(srs); i++) |
2713 | if (srs[i].rate == params_rate(params)) | 2729 | if (srs[i].rate == params_rate(params)) |
diff --git a/sound/soc/codecs/wm8994.h b/sound/soc/codecs/wm8994.h index f142ec198db..ccbce5791e9 100644 --- a/sound/soc/codecs/wm8994.h +++ b/sound/soc/codecs/wm8994.h | |||
@@ -77,6 +77,7 @@ struct wm8994_priv { | |||
77 | int sysclk_rate[2]; | 77 | int sysclk_rate[2]; |
78 | int mclk[2]; | 78 | int mclk[2]; |
79 | int aifclk[2]; | 79 | int aifclk[2]; |
80 | int channels[2]; | ||
80 | struct wm8994_fll_config fll[2], fll_suspend[2]; | 81 | struct wm8994_fll_config fll[2], fll_suspend[2]; |
81 | struct completion fll_locked[2]; | 82 | struct completion fll_locked[2]; |
82 | bool fll_locked_irq; | 83 | bool fll_locked_irq; |
diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c index 356611d9654..54f7e25b6f7 100644 --- a/sound/soc/ux500/mop500.c +++ b/sound/soc/ux500/mop500.c | |||
@@ -57,6 +57,20 @@ static struct snd_soc_card mop500_card = { | |||
57 | .num_links = ARRAY_SIZE(mop500_dai_links), | 57 | .num_links = ARRAY_SIZE(mop500_dai_links), |
58 | }; | 58 | }; |
59 | 59 | ||
60 | static void mop500_of_node_put(void) | ||
61 | { | ||
62 | int i; | ||
63 | |||
64 | for (i = 0; i < 2; i++) { | ||
65 | if (mop500_dai_links[i].cpu_of_node) | ||
66 | of_node_put((struct device_node *) | ||
67 | mop500_dai_links[i].cpu_of_node); | ||
68 | if (mop500_dai_links[i].codec_of_node) | ||
69 | of_node_put((struct device_node *) | ||
70 | mop500_dai_links[i].codec_of_node); | ||
71 | } | ||
72 | } | ||
73 | |||
60 | static int __devinit mop500_of_probe(struct platform_device *pdev, | 74 | static int __devinit mop500_of_probe(struct platform_device *pdev, |
61 | struct device_node *np) | 75 | struct device_node *np) |
62 | { | 76 | { |
@@ -69,6 +83,7 @@ static int __devinit mop500_of_probe(struct platform_device *pdev, | |||
69 | 83 | ||
70 | if (!(msp_np[0] && msp_np[1] && codec_np)) { | 84 | if (!(msp_np[0] && msp_np[1] && codec_np)) { |
71 | dev_err(&pdev->dev, "Phandle missing or invalid\n"); | 85 | dev_err(&pdev->dev, "Phandle missing or invalid\n"); |
86 | mop500_of_node_put(); | ||
72 | return -EINVAL; | 87 | return -EINVAL; |
73 | } | 88 | } |
74 | 89 | ||
@@ -83,6 +98,7 @@ static int __devinit mop500_of_probe(struct platform_device *pdev, | |||
83 | 98 | ||
84 | return 0; | 99 | return 0; |
85 | } | 100 | } |
101 | |||
86 | static int __devinit mop500_probe(struct platform_device *pdev) | 102 | static int __devinit mop500_probe(struct platform_device *pdev) |
87 | { | 103 | { |
88 | struct device_node *np = pdev->dev.of_node; | 104 | struct device_node *np = pdev->dev.of_node; |
@@ -128,6 +144,7 @@ static int __devexit mop500_remove(struct platform_device *pdev) | |||
128 | 144 | ||
129 | snd_soc_unregister_card(mop500_card); | 145 | snd_soc_unregister_card(mop500_card); |
130 | mop500_ab8500_remove(mop500_card); | 146 | mop500_ab8500_remove(mop500_card); |
147 | mop500_of_node_put(); | ||
131 | 148 | ||
132 | return 0; | 149 | return 0; |
133 | } | 150 | } |
diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c index b7c996e7757..a26c6bf0a29 100644 --- a/sound/soc/ux500/ux500_msp_i2s.c +++ b/sound/soc/ux500/ux500_msp_i2s.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/pinctrl/consumer.h> | 18 | #include <linux/pinctrl/consumer.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/io.h> | ||
21 | #include <linux/of.h> | 22 | #include <linux/of.h> |
22 | 23 | ||
23 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
@@ -697,14 +698,11 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev, | |||
697 | platform_data = devm_kzalloc(&pdev->dev, | 698 | platform_data = devm_kzalloc(&pdev->dev, |
698 | sizeof(struct msp_i2s_platform_data), GFP_KERNEL); | 699 | sizeof(struct msp_i2s_platform_data), GFP_KERNEL); |
699 | if (!platform_data) | 700 | if (!platform_data) |
700 | ret = -ENOMEM; | 701 | return -ENOMEM; |
701 | } | 702 | } |
702 | } else | 703 | } else |
703 | if (!platform_data) | 704 | if (!platform_data) |
704 | ret = -EINVAL; | 705 | return -EINVAL; |
705 | |||
706 | if (ret) | ||
707 | goto err_res; | ||
708 | 706 | ||
709 | dev_dbg(&pdev->dev, "%s: Enter (name: %s, id: %d).\n", __func__, | 707 | dev_dbg(&pdev->dev, "%s: Enter (name: %s, id: %d).\n", __func__, |
710 | pdev->name, platform_data->id); | 708 | pdev->name, platform_data->id); |