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

Configure Feed

Select the types of activity you want to include in your feed.

media: i2c: ov9734: 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
56e9e480 19ae6ba5

-46
-46
drivers/media/i2c/ov9734.c
··· 337 337 338 338 /* To serialize asynchronus callbacks */ 339 339 struct mutex mutex; 340 - 341 - /* Streaming on/off */ 342 - bool streaming; 343 340 }; 344 341 345 342 static inline struct ov9734 *to_ov9734(struct v4l2_subdev *subdev) ··· 676 679 pm_runtime_put(&client->dev); 677 680 } 678 681 679 - ov9734->streaming = enable; 680 682 mutex_unlock(&ov9734->mutex); 681 683 682 - return ret; 683 - } 684 - 685 - static int __maybe_unused ov9734_suspend(struct device *dev) 686 - { 687 - struct i2c_client *client = to_i2c_client(dev); 688 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 689 - struct ov9734 *ov9734 = to_ov9734(sd); 690 - 691 - mutex_lock(&ov9734->mutex); 692 - if (ov9734->streaming) 693 - ov9734_stop_streaming(ov9734); 694 - 695 - mutex_unlock(&ov9734->mutex); 696 - 697 - return 0; 698 - } 699 - 700 - static int __maybe_unused ov9734_resume(struct device *dev) 701 - { 702 - struct i2c_client *client = to_i2c_client(dev); 703 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 704 - struct ov9734 *ov9734 = to_ov9734(sd); 705 - int ret = 0; 706 - 707 - mutex_lock(&ov9734->mutex); 708 - if (!ov9734->streaming) 709 - goto exit; 710 - 711 - ret = ov9734_start_streaming(ov9734); 712 - if (ret) { 713 - ov9734->streaming = false; 714 - ov9734_stop_streaming(ov9734); 715 - } 716 - 717 - exit: 718 - mutex_unlock(&ov9734->mutex); 719 684 return ret; 720 685 } 721 686 ··· 966 1007 return ret; 967 1008 } 968 1009 969 - static const struct dev_pm_ops ov9734_pm_ops = { 970 - SET_SYSTEM_SLEEP_PM_OPS(ov9734_suspend, ov9734_resume) 971 - }; 972 - 973 1010 static const struct acpi_device_id ov9734_acpi_ids[] = { 974 1011 { "OVTI9734", }, 975 1012 {} ··· 976 1021 static struct i2c_driver ov9734_i2c_driver = { 977 1022 .driver = { 978 1023 .name = "ov9734", 979 - .pm = &ov9734_pm_ops, 980 1024 .acpi_match_table = ov9734_acpi_ids, 981 1025 }, 982 1026 .probe = ov9734_probe,