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

media: i2c: hi847: 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
35e663b4 2223243c

-52
-52
drivers/media/i2c/hi847.c
··· 2184 2184 2185 2185 /* To serialize asynchronus callbacks */ 2186 2186 struct mutex mutex; 2187 - 2188 - /* Streaming on/off */ 2189 - bool streaming; 2190 2187 }; 2191 2188 2192 2189 static u64 to_pixel_rate(u32 f_index) ··· 2615 2618 struct i2c_client *client = v4l2_get_subdevdata(sd); 2616 2619 int ret = 0; 2617 2620 2618 - if (hi847->streaming == enable) 2619 - return 0; 2620 - 2621 2621 mutex_lock(&hi847->mutex); 2622 2622 if (enable) { 2623 2623 ret = pm_runtime_resume_and_get(&client->dev); ··· 2634 2640 pm_runtime_put(&client->dev); 2635 2641 } 2636 2642 2637 - hi847->streaming = enable; 2638 2643 mutex_unlock(&hi847->mutex); 2639 2644 2640 - return ret; 2641 - } 2642 - 2643 - static int __maybe_unused hi847_suspend(struct device *dev) 2644 - { 2645 - struct i2c_client *client = to_i2c_client(dev); 2646 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 2647 - struct hi847 *hi847 = to_hi847(sd); 2648 - 2649 - mutex_lock(&hi847->mutex); 2650 - if (hi847->streaming) 2651 - hi847_stop_streaming(hi847); 2652 - 2653 - mutex_unlock(&hi847->mutex); 2654 - 2655 - return 0; 2656 - } 2657 - 2658 - static int __maybe_unused hi847_resume(struct device *dev) 2659 - { 2660 - struct i2c_client *client = to_i2c_client(dev); 2661 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 2662 - struct hi847 *hi847 = to_hi847(sd); 2663 - int ret; 2664 - 2665 - mutex_lock(&hi847->mutex); 2666 - if (hi847->streaming) { 2667 - ret = hi847_start_streaming(hi847); 2668 - if (ret) 2669 - goto error; 2670 - } 2671 - 2672 - mutex_unlock(&hi847->mutex); 2673 - 2674 - return 0; 2675 - 2676 - error: 2677 - hi847_stop_streaming(hi847); 2678 - hi847->streaming = 0; 2679 - mutex_unlock(&hi847->mutex); 2680 2645 return ret; 2681 2646 } 2682 2647 ··· 2932 2979 return ret; 2933 2980 } 2934 2981 2935 - static const struct dev_pm_ops hi847_pm_ops = { 2936 - SET_SYSTEM_SLEEP_PM_OPS(hi847_suspend, hi847_resume) 2937 - }; 2938 - 2939 2982 #ifdef CONFIG_ACPI 2940 2983 static const struct acpi_device_id hi847_acpi_ids[] = { 2941 2984 {"HYV0847"}, ··· 2944 2995 static struct i2c_driver hi847_i2c_driver = { 2945 2996 .driver = { 2946 2997 .name = "hi847", 2947 - .pm = &hi847_pm_ops, 2948 2998 .acpi_match_table = ACPI_PTR(hi847_acpi_ids), 2949 2999 }, 2950 3000 .probe = hi847_probe,