5 Jun
2024
5 Jun
'24
10:47 a.m.
+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?