Unverified Commit 327719aa authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Merge up fixes

Some of these, particularly the wm_adsp one in the immediate case, are
needed as a basis for new work.
parents 5faf65b5 09bbc4f0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ struct hdac_ext_stream {
	u32 pphcldpl;
	u32 pphcldpu;

	u32 pplcllpl;
	u32 pplcllpu;

	bool decoupled:1;
	bool link_locked:1;
	bool link_prepared;
+7 −6
Original line number Diff line number Diff line
@@ -115,7 +115,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
		goto unregister_dmic_dev;
	}

	acp_init(chip);
	ret = acp_init(chip);
	if (ret)
		goto unregister_dmic_dev;

	res = devm_kcalloc(&pci->dev, num_res, sizeof(struct resource), GFP_KERNEL);
	if (!res) {
		ret = -ENOMEM;
@@ -133,11 +136,9 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
		}
	}

	if (flag == FLAG_AMD_LEGACY_ONLY_DMIC) {
	ret = check_acp_pdm(pci, chip);
	if (ret < 0)
		goto skip_pdev_creation;
	}

	chip->flag = flag;
	memset(&pdevinfo, 0, sizeof(pdevinfo));
+5 −0
Original line number Diff line number Diff line
@@ -56,6 +56,11 @@ static int _cs_amp_write_cal_coeffs(struct cs_dsp *dsp,
	dev_dbg(dsp->dev, "Calibration: Ambient=%#x, Status=%#x, CalR=%d\n",
		data->calAmbient, data->calStatus, data->calR);

	if (list_empty(&dsp->ctl_list)) {
		dev_info(dsp->dev, "Calibration disabled due to missing firmware controls\n");
		return -ENOENT;
	}

	ret = cs_amp_write_cal_coeff(dsp, controls, controls->ambient, data->calAmbient);
	if (ret)
		return ret;
+8 −4
Original line number Diff line number Diff line
@@ -2364,7 +2364,8 @@ static int cs42l43_codec_runtime_resume(struct device *dev)

static int cs42l43_codec_suspend(struct device *dev)
{
	struct cs42l43 *cs42l43 = dev_get_drvdata(dev);
	struct cs42l43_codec *priv = dev_get_drvdata(dev);
	struct cs42l43 *cs42l43 = priv->core;

	disable_irq(cs42l43->irq);

@@ -2373,7 +2374,8 @@ static int cs42l43_codec_suspend(struct device *dev)

static int cs42l43_codec_suspend_noirq(struct device *dev)
{
	struct cs42l43 *cs42l43 = dev_get_drvdata(dev);
	struct cs42l43_codec *priv = dev_get_drvdata(dev);
	struct cs42l43 *cs42l43 = priv->core;

	enable_irq(cs42l43->irq);

@@ -2382,7 +2384,8 @@ static int cs42l43_codec_suspend_noirq(struct device *dev)

static int cs42l43_codec_resume(struct device *dev)
{
	struct cs42l43 *cs42l43 = dev_get_drvdata(dev);
	struct cs42l43_codec *priv = dev_get_drvdata(dev);
	struct cs42l43 *cs42l43 = priv->core;

	enable_irq(cs42l43->irq);

@@ -2391,7 +2394,8 @@ static int cs42l43_codec_resume(struct device *dev)

static int cs42l43_codec_resume_noirq(struct device *dev)
{
	struct cs42l43 *cs42l43 = dev_get_drvdata(dev);
	struct cs42l43_codec *priv = dev_get_drvdata(dev);
	struct cs42l43 *cs42l43 = priv->core;

	disable_irq(cs42l43->irq);

+21 −16
Original line number Diff line number Diff line
@@ -404,9 +404,9 @@ static const struct _coeff_div coeff_div_v3[] = {
	{125, 48000, 6000000, 0x04, 0x04, 0x1F, 0x2D, 0x8A, 0x0A, 0x27, 0x27},

	{128, 8000, 1024000, 0x60, 0x00, 0x05, 0x75, 0x8A, 0x1B, 0x1F, 0x7F},
	{128, 16000, 2048000, 0x20, 0x00, 0x31, 0x35, 0x8A, 0x1B, 0x1F, 0x3F},
	{128, 44100, 5644800, 0xE0, 0x00, 0x01, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F},
	{128, 48000, 6144000, 0xE0, 0x00, 0x01, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F},
	{128, 16000, 2048000, 0x20, 0x00, 0x31, 0x35, 0x08, 0x19, 0x1F, 0x3F},
	{128, 44100, 5644800, 0xE0, 0x00, 0x01, 0x2D, 0x48, 0x08, 0x1F, 0x1F},
	{128, 48000, 6144000, 0xE0, 0x00, 0x01, 0x2D, 0x48, 0x08, 0x1F, 0x1F},
	{144, 8000, 1152000, 0x20, 0x00, 0x03, 0x35, 0x8A, 0x1B, 0x23, 0x47},
	{144, 16000, 2304000, 0x20, 0x00, 0x11, 0x35, 0x8A, 0x1B, 0x23, 0x47},
	{192, 8000, 1536000, 0x60, 0x02, 0x0D, 0x75, 0x8A, 0x1B, 0x1F, 0x7F},
@@ -415,10 +415,10 @@ static const struct _coeff_div coeff_div_v3[] = {

	{200, 48000, 9600000, 0x04, 0x04, 0x0F, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F},
	{250, 48000, 12000000, 0x04, 0x04, 0x0F, 0x2D, 0xCA, 0x0A, 0x27, 0x27},
	{256, 8000, 2048000, 0x60, 0x00, 0x31, 0x35, 0x8A, 0x1B, 0x1F, 0x7F},
	{256, 16000, 4096000, 0x20, 0x00, 0x01, 0x35, 0x8A, 0x1B, 0x1F, 0x3F},
	{256, 44100, 11289600, 0xE0, 0x00, 0x30, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F},
	{256, 48000, 12288000, 0xE0, 0x00, 0x30, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F},
	{256, 8000, 2048000, 0x60, 0x00, 0x31, 0x35, 0x08, 0x19, 0x1F, 0x7F},
	{256, 16000, 4096000, 0x20, 0x00, 0x01, 0x35, 0x08, 0x19, 0x1F, 0x3F},
	{256, 44100, 11289600, 0xE0, 0x01, 0x01, 0x2D, 0x48, 0x08, 0x1F, 0x1F},
	{256, 48000, 12288000, 0xE0, 0x01, 0x01, 0x2D, 0x48, 0x08, 0x1F, 0x1F},
	{288, 8000, 2304000, 0x20, 0x00, 0x01, 0x35, 0x8A, 0x1B, 0x23, 0x47},
	{384, 8000, 3072000, 0x60, 0x02, 0x05, 0x75, 0x8A, 0x1B, 0x1F, 0x7F},
	{384, 16000, 6144000, 0x20, 0x02, 0x03, 0x35, 0x8A, 0x1B, 0x1F, 0x3F},
@@ -427,10 +427,10 @@ static const struct _coeff_div coeff_div_v3[] = {

	{400, 48000, 19200000, 0xE4, 0x04, 0x35, 0x6d, 0xCA, 0x0A, 0x1F, 0x1F},
	{500, 48000, 24000000, 0xF8, 0x04, 0x3F, 0x6D, 0xCA, 0x0A, 0x1F, 0x1F},
	{512, 8000, 4096000, 0x60, 0x00, 0x01, 0x35, 0x8A, 0x1B, 0x1F, 0x7F},
	{512, 16000, 8192000, 0x20, 0x00, 0x30, 0x35, 0x8A, 0x1B, 0x1F, 0x3F},
	{512, 44100, 22579200, 0xE0, 0x00, 0x00, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F},
	{512, 48000, 24576000, 0xE0, 0x00, 0x00, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F},
	{512, 8000, 4096000, 0x60, 0x00, 0x01, 0x08, 0x19, 0x1B, 0x1F, 0x7F},
	{512, 16000, 8192000, 0x20, 0x00, 0x30, 0x35, 0x08, 0x19, 0x1F, 0x3F},
	{512, 44100, 22579200, 0xE0, 0x00, 0x00, 0x2D, 0x48, 0x08, 0x1F, 0x1F},
	{512, 48000, 24576000, 0xE0, 0x00, 0x00, 0x2D, 0x48, 0x08, 0x1F, 0x1F},
	{768, 8000, 6144000, 0x60, 0x02, 0x11, 0x35, 0x8A, 0x1B, 0x1F, 0x7F},
	{768, 16000, 12288000, 0x20, 0x02, 0x01, 0x35, 0x8A, 0x1B, 0x1F, 0x3F},
	{768, 32000, 24576000, 0xE0, 0x02, 0x30, 0x2D, 0xCA, 0x0A, 0x1F, 0x1F},
@@ -827,7 +827,6 @@ static void es8326_jack_detect_handler(struct work_struct *work)
			dev_dbg(comp->dev, "Report hp remove event\n");
			snd_soc_jack_report(es8326->jack, 0, SND_JACK_HEADSET);
			/* mute adc when mic path switch */
			regmap_write(es8326->regmap, ES8326_ADC_SCALE, 0x33);
			regmap_write(es8326->regmap, ES8326_ADC1_SRC, 0x44);
			regmap_write(es8326->regmap, ES8326_ADC2_SRC, 0x66);
			es8326->hp = 0;
@@ -835,6 +834,7 @@ static void es8326_jack_detect_handler(struct work_struct *work)
		regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01);
		regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x0a);
		regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x03);
		regmap_write(es8326->regmap, ES8326_INT_SOURCE, ES8326_INT_SRC_PIN9);
		/*
		 * Inverted HPJACK_POL bit to trigger one IRQ to double check HP Removal event
		 */
@@ -857,6 +857,8 @@ static void es8326_jack_detect_handler(struct work_struct *work)
			 * set auto-check mode, then restart jack_detect_work after 400ms.
			 * Don't report jack status.
			 */
			regmap_write(es8326->regmap, ES8326_INT_SOURCE,
					(ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
			regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01);
			es8326_enable_micbias(es8326->component);
			usleep_range(50000, 70000);
@@ -883,7 +885,6 @@ static void es8326_jack_detect_handler(struct work_struct *work)
			snd_soc_jack_report(es8326->jack,
					SND_JACK_HEADSET, SND_JACK_HEADSET);

			regmap_write(es8326->regmap, ES8326_ADC_SCALE, 0x33);
			regmap_update_bits(es8326->regmap, ES8326_PGA_PDN,
					0x08, 0x08);
			regmap_update_bits(es8326->regmap, ES8326_PGAGAIN,
@@ -979,7 +980,7 @@ static int es8326_resume(struct snd_soc_component *component)
	regmap_write(es8326->regmap, ES8326_VMIDSEL, 0x0E);
	regmap_write(es8326->regmap, ES8326_ANA_LP, 0xf0);
	usleep_range(10000, 15000);
	regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xe9);
	regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xd9);
	regmap_write(es8326->regmap, ES8326_ANA_MICBIAS, 0xcb);
	/* set headphone default type and detect pin */
	regmap_write(es8326->regmap, ES8326_HPDET_TYPE, 0x83);
@@ -1030,8 +1031,7 @@ static int es8326_resume(struct snd_soc_component *component)
	es8326_enable_micbias(es8326->component);
	usleep_range(50000, 70000);
	regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x00);
	regmap_write(es8326->regmap, ES8326_INT_SOURCE,
		    (ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
	regmap_write(es8326->regmap, ES8326_INT_SOURCE, ES8326_INT_SRC_PIN9);
	regmap_write(es8326->regmap, ES8326_INTOUT_IO,
		     es8326->interrupt_clk);
	regmap_write(es8326->regmap, ES8326_SDINOUT1_IO,
@@ -1052,6 +1052,8 @@ static int es8326_resume(struct snd_soc_component *component)
	es8326->hp = 0;
	es8326->hpl_vol = 0x03;
	es8326->hpr_vol = 0x03;

	es8326_irq(es8326->irq, es8326);
	return 0;
}

@@ -1062,6 +1064,9 @@ static int es8326_suspend(struct snd_soc_component *component)
	cancel_delayed_work_sync(&es8326->jack_detect_work);
	es8326_disable_micbias(component);
	es8326->calibrated = false;
	regmap_write(es8326->regmap, ES8326_CLK_MUX, 0x2d);
	regmap_write(es8326->regmap, ES8326_DAC2HPMIX, 0x00);
	regmap_write(es8326->regmap, ES8326_ANA_PDN, 0x3b);
	regmap_write(es8326->regmap, ES8326_CLK_CTL, ES8326_CLK_OFF);
	regcache_cache_only(es8326->regmap, true);

Loading