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

media: i2c: imx208: 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
c628b64d 35e663b4

-43
-43
drivers/media/i2c/imx208.c
··· 290 290 */ 291 291 struct mutex imx208_mx; 292 292 293 - /* Streaming on/off */ 294 - bool streaming; 295 - 296 293 /* OTP data */ 297 294 bool otp_read; 298 295 char otp_data[IMX208_OTP_SIZE]; ··· 731 734 pm_runtime_put(&client->dev); 732 735 } 733 736 734 - imx208->streaming = enable; 735 737 mutex_unlock(&imx208->imx208_mx); 736 738 737 739 /* vflip and hflip cannot change during streaming */ ··· 742 746 err_rpm_put: 743 747 pm_runtime_put(&client->dev); 744 748 mutex_unlock(&imx208->imx208_mx); 745 - 746 - return ret; 747 - } 748 - 749 - static int __maybe_unused imx208_suspend(struct device *dev) 750 - { 751 - struct i2c_client *client = to_i2c_client(dev); 752 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 753 - struct imx208 *imx208 = to_imx208(sd); 754 - 755 - if (imx208->streaming) 756 - imx208_stop_streaming(imx208); 757 - 758 - return 0; 759 - } 760 - 761 - static int __maybe_unused imx208_resume(struct device *dev) 762 - { 763 - struct i2c_client *client = to_i2c_client(dev); 764 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 765 - struct imx208 *imx208 = to_imx208(sd); 766 - int ret; 767 - 768 - if (imx208->streaming) { 769 - ret = imx208_start_streaming(imx208); 770 - if (ret) 771 - goto error; 772 - } 773 - 774 - return 0; 775 - 776 - error: 777 - imx208_stop_streaming(imx208); 778 - imx208->streaming = 0; 779 749 780 750 return ret; 781 751 } ··· 1039 1077 mutex_destroy(&imx208->imx208_mx); 1040 1078 } 1041 1079 1042 - static const struct dev_pm_ops imx208_pm_ops = { 1043 - SET_SYSTEM_SLEEP_PM_OPS(imx208_suspend, imx208_resume) 1044 - }; 1045 - 1046 1080 #ifdef CONFIG_ACPI 1047 1081 static const struct acpi_device_id imx208_acpi_ids[] = { 1048 1082 { "INT3478" }, ··· 1051 1093 static struct i2c_driver imx208_i2c_driver = { 1052 1094 .driver = { 1053 1095 .name = "imx208", 1054 - .pm = &imx208_pm_ops, 1055 1096 .acpi_match_table = ACPI_PTR(imx208_acpi_ids), 1056 1097 }, 1057 1098 .probe = imx208_probe,