[media] V4L2: soc-camera: work around unbalanced calls to .s_power()
[deliverable/linux.git] / include / media / soc_camera.h
index 2bb418346b1f606b2546695cebc142e1615ae910..865246b001279ec611b5c7c8b3d23b194217d6f1 100644 (file)
@@ -146,6 +146,15 @@ struct soc_camera_subdev_desc {
        /* sensor driver private platform data */
        void *drv_priv;
 
+       /*
+        * Set unbalanced_power to true to deal with legacy drivers, failing to
+        * balance their calls to subdevice's .s_power() method. clock_state is
+        * then used internally by helper functions, it shouldn't be touched by
+        * drivers or the platform code.
+        */
+       bool unbalanced_power;
+       unsigned long clock_state;
+
        /* Optional callbacks to power on or off and reset the sensor */
        int (*power)(struct device *, int);
        int (*reset)(struct device *);
@@ -201,6 +210,11 @@ struct soc_camera_link {
 
        void *priv;
 
+       /* Set by platforms to handle misbehaving drivers */
+       bool unbalanced_power;
+       /* Used by soc-camera helper functions */
+       unsigned long clock_state;
+
        /* Optional callbacks to power on or off and reset the sensor */
        int (*power)(struct device *, int);
        int (*reset)(struct device *);
This page took 0.027881 seconds and 5 git commands to generate.