Skip to content

Commit 0fb3767

Browse files
committed
Merge tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A few small fixes (and cleanups) for HD-audio, USB-audio and ASoC" * tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: fix regression for fixed stream quirk ALSA: hda - Keep halting ALC5505 DSP ASoC: wm8962: fix NULL pdata pointer ASoC: imx-sgtl5000: return E_PROBE_DEFER if ssi/codec not found ASoC: Samsung: Remove redundant comment ALSA: hda - Fix EAPD vmaster hook for AD1884 & co ASoC: samsung: Remove obsolete GPIO based DT pinmuxing ASoC: mxs: register saif mclk to clock framework
2 parents 0edcd16 + 42d4ab8 commit 0fb3767

8 files changed

Lines changed: 73 additions & 73 deletions

File tree

‎sound/pci/hda/patch_analog.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,6 +2112,9 @@ static void ad_vmaster_eapd_hook(void *private_data, int enabled)
21122112
{
21132113
struct hda_codec *codec = private_data;
21142114
struct ad198x_spec *spec = codec->spec;
2115+
2116+
if (!spec->eapd_nid)
2117+
return;
21152118
snd_hda_codec_update_cache(codec, spec->eapd_nid, 0,
21162119
AC_VERB_SET_EAPD_BTLENABLE,
21172120
enabled ? 0x02 : 0x00);
@@ -3601,13 +3604,16 @@ static void ad1884_fixup_hp_eapd(struct hda_codec *codec,
36013604
{
36023605
struct ad198x_spec *spec = codec->spec;
36033606

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:
36053612
if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT)
36063613
spec->eapd_nid = spec->gen.autocfg.line_out_pins[0];
36073614
else
36083615
spec->eapd_nid = spec->gen.autocfg.speaker_pins[0];
3609-
if (spec->eapd_nid)
3610-
spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook;
3616+
break;
36113617
}
36123618
}
36133619

‎sound/pci/hda/patch_realtek.c‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
#include "hda_jack.h"
3838
#include "hda_generic.h"
3939

40+
/* keep halting ALC5505 DSP, for power saving */
41+
#define HALT_REALTEK_ALC5505
42+
4043
/* unsol event tags */
4144
#define ALC_DCVOL_EVENT 0x08
4245

@@ -2659,15 +2662,27 @@ static void alc5505_dsp_init(struct hda_codec *codec)
26592662
alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
26602663
alc5505_coef_set(codec, 0x880c, 0x00000003);
26612664
alc5505_coef_set(codec, 0x880c, 0x00000010);
2665+
2666+
#ifdef HALT_REALTEK_ALC5505
2667+
alc5505_dsp_halt(codec);
2668+
#endif
26622669
}
26632670

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+
26642679
#ifdef CONFIG_PM
26652680
static int alc269_suspend(struct hda_codec *codec)
26662681
{
26672682
struct alc_spec *spec = codec->spec;
26682683

26692684
if (spec->has_alc5505_dsp)
2670-
alc5505_dsp_halt(codec);
2685+
alc5505_dsp_suspend(codec);
26712686
return alc_suspend(codec);
26722687
}
26732688

@@ -2696,7 +2711,7 @@ static int alc269_resume(struct hda_codec *codec)
26962711
alc_inv_dmic_sync(codec, true);
26972712
hda_call_check_power_status(codec, 0x01);
26982713
if (spec->has_alc5505_dsp)
2699-
alc5505_dsp_back_from_halt(codec);
2714+
alc5505_dsp_resume(codec);
27002715
return 0;
27012716
}
27022717
#endif /* CONFIG_PM */

‎sound/soc/codecs/wm8962.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3377,7 +3377,7 @@ static int wm8962_probe(struct snd_soc_codec *codec)
33773377
{
33783378
int ret;
33793379
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;
33813381
int i, trigger, irq_pol;
33823382
bool dmicclk, dmicdat;
33833383

‎sound/soc/fsl/imx-sgtl5000.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
113113
ssi_pdev = of_find_device_by_node(ssi_np);
114114
if (!ssi_pdev) {
115115
dev_err(&pdev->dev, "failed to find SSI platform device\n");
116-
ret = -EINVAL;
116+
ret = -EPROBE_DEFER;
117117
goto fail;
118118
}
119119
codec_dev = of_find_i2c_device_by_node(codec_np);
120120
if (!codec_dev) {
121121
dev_err(&pdev->dev, "failed to find codec platform device\n");
122-
return -EINVAL;
122+
return -EPROBE_DEFER;
123123
}
124124

125125
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);

‎sound/soc/mxs/mxs-saif.c‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/slab.h>
2525
#include <linux/dma-mapping.h>
2626
#include <linux/clk.h>
27+
#include <linux/clk-provider.h>
2728
#include <linux/delay.h>
2829
#include <linux/time.h>
2930
#include <sound/core.h>
@@ -658,6 +659,33 @@ static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
658659
return IRQ_HANDLED;
659660
}
660661

662+
static 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+
661689
static int mxs_saif_probe(struct platform_device *pdev)
662690
{
663691
struct device_node *np = pdev->dev.of_node;
@@ -734,6 +762,13 @@ static int mxs_saif_probe(struct platform_device *pdev)
734762

735763
platform_set_drvdata(pdev, saif);
736764

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+
737772
ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component,
738773
&mxs_saif_dai, 1);
739774
if (ret) {

‎sound/soc/samsung/i2s.c‎

Lines changed: 4 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,52 +1016,6 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
10161016
return i2s;
10171017
}
10181018

1019-
#ifdef CONFIG_OF
1020-
static 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-
1041-
free_gpio:
1042-
while (--index >= 0)
1043-
gpio_free(i2s->gpios[index]);
1044-
return -EINVAL;
1045-
}
1046-
1047-
static 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
1054-
static int samsung_i2s_parse_dt_gpio(struct i2s_dai *dai)
1055-
{
1056-
return -EINVAL;
1057-
}
1058-
1059-
static void samsung_i2s_dt_gpio_free(struct i2s_dai *dai)
1060-
{
1061-
}
1062-
1063-
#endif
1064-
10651019
static const struct of_device_id exynos_i2s_match[];
10661020

10671021
static inline int samsung_i2s_get_driver_data(struct platform_device *pdev)
@@ -1235,18 +1189,10 @@ static int samsung_i2s_probe(struct platform_device *pdev)
12351189
pri_dai->sec_dai = sec_dai;
12361190
}
12371191

1238-
if (np) {
1239-
if (samsung_i2s_parse_dt_gpio(pri_dai)) {
1240-
dev_err(&pdev->dev, "Unable to configure gpio\n");
1241-
ret = -EINVAL;
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-
}
1192+
if (i2s_pdata && i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
1193+
dev_err(&pdev->dev, "Unable to configure gpio\n");
1194+
ret = -EINVAL;
1195+
goto err;
12501196
}
12511197

12521198
snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component,
@@ -1267,14 +1213,10 @@ static int samsung_i2s_remove(struct platform_device *pdev)
12671213
{
12681214
struct i2s_dai *i2s, *other;
12691215
struct resource *res;
1270-
struct s3c_audio_pdata *i2s_pdata = pdev->dev.platform_data;
12711216

12721217
i2s = dev_get_drvdata(&pdev->dev);
12731218
other = i2s->pri_dai ? : i2s->sec_dai;
12741219

1275-
if (!i2s_pdata->cfg_gpio && pdev->dev.of_node)
1276-
samsung_i2s_dt_gpio_free(i2s->pri_dai);
1277-
12781220
if (other) {
12791221
other->pri_dai = NULL;
12801222
other->sec_dai = NULL;

‎sound/soc/samsung/s3c-i2s-v2.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/* sound/soc/samsung/s3c-i2c-v2.c
2-
*
3-
* ALSA Soc Audio Layer - I2S core for newer Samsung SoCs.
1+
/* ALSA Soc Audio Layer - I2S core for newer Samsung SoCs.
42
*
53
* Copyright (c) 2006 Wolfson Microelectronics PLC.
64
* Graeme Gregory graeme.gregory@wolfsonmicro.com

‎sound/usb/quirks.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
129129
{
130130
struct audioformat *fp;
131131
struct usb_host_interface *alts;
132+
struct usb_interface_descriptor *altsd;
132133
int stream, err;
133134
unsigned *rate_table = NULL;
134135

@@ -166,6 +167,9 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
166167
return -EINVAL;
167168
}
168169
alts = &iface->altsetting[fp->altset_idx];
170+
altsd = get_iface_desc(alts);
171+
fp->protocol = altsd->bInterfaceProtocol;
172+
169173
if (fp->datainterval == 0)
170174
fp->datainterval = snd_usb_parse_datainterval(chip, alts);
171175
if (fp->maxpacksize == 0)

0 commit comments

Comments
 (0)