aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_analog.c12
-rw-r--r--sound/pci/hda/patch_realtek.c19
-rw-r--r--sound/soc/codecs/wm8962.c2
-rw-r--r--sound/soc/fsl/imx-sgtl5000.c4
-rw-r--r--sound/soc/mxs/mxs-saif.c35
-rw-r--r--sound/soc/samsung/i2s.c66
-rw-r--r--sound/soc/samsung/s3c-i2s-v2.c4
-rw-r--r--sound/usb/quirks.c4
8 files changed, 73 insertions, 73 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 977b0d878dae..d97f0d61a15b 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -2112,6 +2112,9 @@ static void ad_vmaster_eapd_hook(void *private_data, int enabled)
2112{ 2112{
2113 struct hda_codec *codec = private_data; 2113 struct hda_codec *codec = private_data;
2114 struct ad198x_spec *spec = codec->spec; 2114 struct ad198x_spec *spec = codec->spec;
2115
2116 if (!spec->eapd_nid)
2117 return;
2115 snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, 2118 snd_hda_codec_update_cache(codec, spec->eapd_nid, 0,
2116 AC_VERB_SET_EAPD_BTLENABLE, 2119 AC_VERB_SET_EAPD_BTLENABLE,
2117 enabled ? 0x02 : 0x00); 2120 enabled ? 0x02 : 0x00);
@@ -3601,13 +3604,16 @@ static void ad1884_fixup_hp_eapd(struct hda_codec *codec,
3601{ 3604{
3602 struct ad198x_spec *spec = codec->spec; 3605 struct ad198x_spec *spec = codec->spec;
3603 3606
3604 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 3607 switch (action) {
3608 case HDA_FIXUP_ACT_PRE_PROBE:
3609 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook;
3610 break;
3611 case HDA_FIXUP_ACT_PROBE:
3605 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) 3612 if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT)
3606 spec->eapd_nid = spec->gen.autocfg.line_out_pins[0]; 3613 spec->eapd_nid = spec->gen.autocfg.line_out_pins[0];
3607 else 3614 else
3608 spec->eapd_nid = spec->gen.autocfg.speaker_pins[0]; 3615 spec->eapd_nid = spec->gen.autocfg.speaker_pins[0];
3609 if (spec->eapd_nid) 3616 break;
3610 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook;
3611 } 3617 }
3612} 3618}
3613 3619
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 14ac9b0e740c..8bd226149868 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -37,6 +37,9 @@
37#include "hda_jack.h" 37#include "hda_jack.h"
38#include "hda_generic.h" 38#include "hda_generic.h"
39 39
40/* keep halting ALC5505 DSP, for power saving */
41#define HALT_REALTEK_ALC5505
42
40/* unsol event tags */ 43/* unsol event tags */
41#define ALC_DCVOL_EVENT 0x08 44#define ALC_DCVOL_EVENT 0x08
42 45
@@ -2659,15 +2662,27 @@ static void alc5505_dsp_init(struct hda_codec *codec)
2659 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ 2662 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
2660 alc5505_coef_set(codec, 0x880c, 0x00000003); 2663 alc5505_coef_set(codec, 0x880c, 0x00000003);
2661 alc5505_coef_set(codec, 0x880c, 0x00000010); 2664 alc5505_coef_set(codec, 0x880c, 0x00000010);
2665
2666#ifdef HALT_REALTEK_ALC5505
2667 alc5505_dsp_halt(codec);
2668#endif
2662} 2669}
2663 2670
2671#ifdef HALT_REALTEK_ALC5505
2672#define alc5505_dsp_suspend(codec) /* NOP */
2673#define alc5505_dsp_resume(codec) /* NOP */
2674#else
2675#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
2676#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
2677#endif
2678
2664#ifdef CONFIG_PM 2679#ifdef CONFIG_PM
2665static int alc269_suspend(struct hda_codec *codec) 2680static int alc269_suspend(struct hda_codec *codec)
2666{ 2681{
2667 struct alc_spec *spec = codec->spec; 2682 struct alc_spec *spec = codec->spec;
2668 2683
2669 if (spec->has_alc5505_dsp) 2684 if (spec->has_alc5505_dsp)
2670 alc5505_dsp_halt(codec); 2685 alc5505_dsp_suspend(codec);
2671 return alc_suspend(codec); 2686 return alc_suspend(codec);
2672} 2687}
2673 2688
@@ -2696,7 +2711,7 @@ static int alc269_resume(struct hda_codec *codec)
2696 alc_inv_dmic_sync(codec, true); 2711 alc_inv_dmic_sync(codec, true);
2697 hda_call_check_power_status(codec, 0x01); 2712 hda_call_check_power_status(codec, 0x01);
2698 if (spec->has_alc5505_dsp) 2713 if (spec->has_alc5505_dsp)
2699 alc5505_dsp_back_from_halt(codec); 2714 alc5505_dsp_resume(codec);
2700 return 0; 2715 return 0;
2701} 2716}
2702#endif /* CONFIG_PM */ 2717#endif /* CONFIG_PM */
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index b1dc7d426438..e2de9ecfd641 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3377,7 +3377,7 @@ static int wm8962_probe(struct snd_soc_codec *codec)
3377{ 3377{
3378 int ret; 3378 int ret;
3379 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 3379 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
3380 struct wm8962_pdata *pdata = dev_get_platdata(codec->dev); 3380 struct wm8962_pdata *pdata = &wm8962->pdata;
3381 int i, trigger, irq_pol; 3381 int i, trigger, irq_pol;
3382 bool dmicclk, dmicdat; 3382 bool dmicclk, dmicdat;
3383 3383
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 7a8bc1220b2e..3f726e4f88db 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -113,13 +113,13 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
113 ssi_pdev = of_find_device_by_node(ssi_np); 113 ssi_pdev = of_find_device_by_node(ssi_np);
114 if (!ssi_pdev) { 114 if (!ssi_pdev) {
115 dev_err(&pdev->dev, "failed to find SSI platform device\n"); 115 dev_err(&pdev->dev, "failed to find SSI platform device\n");
116 ret = -EINVAL; 116 ret = -EPROBE_DEFER;
117 goto fail; 117 goto fail;
118 } 118 }
119 codec_dev = of_find_i2c_device_by_node(codec_np); 119 codec_dev = of_find_i2c_device_by_node(codec_np);
120 if (!codec_dev) { 120 if (!codec_dev) {
121 dev_err(&pdev->dev, "failed to find codec platform device\n"); 121 dev_err(&pdev->dev, "failed to find codec platform device\n");
122 return -EINVAL; 122 return -EPROBE_DEFER;
123 } 123 }
124 124
125 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 125 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 49d870034bc3..54511c5e6a7c 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -24,6 +24,7 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26#include <linux/clk.h> 26#include <linux/clk.h>
27#include <linux/clk-provider.h>
27#include <linux/delay.h> 28#include <linux/delay.h>
28#include <linux/time.h> 29#include <linux/time.h>
29#include <sound/core.h> 30#include <sound/core.h>
@@ -658,6 +659,33 @@ static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
658 return IRQ_HANDLED; 659 return IRQ_HANDLED;
659} 660}
660 661
662static int mxs_saif_mclk_init(struct platform_device *pdev)
663{
664 struct mxs_saif *saif = platform_get_drvdata(pdev);
665 struct device_node *np = pdev->dev.of_node;
666 struct clk *clk;
667 int ret;
668
669 clk = clk_register_divider(&pdev->dev, "mxs_saif_mclk",
670 __clk_get_name(saif->clk), 0,
671 saif->base + SAIF_CTRL,
672 BP_SAIF_CTRL_BITCLK_MULT_RATE, 3,
673 0, NULL);
674 if (IS_ERR(clk)) {
675 ret = PTR_ERR(clk);
676 if (ret == -EEXIST)
677 return 0;
678 dev_err(&pdev->dev, "failed to register mclk: %d\n", ret);
679 return PTR_ERR(clk);
680 }
681
682 ret = of_clk_add_provider(np, of_clk_src_simple_get, clk);
683 if (ret)
684 return ret;
685
686 return 0;
687}
688
661static int mxs_saif_probe(struct platform_device *pdev) 689static int mxs_saif_probe(struct platform_device *pdev)
662{ 690{
663 struct device_node *np = pdev->dev.of_node; 691 struct device_node *np = pdev->dev.of_node;
@@ -734,6 +762,13 @@ static int mxs_saif_probe(struct platform_device *pdev)
734 762
735 platform_set_drvdata(pdev, saif); 763 platform_set_drvdata(pdev, saif);
736 764
765 /* We only support saif0 being tx and clock master */
766 if (saif->id == 0) {
767 ret = mxs_saif_mclk_init(pdev);
768 if (ret)
769 dev_warn(&pdev->dev, "failed to init clocks\n");
770 }
771
737 ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component, 772 ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component,
738 &mxs_saif_dai, 1); 773 &mxs_saif_dai, 1);
739 if (ret) { 774 if (ret) {
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 82ebb1a51479..7a1734697434 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1016,52 +1016,6 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
1016 return i2s; 1016 return i2s;
1017} 1017}
1018 1018
1019#ifdef CONFIG_OF
1020static int samsung_i2s_parse_dt_gpio(struct i2s_dai *i2s)
1021{
1022 struct device *dev = &i2s->pdev->dev;
1023 int index, gpio, ret;
1024
1025 for (index = 0; index < 7; index++) {
1026 gpio = of_get_gpio(dev->of_node, index);
1027 if (!gpio_is_valid(gpio)) {
1028 dev_err(dev, "invalid gpio[%d]: %d\n", index, gpio);
1029 goto free_gpio;
1030 }
1031
1032 ret = gpio_request(gpio, dev_name(dev));
1033 if (ret) {
1034 dev_err(dev, "gpio [%d] request failed\n", gpio);
1035 goto free_gpio;
1036 }
1037 i2s->gpios[index] = gpio;
1038 }
1039 return 0;
1040
1041free_gpio:
1042 while (--index >= 0)
1043 gpio_free(i2s->gpios[index]);
1044 return -EINVAL;
1045}
1046
1047static void samsung_i2s_dt_gpio_free(struct i2s_dai *i2s)
1048{
1049 unsigned int index;
1050 for (index = 0; index < 7; index++)
1051 gpio_free(i2s->gpios[index]);
1052}
1053#else
1054static int samsung_i2s_parse_dt_gpio(struct i2s_dai *dai)
1055{
1056 return -EINVAL;
1057}
1058
1059static void samsung_i2s_dt_gpio_free(struct i2s_dai *dai)
1060{
1061}
1062
1063#endif
1064
1065static const struct of_device_id exynos_i2s_match[]; 1019static const struct of_device_id exynos_i2s_match[];
1066 1020
1067static inline int samsung_i2s_get_driver_data(struct platform_device *pdev) 1021static inline int samsung_i2s_get_driver_data(struct platform_device *pdev)
@@ -1235,18 +1189,10 @@ static int samsung_i2s_probe(struct platform_device *pdev)
1235 pri_dai->sec_dai = sec_dai; 1189 pri_dai->sec_dai = sec_dai;
1236 } 1190 }
1237 1191
1238 if (np) { 1192 if (i2s_pdata && i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
1239 if (samsung_i2s_parse_dt_gpio(pri_dai)) { 1193 dev_err(&pdev->dev, "Unable to configure gpio\n");
1240 dev_err(&pdev->dev, "Unable to configure gpio\n"); 1194 ret = -EINVAL;
1241 ret = -EINVAL; 1195 goto err;
1242 goto err;
1243 }
1244 } else {
1245 if (i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
1246 dev_err(&pdev->dev, "Unable to configure gpio\n");
1247 ret = -EINVAL;
1248 goto err;
1249 }
1250 } 1196 }
1251 1197
1252 snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component, 1198 snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component,
@@ -1267,14 +1213,10 @@ static int samsung_i2s_remove(struct platform_device *pdev)
1267{ 1213{
1268 struct i2s_dai *i2s, *other; 1214 struct i2s_dai *i2s, *other;
1269 struct resource *res; 1215 struct resource *res;
1270 struct s3c_audio_pdata *i2s_pdata = pdev->dev.platform_data;
1271 1216
1272 i2s = dev_get_drvdata(&pdev->dev); 1217 i2s = dev_get_drvdata(&pdev->dev);
1273 other = i2s->pri_dai ? : i2s->sec_dai; 1218 other = i2s->pri_dai ? : i2s->sec_dai;
1274 1219
1275 if (!i2s_pdata->cfg_gpio && pdev->dev.of_node)
1276 samsung_i2s_dt_gpio_free(i2s->pri_dai);
1277
1278 if (other) { 1220 if (other) {
1279 other->pri_dai = NULL; 1221 other->pri_dai = NULL;
1280 other->sec_dai = NULL; 1222 other->sec_dai = NULL;
diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c
index 20e98d1dded2..e5e81b111001 100644
--- a/sound/soc/samsung/s3c-i2s-v2.c
+++ b/sound/soc/samsung/s3c-i2s-v2.c
@@ -1,6 +1,4 @@
1/* sound/soc/samsung/s3c-i2c-v2.c 1/* ALSA Soc Audio Layer - I2S core for newer Samsung SoCs.
2 *
3 * ALSA Soc Audio Layer - I2S core for newer Samsung SoCs.
4 * 2 *
5 * Copyright (c) 2006 Wolfson Microelectronics PLC. 3 * Copyright (c) 2006 Wolfson Microelectronics PLC.
6 * Graeme Gregory graeme.gregory@wolfsonmicro.com 4 * Graeme Gregory graeme.gregory@wolfsonmicro.com
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 5b01330b8452..1bc45e71f1fe 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -129,6 +129,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
129{ 129{
130 struct audioformat *fp; 130 struct audioformat *fp;
131 struct usb_host_interface *alts; 131 struct usb_host_interface *alts;
132 struct usb_interface_descriptor *altsd;
132 int stream, err; 133 int stream, err;
133 unsigned *rate_table = NULL; 134 unsigned *rate_table = NULL;
134 135
@@ -166,6 +167,9 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
166 return -EINVAL; 167 return -EINVAL;
167 } 168 }
168 alts = &iface->altsetting[fp->altset_idx]; 169 alts = &iface->altsetting[fp->altset_idx];
170 altsd = get_iface_desc(alts);
171 fp->protocol = altsd->bInterfaceProtocol;
172
169 if (fp->datainterval == 0) 173 if (fp->datainterval == 0)
170 fp->datainterval = snd_usb_parse_datainterval(chip, alts); 174 fp->datainterval = snd_usb_parse_datainterval(chip, alts);
171 if (fp->maxpacksize == 0) 175 if (fp->maxpacksize == 0)