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

From: Stepan Ionichev

Date: Wed May 13 2026 - 10:30:42 EST


On Wed, May 13, 2026 at 19:15, Jonathan Cameron wrote:
> Suspend / resume tend to be a little non trivial to add and datasheets
> are sometimes less than perfect in describing powerdown modes, so can
> I confirm: Do you have one of these that you are testing this with?

Honest disclosure: no, I do not have a VEML6040 board to test with.
The patch was prepared from datasheet inspection only (Vishay Doc#
84276 Rev. 1.7, Tables 2-1 and 2-2) plus the existing in-tree usage
of the same SD bit in veml6040_shutdown_action(). If lack of hardware
testing is a blocker for a PM addition, please drop the patch; I am
OK with that.

> dev_get_drvdata() rather than going in circles. It's get of
> 'implicit' knowledge that works for i2c sequences like this

Noted -- if this stays in scope I will switch to dev_get_drvdata(dev)
in the suspend/resume callbacks.

> Andy pointed out regmap_clear_bits() is handy here and set_bits above.

Yes -- Andy made the same suggestion on v1 and I have a local v2 that
uses regmap_set_bits()/regmap_clear_bits() (and applies the same
simplification to the existing veml6040_shutdown_action() for
consistency). I was going to send it after the 24h wait, but happy
to hold it until the hardware-testing question is settled.

Stepan