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

media: i2c: imx355: 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
96608f4f 4c9e4ea4

-41
-41
drivers/media/i2c/imx355.c
··· 123 123 * Protect access to sensor v4l2 controls. 124 124 */ 125 125 struct mutex mutex; 126 - 127 - /* Streaming on/off */ 128 - bool streaming; 129 126 }; 130 127 131 128 static const struct imx355_reg imx355_global_regs[] = { ··· 1451 1454 pm_runtime_put(&client->dev); 1452 1455 } 1453 1456 1454 - imx355->streaming = enable; 1455 - 1456 1457 /* vflip and hflip cannot change during streaming */ 1457 1458 __v4l2_ctrl_grab(imx355->vflip, enable); 1458 1459 __v4l2_ctrl_grab(imx355->hflip, enable); ··· 1464 1469 err_unlock: 1465 1470 mutex_unlock(&imx355->mutex); 1466 1471 1467 - return ret; 1468 - } 1469 - 1470 - static int __maybe_unused imx355_suspend(struct device *dev) 1471 - { 1472 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 1473 - struct imx355 *imx355 = to_imx355(sd); 1474 - 1475 - if (imx355->streaming) 1476 - imx355_stop_streaming(imx355); 1477 - 1478 - return 0; 1479 - } 1480 - 1481 - static int __maybe_unused imx355_resume(struct device *dev) 1482 - { 1483 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 1484 - struct imx355 *imx355 = to_imx355(sd); 1485 - int ret; 1486 - 1487 - if (imx355->streaming) { 1488 - ret = imx355_start_streaming(imx355); 1489 - if (ret) 1490 - goto error; 1491 - } 1492 - 1493 - return 0; 1494 - 1495 - error: 1496 - imx355_stop_streaming(imx355); 1497 - imx355->streaming = 0; 1498 1472 return ret; 1499 1473 } 1500 1474 ··· 1789 1825 mutex_destroy(&imx355->mutex); 1790 1826 } 1791 1827 1792 - static const struct dev_pm_ops imx355_pm_ops = { 1793 - SET_SYSTEM_SLEEP_PM_OPS(imx355_suspend, imx355_resume) 1794 - }; 1795 - 1796 1828 static const struct acpi_device_id imx355_acpi_ids[] __maybe_unused = { 1797 1829 { "SONY355A" }, 1798 1830 { /* sentinel */ } ··· 1798 1838 static struct i2c_driver imx355_i2c_driver = { 1799 1839 .driver = { 1800 1840 .name = "imx355", 1801 - .pm = &imx355_pm_ops, 1802 1841 .acpi_match_table = ACPI_PTR(imx355_acpi_ids), 1803 1842 }, 1804 1843 .probe = imx355_probe,