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

media: i2c: imx319: 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
4c9e4ea4 e1124ace

-40
-40
drivers/media/i2c/imx319.c
··· 138 138 */ 139 139 struct mutex mutex; 140 140 141 - /* Streaming on/off */ 142 - bool streaming; 143 141 /* True if the device has been identified */ 144 142 bool identified; 145 143 }; ··· 2182 2184 pm_runtime_put(&client->dev); 2183 2185 } 2184 2186 2185 - imx319->streaming = enable; 2186 - 2187 2187 /* vflip and hflip cannot change during streaming */ 2188 2188 __v4l2_ctrl_grab(imx319->vflip, enable); 2189 2189 __v4l2_ctrl_grab(imx319->hflip, enable); ··· 2195 2199 err_unlock: 2196 2200 mutex_unlock(&imx319->mutex); 2197 2201 2198 - return ret; 2199 - } 2200 - 2201 - static int __maybe_unused imx319_suspend(struct device *dev) 2202 - { 2203 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 2204 - struct imx319 *imx319 = to_imx319(sd); 2205 - 2206 - if (imx319->streaming) 2207 - imx319_stop_streaming(imx319); 2208 - 2209 - return 0; 2210 - } 2211 - 2212 - static int __maybe_unused imx319_resume(struct device *dev) 2213 - { 2214 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 2215 - struct imx319 *imx319 = to_imx319(sd); 2216 - int ret; 2217 - 2218 - if (imx319->streaming) { 2219 - ret = imx319_start_streaming(imx319); 2220 - if (ret) 2221 - goto error; 2222 - } 2223 - 2224 - return 0; 2225 - 2226 - error: 2227 - imx319_stop_streaming(imx319); 2228 - imx319->streaming = 0; 2229 2202 return ret; 2230 2203 } 2231 2204 ··· 2503 2538 mutex_destroy(&imx319->mutex); 2504 2539 } 2505 2540 2506 - static const struct dev_pm_ops imx319_pm_ops = { 2507 - SET_SYSTEM_SLEEP_PM_OPS(imx319_suspend, imx319_resume) 2508 - }; 2509 - 2510 2541 static const struct acpi_device_id imx319_acpi_ids[] __maybe_unused = { 2511 2542 { "SONY319A" }, 2512 2543 { /* sentinel */ } ··· 2512 2551 static struct i2c_driver imx319_i2c_driver = { 2513 2552 .driver = { 2514 2553 .name = "imx319", 2515 - .pm = &imx319_pm_ops, 2516 2554 .acpi_match_table = ACPI_PTR(imx319_acpi_ids), 2517 2555 }, 2518 2556 .probe = imx319_probe,