> -----Original Message----- > From: Mark Brown <broonie@xxxxxxxxxx> > Sent: Tuesday, September 24, 2024 4:45 PM > To: Jack Yu <jack.yu@xxxxxxxxxxx> > Cc: lgirdwood@xxxxxxxxx; alsa-devel@xxxxxxxxxxxxxxxx; lars@xxxxxxxxxx; > Flove(HsinFu) <flove@xxxxxxxxxxx>; Oder Chiou <oder_chiou@xxxxxxxxxxx>; > Shuming [范書銘] <shumingf@xxxxxxxxxxx>; Derek [方德義] > <derek.fang@xxxxxxxxxxx> > Subject: Re: [PATCH] ASoC: rt721-sdca: Add RT721 SDCA driver > > 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? It's a typo. I'll send a v2 patch to fix it. > > > + > > +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.