Re: [PATCH] iio: light: veml6040: add suspend/resume support

From: Andy Shevchenko

Date: Wed May 13 2026 - 05:51:49 EST


On Wed, May 13, 2026 at 12:46 PM Stepan Ionichev <sozdayvek@xxxxxxxxx> wrote:
>
> The VEML6040 RGBW light sensor stays in auto-measurement mode at all
> times once probed, drawing its full active current (~200 uA per
> Vishay VEML6040 datasheet, Doc# 84276 Rev. 1.7). On system suspend
> there is no need to keep the sensor running.
>
> Add system sleep PM callbacks that toggle the SD (shutdown) bit in
> CONF register 00H to put the chip into shutdown on suspend and back
> into normal operation on resume. The bit semantics are documented in
> the datasheet Tables 2-1 and 2-2.
>
> The existing veml6040_shutdown_action() is unchanged; it still runs
> on module unload to leave the chip shut down.

We also have regmap_set_bits() and regmap_clear_bits(). This will make
your code shorter and easier to understand.

--
With Best Regards,
Andy Shevchenko