Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck...
[linux-drm-fsl-dcu.git] / include / media / soc_camera.h
index 34d2414f2b8c0a6207fb3d4dfe2c34d644f7d6aa..865246b001279ec611b5c7c8b3d23b194217d6f1 100644 (file)
@@ -146,9 +146,14 @@ struct soc_camera_subdev_desc {
        /* sensor driver private platform data */
        void *drv_priv;
 
-       /* Optional regulators that have to be managed on power on/off events */
-       struct regulator_bulk_data *regulators;
-       int num_regulators;
+       /*
+        * 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);
@@ -162,6 +167,9 @@ struct soc_camera_subdev_desc {
        int (*set_bus_param)(struct soc_camera_subdev_desc *, unsigned long flags);
        unsigned long (*query_bus_param)(struct soc_camera_subdev_desc *);
        void (*free_bus)(struct soc_camera_subdev_desc *);
+
+       /* Optional regulators that have to be managed on power on/off events */
+       struct v4l2_subdev_platform_data sd_pdata;
 };
 
 struct soc_camera_host_desc {
@@ -202,9 +210,10 @@ struct soc_camera_link {
 
        void *priv;
 
-       /* Optional regulators that have to be managed on power on/off events */
-       struct regulator_bulk_data *regulators;
-       int num_regulators;
+       /* 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);
@@ -218,6 +227,12 @@ struct soc_camera_link {
        unsigned long (*query_bus_param)(struct soc_camera_link *);
        void (*free_bus)(struct soc_camera_link *);
 
+       /* Optional regulators that have to be managed on power on/off events */
+       struct regulator_bulk_data *regulators;
+       int num_regulators;
+
+       void *host_priv;
+
        /*
         * Host part - keep at bottom and compatible to
         * struct soc_camera_host_desc