Re: [PATCH] ASoC: rt721-sdca: Add RT721 SDCA driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 24, 2024 at 02:13:24AM +0000, Jack Yu wrote:

> +static const struct reg_default rt721_sdca_mbq_defaults[] = {
> +	{ 0x0900007, 0xc004 },
> +	{ 0x2000001, 0x0000 },
> +	{ 0x2000002, 0x0000 },
> +	{ 0x2000003, 0x0000 },
> +	{ 0x2000013, 0x8001 },
> +	{ 0x200003c, 0x0000 },
> +	{ 0x2000046, 0x3400 },
> +	// { 0x5810000, 0x702d },

Why is there this one commented value?

> +
> +static int rt721_sdca_pde34_event(struct snd_soc_dapm_widget *w,
> +	struct snd_kcontrol *kcontrol, int event)
> +{
> +	struct snd_soc_component *component =
> +		snd_soc_dapm_to_component(w->dapm);
> +	struct rt721_sdca_priv *rt721 = snd_soc_component_get_drvdata(component);
> +	unsigned char ps0 = 0x0, ps3 = 0x3;
> +
> +	switch (event) {
> +	case SND_SOC_DAPM_POST_PMU:
> +		regmap_write(rt721->regmap,
> +			SDW_SDCA_CTL(FUNC_NUM_JACK_CODEC, RT721_SDCA_ENT_PDE12,
> +				RT721_SDCA_CTL_REQ_POWER_STATE, 0), ps0);
> +		break;
> +	case SND_SOC_DAPM_PRE_PMD:
> +		regmap_write(rt721->regmap,
> +			SDW_SDCA_CTL(FUNC_NUM_JACK_CODEC, RT721_SDCA_ENT_PDE12,
> +				RT721_SDCA_CTL_REQ_POWER_STATE, 0), ps3);
> +		break;
> +	}
> +	return 0;
> +}

We should perhaps invent some helpers for these Soundwire events,
there's clearly a common pattern.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux