On Fri, Sep 13, 2024 at 08:02:02AM +0600, Binbin Zhou wrote: > On Thu, Sep 5, 2024 at 8:05 PM Mark Brown <broonie@xxxxxxxxxx> wrote: > > > +/* > > > + * es8323 register cache > > > + * We can't read the es8323 register space when we > > > + * are using 2 wire for device control, so we cache them instead. > > > + */ > > > +static u16 es8323_reg[] = { > > > + 0x06, 0x1C, 0xC3, 0xFC, /* 0 */ > > > + 0xC0, 0x00, 0x00, 0x7C, /* 4 */ > > There's a bunch of regmap reimplementation in the driver, the cache and > > I/O code all looks totally generic. Just use regmap. > Sorry, I don't really understand this point. > Do you mean to use regmap_read()/regmap_write() instead of > snd_soc_component_read()/snd_soc_component_write()? > If so, are there any rules for using snd_soc_component_xxx()? No, it's fine to use the component wrappers if you happen to have a component to hand. What's an issue is things like writing your own register cache code (the above bit is part of an open coded cache implementation), or I2C read/write functions if there's not something unusual with how the device does I/O.
Attachment:
signature.asc
Description: PGP signature
- Follow-Ups:
- Re: [PATCH v1 02/10] ASoC: codecs: Add support for ES8323
- From: Binbin Zhou
- Re: [PATCH v1 02/10] ASoC: codecs: Add support for ES8323
- References:
- [PATCH v1 00/10] ASoC: Some issues about loongson i2s
- From: Binbin Zhou
- [PATCH v1 02/10] ASoC: codecs: Add support for ES8323
- From: Binbin Zhou
- Re: [PATCH v1 02/10] ASoC: codecs: Add support for ES8323
- From: Mark Brown
- Re: [PATCH v1 02/10] ASoC: codecs: Add support for ES8323
- From: Binbin Zhou
- [PATCH v1 00/10] ASoC: Some issues about loongson i2s
- Prev by Date: Re: [PATCH v2 6/7] dt-bindings: power: reset: mt6323: merge to MFD mediatek,mt6397 DT schema
- Next by Date: Re: [PATCH 0/5] AMD SoundWire machine driver code refactor
- Previous by thread: Re: [PATCH v1 02/10] ASoC: codecs: Add support for ES8323
- Next by thread: Re: [PATCH v1 02/10] ASoC: codecs: Add support for ES8323
- Index(es):