Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fb3767b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 0edcd16a 42d4ab83
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -2112,6 +2112,9 @@ static void ad_vmaster_eapd_hook(void *private_data, int enabled)
{
{
	struct hda_codec *codec = private_data;
	struct hda_codec *codec = private_data;
	struct ad198x_spec *spec = codec->spec;
	struct ad198x_spec *spec = codec->spec;

	if (!spec->eapd_nid)
		return;
	snd_hda_codec_update_cache(codec, spec->eapd_nid, 0,
	snd_hda_codec_update_cache(codec, spec->eapd_nid, 0,
				   AC_VERB_SET_EAPD_BTLENABLE,
				   AC_VERB_SET_EAPD_BTLENABLE,
				   enabled ? 0x02 : 0x00);
				   enabled ? 0x02 : 0x00);
@@ -3601,13 +3604,16 @@ static void ad1884_fixup_hp_eapd(struct hda_codec *codec,
{
{
	struct ad198x_spec *spec = codec->spec;
	struct ad198x_spec *spec = codec->spec;


	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
	switch (action) {
	case HDA_FIXUP_ACT_PRE_PROBE:
		spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook;
		break;
	case HDA_FIXUP_ACT_PROBE:
		if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT)
		if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT)
			spec->eapd_nid = spec->gen.autocfg.line_out_pins[0];
			spec->eapd_nid = spec->gen.autocfg.line_out_pins[0];
		else
		else
			spec->eapd_nid = spec->gen.autocfg.speaker_pins[0];
			spec->eapd_nid = spec->gen.autocfg.speaker_pins[0];
		if (spec->eapd_nid)
		break;
			spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook;
	}
	}
}
}


+17 −2
Original line number Original line Diff line number Diff line
@@ -37,6 +37,9 @@
#include "hda_jack.h"
#include "hda_jack.h"
#include "hda_generic.h"
#include "hda_generic.h"


/* keep halting ALC5505 DSP, for power saving */
#define HALT_REALTEK_ALC5505

/* unsol event tags */
/* unsol event tags */
#define ALC_DCVOL_EVENT		0x08
#define ALC_DCVOL_EVENT		0x08


@@ -2659,15 +2662,27 @@ static void alc5505_dsp_init(struct hda_codec *codec)
	alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
	alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
	alc5505_coef_set(codec, 0x880c, 0x00000003);
	alc5505_coef_set(codec, 0x880c, 0x00000003);
	alc5505_coef_set(codec, 0x880c, 0x00000010);
	alc5505_coef_set(codec, 0x880c, 0x00000010);

#ifdef HALT_REALTEK_ALC5505
	alc5505_dsp_halt(codec);
#endif
}
}


#ifdef HALT_REALTEK_ALC5505
#define alc5505_dsp_suspend(codec)	/* NOP */
#define alc5505_dsp_resume(codec)	/* NOP */
#else
#define alc5505_dsp_suspend(codec)	alc5505_dsp_halt(codec)
#define alc5505_dsp_resume(codec)	alc5505_dsp_back_from_halt(codec)
#endif

#ifdef CONFIG_PM
#ifdef CONFIG_PM
static int alc269_suspend(struct hda_codec *codec)
static int alc269_suspend(struct hda_codec *codec)
{
{
	struct alc_spec *spec = codec->spec;
	struct alc_spec *spec = codec->spec;


	if (spec->has_alc5505_dsp)
	if (spec->has_alc5505_dsp)
		alc5505_dsp_halt(codec);
		alc5505_dsp_suspend(codec);
	return alc_suspend(codec);
	return alc_suspend(codec);
}
}


@@ -2696,7 +2711,7 @@ static int alc269_resume(struct hda_codec *codec)
	alc_inv_dmic_sync(codec, true);
	alc_inv_dmic_sync(codec, true);
	hda_call_check_power_status(codec, 0x01);
	hda_call_check_power_status(codec, 0x01);
	if (spec->has_alc5505_dsp)
	if (spec->has_alc5505_dsp)
		alc5505_dsp_back_from_halt(codec);
		alc5505_dsp_resume(codec);
	return 0;
	return 0;
}
}
#endif /* CONFIG_PM */
#endif /* CONFIG_PM */
+1 −1
Original line number Original line Diff line number Diff line
@@ -3377,7 +3377,7 @@ static int wm8962_probe(struct snd_soc_codec *codec)
{
{
	int ret;
	int ret;
	struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
	struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
	struct wm8962_pdata *pdata = dev_get_platdata(codec->dev);
	struct wm8962_pdata *pdata = &wm8962->pdata;
	int i, trigger, irq_pol;
	int i, trigger, irq_pol;
	bool dmicclk, dmicdat;
	bool dmicclk, dmicdat;


+2 −2
Original line number Original line Diff line number Diff line
@@ -113,13 +113,13 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
	ssi_pdev = of_find_device_by_node(ssi_np);
	ssi_pdev = of_find_device_by_node(ssi_np);
	if (!ssi_pdev) {
	if (!ssi_pdev) {
		dev_err(&pdev->dev, "failed to find SSI platform device\n");
		dev_err(&pdev->dev, "failed to find SSI platform device\n");
		ret = -EINVAL;
		ret = -EPROBE_DEFER;
		goto fail;
		goto fail;
	}
	}
	codec_dev = of_find_i2c_device_by_node(codec_np);
	codec_dev = of_find_i2c_device_by_node(codec_np);
	if (!codec_dev) {
	if (!codec_dev) {
		dev_err(&pdev->dev, "failed to find codec platform device\n");
		dev_err(&pdev->dev, "failed to find codec platform device\n");
		return -EINVAL;
		return -EPROBE_DEFER;
	}
	}


	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+35 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
#include <linux/clk.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/time.h>
#include <linux/time.h>
#include <sound/core.h>
#include <sound/core.h>
@@ -658,6 +659,33 @@ static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
	return IRQ_HANDLED;
	return IRQ_HANDLED;
}
}


static int mxs_saif_mclk_init(struct platform_device *pdev)
{
	struct mxs_saif *saif = platform_get_drvdata(pdev);
	struct device_node *np = pdev->dev.of_node;
	struct clk *clk;
	int ret;

	clk = clk_register_divider(&pdev->dev, "mxs_saif_mclk",
				   __clk_get_name(saif->clk), 0,
				   saif->base + SAIF_CTRL,
				   BP_SAIF_CTRL_BITCLK_MULT_RATE, 3,
				   0, NULL);
	if (IS_ERR(clk)) {
		ret = PTR_ERR(clk);
		if (ret == -EEXIST)
			return 0;
		dev_err(&pdev->dev, "failed to register mclk: %d\n", ret);
		return PTR_ERR(clk);
	}

	ret = of_clk_add_provider(np, of_clk_src_simple_get, clk);
	if (ret)
		return ret;

	return 0;
}

static int mxs_saif_probe(struct platform_device *pdev)
static int mxs_saif_probe(struct platform_device *pdev)
{
{
	struct device_node *np = pdev->dev.of_node;
	struct device_node *np = pdev->dev.of_node;
@@ -734,6 +762,13 @@ static int mxs_saif_probe(struct platform_device *pdev)


	platform_set_drvdata(pdev, saif);
	platform_set_drvdata(pdev, saif);


	/* We only support saif0 being tx and clock master */
	if (saif->id == 0) {
		ret = mxs_saif_mclk_init(pdev);
		if (ret)
			dev_warn(&pdev->dev, "failed to init clocks\n");
	}

	ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component,
	ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component,
					 &mxs_saif_dai, 1);
					 &mxs_saif_dai, 1);
	if (ret) {
	if (ret) {
Loading