aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 10:28:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:18:27 -0400
commit40e2e0927003424c25807b575dd40da2b8685857 (patch)
tree917ca8fd5f7598194d264ec92a08b312d4932b90 /include/media
parentbc1937b41d8253e2b554da385023a92189d38917 (diff)
V4L/DVB (12506): soc-camera: convert to platform device
Convert soc-camera core and all drivers to platform device API. We already converted platforms to register a platform device for each soc-camera client, now we remove the compatibility code and switch completely to the new scheme. This is a preparatory step for the v4l2-subdev conversion. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/soc_camera.h27
-rw-r--r--include/media/soc_camera_platform.h3
2 files changed, 17 insertions, 13 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 813e12061daa..d8b4256126a4 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -20,7 +20,6 @@
20struct soc_camera_device { 20struct soc_camera_device {
21 struct list_head list; 21 struct list_head list;
22 struct device dev; 22 struct device dev;
23 struct device *control;
24 unsigned short width; /* Current window */ 23 unsigned short width; /* Current window */
25 unsigned short height; /* sizes */ 24 unsigned short height; /* sizes */
26 unsigned short x_min; /* Camera capabilities */ 25 unsigned short x_min; /* Camera capabilities */
@@ -131,17 +130,25 @@ static inline struct soc_camera_host *to_soc_camera_host(struct device *dev)
131 return dev_get_drvdata(dev); 130 return dev_get_drvdata(dev);
132} 131}
133 132
134extern int soc_camera_host_register(struct soc_camera_host *ici); 133static inline struct soc_camera_link *to_soc_camera_link(struct soc_camera_device *icd)
135extern void soc_camera_host_unregister(struct soc_camera_host *ici); 134{
136extern int soc_camera_device_register(struct soc_camera_device *icd); 135 return icd->dev.platform_data;
137extern void soc_camera_device_unregister(struct soc_camera_device *icd); 136}
138 137
139extern int soc_camera_video_start(struct soc_camera_device *icd); 138static inline struct device *to_soc_camera_control(struct soc_camera_device *icd)
140extern void soc_camera_video_stop(struct soc_camera_device *icd); 139{
140 return dev_get_drvdata(&icd->dev);
141}
141 142
142extern const struct soc_camera_data_format *soc_camera_format_by_fourcc( 143int soc_camera_host_register(struct soc_camera_host *ici);
144void soc_camera_host_unregister(struct soc_camera_host *ici);
145
146int soc_camera_video_start(struct soc_camera_device *icd, struct device *dev);
147void soc_camera_video_stop(struct soc_camera_device *icd);
148
149const struct soc_camera_data_format *soc_camera_format_by_fourcc(
143 struct soc_camera_device *icd, unsigned int fourcc); 150 struct soc_camera_device *icd, unsigned int fourcc);
144extern const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc( 151const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc(
145 struct soc_camera_device *icd, unsigned int fourcc); 152 struct soc_camera_device *icd, unsigned int fourcc);
146 153
147struct soc_camera_data_format { 154struct soc_camera_data_format {
@@ -170,8 +177,6 @@ struct soc_camera_format_xlate {
170 177
171struct soc_camera_ops { 178struct soc_camera_ops {
172 struct module *owner; 179 struct module *owner;
173 int (*probe)(struct soc_camera_device *);
174 void (*remove)(struct soc_camera_device *);
175 int (*suspend)(struct soc_camera_device *, pm_message_t state); 180 int (*suspend)(struct soc_camera_device *, pm_message_t state);
176 int (*resume)(struct soc_camera_device *); 181 int (*resume)(struct soc_camera_device *);
177 int (*init)(struct soc_camera_device *); 182 int (*init)(struct soc_camera_device *);
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 3e8f020abf48..b144f947f1cb 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -18,11 +18,10 @@ struct device;
18 18
19struct soc_camera_platform_info { 19struct soc_camera_platform_info {
20 int iface; 20 int iface;
21 char *format_name; 21 const char *format_name;
22 unsigned long format_depth; 22 unsigned long format_depth;
23 struct v4l2_pix_format format; 23 struct v4l2_pix_format format;
24 unsigned long bus_param; 24 unsigned long bus_param;
25 void (*power)(int);
26 struct device *dev; 25 struct device *dev;
27 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 26 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
28 struct soc_camera_link link; 27 struct soc_camera_link link;