Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: hi846: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

Now that the runtime PM operations are not called from the system PM
handlers, the sensor is guaranteed not to be streaming when the runtime
PM resume handler is called, and to have been stopped already when the
runtime PM suspend handler is called. Drop the manual stream start/stop
from the runtime PM handlers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Laurent Pinchart and committed by
Hans Verkuil
2223243c 5d821eb2

+1 -24
+1 -24
drivers/media/i2c/hi846.c
··· 1675 1675 struct v4l2_subdev *sd = i2c_get_clientdata(client); 1676 1676 struct hi846 *hi846 = to_hi846(sd); 1677 1677 1678 - if (hi846->streaming) 1679 - hi846_stop_streaming(hi846); 1680 - 1681 1678 return hi846_power_off(hi846); 1682 1679 } 1683 1680 ··· 1683 1686 struct i2c_client *client = to_i2c_client(dev); 1684 1687 struct v4l2_subdev *sd = i2c_get_clientdata(client); 1685 1688 struct hi846 *hi846 = to_hi846(sd); 1686 - int ret; 1687 1689 1688 - ret = hi846_power_on(hi846); 1689 - if (ret) 1690 - return ret; 1691 - 1692 - if (hi846->streaming) { 1693 - ret = hi846_start_streaming(hi846); 1694 - if (ret) { 1695 - dev_err(dev, "%s: start streaming failed: %d\n", 1696 - __func__, ret); 1697 - goto error; 1698 - } 1699 - } 1700 - 1701 - return 0; 1702 - 1703 - error: 1704 - hi846_power_off(hi846); 1705 - return ret; 1690 + return hi846_power_on(hi846); 1706 1691 } 1707 1692 1708 1693 static int hi846_set_format(struct v4l2_subdev *sd, ··· 2147 2168 } 2148 2169 2149 2170 static const struct dev_pm_ops hi846_pm_ops = { 2150 - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 2151 - pm_runtime_force_resume) 2152 2171 SET_RUNTIME_PM_OPS(hi846_suspend, hi846_resume, NULL) 2153 2172 }; 2154 2173