Re: [PATCH v4 3/3] iio: light: Add support for ltrf216a sensor

From: Dmitry Osipenko
Date: Fri May 13 2022 - 13:59:37 EST


13.05.2022 16:40, Shreeya Patel пишет:
> Also, why would we want to do a SW reset here?
>
> In the datasheet, I could see the following steps to enable the sensor
> Supply VDD to Sensor (Sensor in Standby Mode) ---> Wait 100 ms (min) -
> initial startup time
> ---> I2C Command (Write) To enable sensor to Active Mode

For example, if you'll do kexec from other kernel, say downstream
kernel, then the h/w state is undetermined for us. It's a common problem
with downstream drivers that they rely on a specific state left from
bootloader, which is often unacceptable for upstream.

If we'll do the SW reset on probe, then we'll bring h/w into the
predictable state and won't depend on state left from bootloader or
anything else that touched h/w before us.