diff options
-rw-r--r-- | drivers/media/video/soc_camera_platform.c | 20 | ||||
-rw-r--r-- | include/media/soc_camera_platform.h | 1 |
2 files changed, 12 insertions, 9 deletions
diff --git a/drivers/media/video/soc_camera_platform.c b/drivers/media/video/soc_camera_platform.c index 1adc257ebdb9..bb7a9d480e8f 100644 --- a/drivers/media/video/soc_camera_platform.c +++ b/drivers/media/video/soc_camera_platform.c | |||
@@ -18,15 +18,7 @@ | |||
18 | #include <linux/videodev2.h> | 18 | #include <linux/videodev2.h> |
19 | #include <media/v4l2-common.h> | 19 | #include <media/v4l2-common.h> |
20 | #include <media/soc_camera.h> | 20 | #include <media/soc_camera.h> |
21 | 21 | #include <media/soc_camera_platform.h> | |
22 | struct soc_camera_platform_info { | ||
23 | int iface; | ||
24 | char *format_name; | ||
25 | unsigned long format_depth; | ||
26 | struct v4l2_pix_format format; | ||
27 | unsigned long bus_param; | ||
28 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); | ||
29 | }; | ||
30 | 22 | ||
31 | struct soc_camera_platform_priv { | 23 | struct soc_camera_platform_priv { |
32 | struct soc_camera_platform_info *info; | 24 | struct soc_camera_platform_info *info; |
@@ -44,11 +36,21 @@ soc_camera_platform_get_info(struct soc_camera_device *icd) | |||
44 | 36 | ||
45 | static int soc_camera_platform_init(struct soc_camera_device *icd) | 37 | static int soc_camera_platform_init(struct soc_camera_device *icd) |
46 | { | 38 | { |
39 | struct soc_camera_platform_info *p = soc_camera_platform_get_info(icd); | ||
40 | |||
41 | if (p->power) | ||
42 | p->power(1); | ||
43 | |||
47 | return 0; | 44 | return 0; |
48 | } | 45 | } |
49 | 46 | ||
50 | static int soc_camera_platform_release(struct soc_camera_device *icd) | 47 | static int soc_camera_platform_release(struct soc_camera_device *icd) |
51 | { | 48 | { |
49 | struct soc_camera_platform_info *p = soc_camera_platform_get_info(icd); | ||
50 | |||
51 | if (p->power) | ||
52 | p->power(0); | ||
53 | |||
52 | return 0; | 54 | return 0; |
53 | } | 55 | } |
54 | 56 | ||
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 851f18220984..7c81ad32b1e5 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
@@ -9,6 +9,7 @@ struct soc_camera_platform_info { | |||
9 | unsigned long format_depth; | 9 | unsigned long format_depth; |
10 | struct v4l2_pix_format format; | 10 | struct v4l2_pix_format format; |
11 | unsigned long bus_param; | 11 | unsigned long bus_param; |
12 | void (*power)(int); | ||
12 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); | 13 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); |
13 | }; | 14 | }; |
14 | 15 | ||