media: i2c: power off the device in remove()
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest16 patches 0 repliesNew
Patches in v2 No applies recorded yet
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/16] media: i2c: power off the device in remove()
Several media/i2c drivers disable runtime PM in remove() without running the runtime suspend callback. pm_runtime_disable() does not do that, so a device that is still runtime active when the driver is unbound can stay
powered: its supplies and clock stay enabled and its reset or power-down lines stay released. ov5670 and ov8856 go the other way and power the device off unconditionally, which disables the regulators and the clock a second time in the usual case where the device is already suspended.
Each fix follows the pattern ov5647, og01a1b and imx412 already use: after pm_runtime_disable(), power the device off if it is not runtime suspended, and set the runtime PM status to suspended.
This replaces the individual patches I sent earlier for hi556, ak7375, ov13b10, ov2740 and ov5670. ov8856, ov5648, ov8865, tw9900, isl7998x and tc358746 are new.
Changes since the individual patches:
- Sent as one series, as Sakari asked. Where remove() is defined before the PM callbacks, moving it is a separate patch with no functional change.
- remove() now also sets the runtime PM status to suspended.
- The commit messages are rewritten.
- ov5647 and og01a1b are dropped: Guangshuo Li's fixes for them are already in.
- ak7375: the earlier patch called the suspend callback after ak7375_subdev_cleanup(), but the callback reads the focus control that the cleanup frees. It is now called before the cleanup.
Cong Nguyen (16):
media: i2c: hi556: move remove() after the PM callbacks
media: i2c: hi556: power off the sensor on remove
media: i2c: ov2740: move remove() after the PM callbacks
media: i2c: ov2740: power off the sensor on remove
media: i2c: ak7375: move remove() after the PM callbacks
media: i2c: ak7375: power off the lens driver on remove
media: i2c: ov13b10: power off the sensor on remove
media: i2c: ov5670: do not power off twice on remove
media: i2c: ov8856: do not power off twice on remove
media: i2c: ov5648: power off the sensor on remove
media: i2c: ov8865: power off the sensor on remove
media: i2c: tw9900: power off the decoder on remove
media: i2c: isl7998x: move remove() after the PM callbacks
media: i2c: isl7998x: power down the decoder on remove
media: i2c: tc358746: move remove() after the PM callbacks
media: i2c: tc358746: power off the bridge on remove
drivers/media/i2c/ak7375.c | 22 +++++++++++--------- drivers/media/i2c/hi556.c | 28 +++++++++++++++----------- drivers/media/i2c/isl7998x.c | 24 +++++++++++++--------- drivers/media/i2c/ov13b10.c | 5 ++++- drivers/media/i2c/ov2740.c | 26 ++++++++++++++---------- drivers/media/i2c/ov5648.c | 4 ++++ drivers/media/i2c/ov5670.c | 5 ++++- drivers/media/i2c/ov8856.c | 5 ++++- drivers/media/i2c/ov8865.c | 4 ++++ drivers/media/i2c/tc358746.c | 39 +++++++++++++++++++----------------- drivers/media/i2c/tw9900.c | 4 ++++ 11 files changed, 102 insertions(+), 64 deletions(-)
Signature · 1 line
2.25.1