]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: ov08x40: Properly turn sensor on/off when runtime-suspended
authorHans de Goede <hdegoede@redhat.com>
Fri, 20 Dec 2024 14:41:21 +0000 (15:41 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Sat, 15 Feb 2025 14:22:37 +0000 (15:22 +0100)
commit69dea0ed84611b2b83f4f5fb4f5a1ec4b6bc902d
tree3fee48fa2336b9f0200698cf301273f49589b991
parentc8525bd0a714e425b54d19f82bcfc95ea3b8b742
media: ov08x40: Properly turn sensor on/off when runtime-suspended

Commit df1ae2251a50 ("media: ov08x40: Add OF probe support") added support
for a reset GPIO, regulators and a clk provider controlled through new
ov08x40_power_off() and ov08x40_power_on() functions.

But it missed adding a pm ops structure to call these functions on
runtime suspend/resume. Add the missing pm ops and only call
ov08x40_power_off() on remove() when not already runtime-suspended
to avoid unbalanced regulator / clock disable calls.

Fixes: df1ae2251a50 ("media: ov08x40: Add OF probe support")
Cc: stable@vger.kernel.org
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/ov08x40.c