Commit ee1564d6 authored by Martin Blumenstingl's avatar Martin Blumenstingl
Browse files

ASoC: meson: aiu: encoder-i2s: implement the .mute_stream callback



Implement the .mute_stream callback based on the code from the vendor
driver.

Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
parent 154dd417
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,8 @@
#define AIU_CLK_CTRL_MORE_I2S_DIV	GENMASK(5, 0)
#define AIU_CLK_CTRL_MORE_I2S_DIV	GENMASK(5, 0)
#define AIU_CODEC_DAC_LRCLK_CTRL_DIV	GENMASK(11, 0)
#define AIU_CODEC_DAC_LRCLK_CTRL_DIV	GENMASK(11, 0)


#define AIU_I2S_MUTE_SWAP_MUTE		GENMASK(15, 8)

static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component,
static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component,
					   bool enable)
					   bool enable)
{
{
@@ -352,6 +354,18 @@ static void aiu_encoder_i2s_shutdown(struct snd_pcm_substream *substream,
	clk_bulk_disable_unprepare(aiu->i2s.clk_num, aiu->i2s.clks);
	clk_bulk_disable_unprepare(aiu->i2s.clk_num, aiu->i2s.clks);
}
}


static int aiu_encoder_i2s_mute_stream(struct snd_soc_dai *dai, int mute,
				       int stream)
{
	struct snd_soc_component *component = dai->component;

	snd_soc_component_update_bits(component, AIU_I2S_MUTE_SWAP,
				      AIU_I2S_MUTE_SWAP_MUTE,
				      mute ? AIU_I2S_MUTE_SWAP_MUTE : 0);

	return 0;
}

const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
	.trigger	= aiu_encoder_i2s_trigger,
	.trigger	= aiu_encoder_i2s_trigger,
	.hw_params	= aiu_encoder_i2s_hw_params,
	.hw_params	= aiu_encoder_i2s_hw_params,
@@ -360,5 +374,6 @@ const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
	.set_sysclk	= aiu_encoder_i2s_set_sysclk,
	.set_sysclk	= aiu_encoder_i2s_set_sysclk,
	.startup	= aiu_encoder_i2s_startup,
	.startup	= aiu_encoder_i2s_startup,
	.shutdown	= aiu_encoder_i2s_shutdown,
	.shutdown	= aiu_encoder_i2s_shutdown,
	.mute_stream	= aiu_encoder_i2s_mute_stream,
};
};
+1 −0
Original line number Original line Diff line number Diff line
@@ -66,6 +66,7 @@ extern const struct snd_soc_dai_ops aiu_encoder_spdif_dai_ops;
#define AIU_958_CHSTAT_L0		0x020
#define AIU_958_CHSTAT_L0		0x020
#define AIU_958_CHSTAT_L1		0x024
#define AIU_958_CHSTAT_L1		0x024
#define AIU_958_CTRL			0x028
#define AIU_958_CTRL			0x028
#define AIU_I2S_MUTE_SWAP		0x030
#define AIU_I2S_SOURCE_DESC		0x034
#define AIU_I2S_SOURCE_DESC		0x034
#define AIU_I2S_DAC_CFG			0x040
#define AIU_I2S_DAC_CFG			0x040
#define AIU_I2S_SYNC			0x044
#define AIU_I2S_SYNC			0x044