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

media: i2c: og01a1b: 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
b477adeb 96608f4f

-47
-47
drivers/media/i2c/og01a1b.c
··· 434 434 435 435 /* To serialize asynchronus callbacks */ 436 436 struct mutex mutex; 437 - 438 - /* Streaming on/off */ 439 - bool streaming; 440 437 }; 441 438 442 439 static u64 to_pixel_rate(u32 f_index) ··· 748 751 pm_runtime_put(&client->dev); 749 752 } 750 753 751 - og01a1b->streaming = enable; 752 754 mutex_unlock(&og01a1b->mutex); 753 755 754 756 return ret; 755 - } 756 - 757 - static int __maybe_unused og01a1b_suspend(struct device *dev) 758 - { 759 - struct i2c_client *client = to_i2c_client(dev); 760 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 761 - struct og01a1b *og01a1b = to_og01a1b(sd); 762 - 763 - mutex_lock(&og01a1b->mutex); 764 - if (og01a1b->streaming) 765 - og01a1b_stop_streaming(og01a1b); 766 - 767 - mutex_unlock(&og01a1b->mutex); 768 - 769 - return 0; 770 - } 771 - 772 - static int __maybe_unused og01a1b_resume(struct device *dev) 773 - { 774 - struct i2c_client *client = to_i2c_client(dev); 775 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 776 - struct og01a1b *og01a1b = to_og01a1b(sd); 777 - int ret; 778 - 779 - mutex_lock(&og01a1b->mutex); 780 - if (og01a1b->streaming) { 781 - ret = og01a1b_start_streaming(og01a1b); 782 - if (ret) { 783 - og01a1b->streaming = false; 784 - og01a1b_stop_streaming(og01a1b); 785 - mutex_unlock(&og01a1b->mutex); 786 - return ret; 787 - } 788 - } 789 - 790 - mutex_unlock(&og01a1b->mutex); 791 - 792 - return 0; 793 757 } 794 758 795 759 static int og01a1b_set_format(struct v4l2_subdev *sd, ··· 1050 1092 return ret; 1051 1093 } 1052 1094 1053 - static const struct dev_pm_ops og01a1b_pm_ops = { 1054 - SET_SYSTEM_SLEEP_PM_OPS(og01a1b_suspend, og01a1b_resume) 1055 - }; 1056 - 1057 1095 #ifdef CONFIG_ACPI 1058 1096 static const struct acpi_device_id og01a1b_acpi_ids[] = { 1059 1097 {"OVTI01AC"}, ··· 1062 1108 static struct i2c_driver og01a1b_i2c_driver = { 1063 1109 .driver = { 1064 1110 .name = "og01a1b", 1065 - .pm = &og01a1b_pm_ops, 1066 1111 .acpi_match_table = ACPI_PTR(og01a1b_acpi_ids), 1067 1112 }, 1068 1113 .probe = og01a1b_probe,