Re: [PATCH 5/7] regulator: sy7636a: report the temperature

From: Andreas Kemnade

Date: Tue Oct 27 2026 - 05:19:12 EST


On Tue, 27 Oct 2026 07:32:14 +0000
Pablo Mazzini <pmazzini@xxxxxxxxx> wrote:

> Hi Guenter, Andreas,
>
> On Mon, Oct 26, 2026 at 07:35:24AM -0700, Guenter Roeck wrote:
> > This is going the wrong way. The correct solution would be to convert
> > the hwmon driver to an auxiliary driver.
>
> Understood. In v2 the hwmon driver stays in drivers/hwmon and becomes an
> auxiliary driver of the regulator, which binds the I2C device directly.
>
But that is a cleanup action, which is at least a separate patch (maybe
replacing and exending your patch 6). So the other patches can go into
their separate trees.

> On Tue, 27 Oct 2026 00:26:35 +0100, Andreas Kemnade wrote:
> > But it introduces another race condition.
> > The temperature might be read too early.
> > 1ms delay should suffice.
> >
> > The SY7636A_OPERATION_MODE_CRL_ONOFF flag might be reset before
> > reading the temperature. If that register does not reset to zero
> > but just keeps the temperature last read, then we have no problem.
>
> Good points. For v2 I read power good (0x07) and the temperature (0x08)
> in one I2C transfer, and return -ENODATA unless power good is set, so no
> locking is needed.
>
From the data sheet we can ensure that power good occurs guaranteed after
the first sampling, so this approach is fine for the most common
use case. It reduces the time window with readable temperature
a bit more than needed, but that should not matter.

Regards,
Andreas