Re: [PATCH 2/4] ASoC: codecs: Add support for Richtek rt9123

From: Mark Brown
Date: Mon Apr 07 2025 - 08:34:43 EST


On Mon, Apr 07, 2025 at 08:44:05AM +0800, ChiYuan Huang wrote:
> On Fri, Apr 04, 2025 at 04:03:57PM +0100, Mark Brown wrote:

> > What's going on with the runtime PM stuff here? Especially for the DAPM
> > widget usually the ASoC core will be able to keep devices runtime PM
> > enabled so long as they are in use so I'd expect this not to have any
> > impact. Why not just use a normal DAPM widget?

> That's because The RG 0x01 'RT9123_REG_AMPCTRL' is mixed with other volatile
> status bitfield like as 'SW_RST', 'SYS_STATE'. That's why I use pm_runtime to
> make sure the RG can really be accessed at that time. Actually, the
> mixed RG bitfield for 'RW' and 'RO' is a bad design.

You need some comments explaining what's going on here. If the volatile
fields are read only shouldn't you be OK, so long as the register is not
cached you should be able to do a read modify write fine? Unless the
status bits are clear on read.

Attachment: signature.asc
Description: PGP signature