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

media: i2c: ov8856: 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.

The streaming field of the driver's private structure is now unused,
drop it as well.

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
19ae6ba5 046da914

-44
-44
drivers/media/i2c/ov8856.c
··· 1438 1438 /* To serialize asynchronus callbacks */ 1439 1439 struct mutex mutex; 1440 1440 1441 - /* Streaming on/off */ 1442 - bool streaming; 1443 - 1444 1441 /* lanes index */ 1445 1442 u8 nlanes; 1446 1443 ··· 2058 2061 pm_runtime_put(&client->dev); 2059 2062 } 2060 2063 2061 - ov8856->streaming = enable; 2062 2064 mutex_unlock(&ov8856->mutex); 2063 2065 2064 2066 return ret; ··· 2114 2118 regulator_bulk_disable(ARRAY_SIZE(ov8856_supply_names), 2115 2119 ov8856->supplies); 2116 2120 clk_disable_unprepare(ov8856->xvclk); 2117 - 2118 - return 0; 2119 - } 2120 - 2121 - static int __maybe_unused ov8856_suspend(struct device *dev) 2122 - { 2123 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 2124 - struct ov8856 *ov8856 = to_ov8856(sd); 2125 - 2126 - mutex_lock(&ov8856->mutex); 2127 - if (ov8856->streaming) 2128 - ov8856_stop_streaming(ov8856); 2129 - 2130 - ov8856_power_off(dev); 2131 - mutex_unlock(&ov8856->mutex); 2132 - 2133 - return 0; 2134 - } 2135 - 2136 - static int __maybe_unused ov8856_resume(struct device *dev) 2137 - { 2138 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 2139 - struct ov8856 *ov8856 = to_ov8856(sd); 2140 - int ret; 2141 - 2142 - mutex_lock(&ov8856->mutex); 2143 - 2144 - ov8856_power_on(dev); 2145 - if (ov8856->streaming) { 2146 - ret = ov8856_start_streaming(ov8856); 2147 - if (ret) { 2148 - ov8856->streaming = false; 2149 - ov8856_stop_streaming(ov8856); 2150 - mutex_unlock(&ov8856->mutex); 2151 - return ret; 2152 - } 2153 - } 2154 - 2155 - mutex_unlock(&ov8856->mutex); 2156 2121 2157 2122 return 0; 2158 2123 } ··· 2455 2498 } 2456 2499 2457 2500 static const struct dev_pm_ops ov8856_pm_ops = { 2458 - SET_SYSTEM_SLEEP_PM_OPS(ov8856_suspend, ov8856_resume) 2459 2501 SET_RUNTIME_PM_OPS(ov8856_power_off, ov8856_power_on, NULL) 2460 2502 }; 2461 2503