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

media: i2c: ov01a10: 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
6f40f7ca b477adeb

+3 -54
+3 -54
drivers/media/i2c/ov01a10.c
··· 287 287 struct v4l2_ctrl *exposure; 288 288 289 289 const struct ov01a10_mode *cur_mode; 290 - 291 - /* streaming state */ 292 - bool streaming; 293 290 }; 294 291 295 292 static inline struct ov01a10 *to_ov01a10(struct v4l2_subdev *subdev) ··· 680 683 pm_runtime_put(&client->dev); 681 684 goto unlock; 682 685 } 683 - 684 - goto done; 686 + } else { 687 + ov01a10_stop_streaming(ov01a10); 688 + pm_runtime_put(&client->dev); 685 689 } 686 690 687 - ov01a10_stop_streaming(ov01a10); 688 - pm_runtime_put(&client->dev); 689 - done: 690 - ov01a10->streaming = enable; 691 691 unlock: 692 - v4l2_subdev_unlock_state(state); 693 - 694 - return ret; 695 - } 696 - 697 - static int __maybe_unused ov01a10_suspend(struct device *dev) 698 - { 699 - struct i2c_client *client = to_i2c_client(dev); 700 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 701 - struct ov01a10 *ov01a10 = to_ov01a10(sd); 702 - struct v4l2_subdev_state *state; 703 - 704 - state = v4l2_subdev_lock_and_get_active_state(sd); 705 - if (ov01a10->streaming) 706 - ov01a10_stop_streaming(ov01a10); 707 - 708 - v4l2_subdev_unlock_state(state); 709 - 710 - return 0; 711 - } 712 - 713 - static int __maybe_unused ov01a10_resume(struct device *dev) 714 - { 715 - struct i2c_client *client = to_i2c_client(dev); 716 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 717 - struct ov01a10 *ov01a10 = to_ov01a10(sd); 718 - struct v4l2_subdev_state *state; 719 - int ret = 0; 720 - 721 - state = v4l2_subdev_lock_and_get_active_state(sd); 722 - if (!ov01a10->streaming) 723 - goto exit; 724 - 725 - ret = ov01a10_start_streaming(ov01a10); 726 - if (ret) { 727 - ov01a10->streaming = false; 728 - ov01a10_stop_streaming(ov01a10); 729 - } 730 - 731 - exit: 732 692 v4l2_subdev_unlock_state(state); 733 693 734 694 return ret; ··· 925 971 return ret; 926 972 } 927 973 928 - static const struct dev_pm_ops ov01a10_pm_ops = { 929 - SET_SYSTEM_SLEEP_PM_OPS(ov01a10_suspend, ov01a10_resume) 930 - }; 931 - 932 974 #ifdef CONFIG_ACPI 933 975 static const struct acpi_device_id ov01a10_acpi_ids[] = { 934 976 { "OVTI01A0" }, ··· 937 987 static struct i2c_driver ov01a10_i2c_driver = { 938 988 .driver = { 939 989 .name = "ov01a10", 940 - .pm = &ov01a10_pm_ops, 941 990 .acpi_match_table = ACPI_PTR(ov01a10_acpi_ids), 942 991 }, 943 992 .probe = ov01a10_probe,