From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Jack Yu <jack.yu@realtek.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"lars@metafoo.de" <lars@metafoo.de>,
"Flove(HsinFu)" <flove@realtek.com>,
"Oder Chiou" <oder_chiou@realtek.com>,
"Shuming [范書銘]" <shumingf@realtek.com>,
"Derek [方德義]" <derek.fang@realtek.com>
Subject: Re: [PATCH] ASoC: rt1318: Add RT1318 audio amplifier driver
Date: Wed, 5 Jun 2024 09:47:34 +0200 [thread overview]
Message-ID: <e20101f0-8a86-435c-b8c8-25f82ff2a775@linux.intel.com> (raw)
In-Reply-To: <c6d0e09de01c4804bfff6efe92fff04c@realtek.com>
> +struct rt1318_init_reg {
> + u32 reg;
> + u8 val;
> + u8 delay;
> +};
That looks like a 'struct reg_sequence' ?
> +static struct rt1318_init_reg init_list[] = {
> + { 0x0000C000, 0x01, 0},
> + { 0x0000F20D, 0x00, 0},
> + { 0x0000F212, 0x3E, 0},
...
> +
> +static int rt1318_reg_init(struct snd_soc_component *component)
> +{
> + struct rt1318_priv *rt1318 = snd_soc_component_get_drvdata(component);
> + int i;
> +
> + for (i = 0; i < rt1318_INIT_REG_LEN; i++) {
> + regmap_write(rt1318->regmap, init_list[i].reg, init_list[i].val);
> + mdelay(init_list[i].delay);
> + }
> +
> + return 0;
> +}
> +
> +static const struct reg_default rt1318_reg[] = {
> + { 0xc000, 0x00 },
> + { 0xc001, 0x43 },
> + { 0xc003, 0x22 },
> + { 0xc004, 0x44 },
...
> + { 0xf20d, 0x00 },
> + { 0xf212, 0x00 },
> + { 0xf21a, 0x00 },
> + { 0xf223, 0x40 },
And this looks to me as as a set of defaults patches by a reg_sequence -
similar to what is done for rt1308 and rt1316.
Is there any opportunity to use regmap_register_patch() instead of
open-coding the loop?
next prev parent reply other threads:[~2024-06-05 7:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 6:17 [PATCH] ASoC: rt1318: Add RT1318 audio amplifier driver Jack Yu
2024-06-04 12:38 ` Mark Brown
2024-06-05 8:35 ` Jack Yu
2024-06-04 15:28 ` Pierre-Louis Bossart
2024-06-05 3:20 ` Jack Yu
2024-06-05 7:47 ` Pierre-Louis Bossart [this message]
2024-06-05 8:22 ` Jack Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e20101f0-8a86-435c-b8c8-25f82ff2a775@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=derek.fang@realtek.com \
--cc=flove@realtek.com \
--cc=jack.yu@realtek.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=oder_chiou@realtek.com \
--cc=shumingf@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox