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

Commit a3e048a5 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/fix/fsl-sai', 'asoc/fix/intel',...

Merge remote-tracking branches 'asoc/fix/fsl-sai', 'asoc/fix/intel', 'asoc/fix/max98090' and 'asoc/fix/s6000' into asoc-linus
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2284,7 +2284,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
	/* Register for interrupts */
	dev_dbg(codec->dev, "irq = %d\n", max98090->irq);

	ret = request_threaded_irq(max98090->irq, NULL,
	ret = devm_request_threaded_irq(codec->dev, max98090->irq, NULL,
		max98090_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
		"max98090_interrupt", codec);
	if (ret < 0) {
+6 −3
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ static irqreturn_t fsl_sai_isr(int irq, void *devid)
	xcsr &= ~FSL_SAI_CSR_xF_MASK;

	if (flags)
		regmap_write(sai->regmap, FSL_SAI_TCSR, flags | xcsr);
		regmap_write(sai->regmap, FSL_SAI_RCSR, flags | xcsr);

out:
	if (irq_none)
@@ -371,10 +371,13 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,

		/* Check if the opposite FRDE is also disabled */
		if (!(tx ? rcsr & FSL_SAI_CSR_FRDE : tcsr & FSL_SAI_CSR_FRDE)) {
			/* Disable both directions and reset their FIFOs */
			regmap_update_bits(sai->regmap, FSL_SAI_TCSR,
					   FSL_SAI_CSR_TERE, 0);
					   FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR,
					   FSL_SAI_CSR_FR);
			regmap_update_bits(sai->regmap, FSL_SAI_RCSR,
					   FSL_SAI_CSR_TERE, 0);
					   FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR,
					   FSL_SAI_CSR_FR);
		}
		break;
	default:
+8 −11
Original line number Diff line number Diff line
@@ -39,8 +39,7 @@ static const struct snd_soc_dapm_widget byt_max98090_widgets[] = {

static const struct snd_soc_dapm_route byt_max98090_audio_map[] = {
	{"IN34", NULL, "Headset Mic"},
	{"IN34", NULL, "MICBIAS"},
	{"MICBIAS", NULL, "Headset Mic"},
	{"Headset Mic", NULL, "MICBIAS"},
	{"DMICL", NULL, "Int Mic"},
	{"Headphone", NULL, "HPL"},
	{"Headphone", NULL, "HPR"},
@@ -84,7 +83,8 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = {
	{
		.name		= "mic-gpio",
		.idx		= 1,
		.report		= SND_JACK_MICROPHONE | SND_JACK_LINEIN,
		.invert		= 1,
		.report		= SND_JACK_MICROPHONE,
		.debounce_time	= 200,
	},
};
@@ -108,7 +108,8 @@ static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime)
	}

	/* Enable jack detection */
	ret = snd_soc_jack_new(codec, "Headphone", SND_JACK_HEADPHONE, jack);
	ret = snd_soc_jack_new(codec, "Headset",
			       SND_JACK_LINEOUT | SND_JACK_HEADSET, jack);
	if (ret)
		return ret;

@@ -117,13 +118,9 @@ static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime)
	if (ret)
		return ret;

	ret = snd_soc_jack_add_gpiods(card->dev->parent, jack,
	return snd_soc_jack_add_gpiods(card->dev->parent, jack,
				       ARRAY_SIZE(hs_jack_gpios),
				       hs_jack_gpios);
	if (ret)
		return ret;

	return max98090_mic_detect(codec, jack);
}

static struct snd_soc_dai_link byt_max98090_dais[] = {
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ static const struct snd_pcm_hardware sst_byt_pcm_hardware = {
				  SNDRV_PCM_INFO_PAUSE |
				  SNDRV_PCM_INFO_RESUME,
	.formats		= SNDRV_PCM_FMTBIT_S16_LE |
				  SNDRV_PCM_FORMAT_S24_LE,
				  SNDRV_PCM_FMTBIT_S24_LE,
	.period_bytes_min	= 384,
	.period_bytes_max	= 48000,
	.periods_min		= 2,
+13 −0
Original line number Diff line number Diff line
@@ -359,6 +359,17 @@ static u32 hsw_block_get_bit(struct sst_mem_block *block)
	return bit;
}

/*dummy read a SRAM block.*/
static void sst_mem_block_dummy_read(struct sst_mem_block *block)
{
	u32 size;
	u8 tmp_buf[4];
	struct sst_dsp *sst = block->dsp;

	size = block->size > 4 ? 4 : block->size;
	memcpy_fromio(tmp_buf, sst->addr.lpe + block->offset, size);
}

/* enable 32kB memory block - locks held by caller */
static int hsw_block_enable(struct sst_mem_block *block)
{
@@ -378,6 +389,8 @@ static int hsw_block_enable(struct sst_mem_block *block)
	/* wait 18 DSP clock ticks */
	udelay(10);

	/*add a dummy read before the SRAM block is written, otherwise the writing may miss bytes sometimes.*/
	sst_mem_block_dummy_read(block);
	return 0;
}

Loading