aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-07-15 19:03:38 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:08 -0400
commit7dfff95366f48bf66f77c17cdc9ebd8be696ac5d (patch)
treec4cb975f5b8b8c3008921d38fa6e4deed9c8dbc9 /include/media
parentd33b290a149dafe2e3cc2901ec726bea09a2c0f4 (diff)
[media] V4L: soc-camera: remove soc-camera bus and devices on it
Now that v4l2 subdevices have got their own device objects, having one more device in soc-camera clients became redundant and confusing. This patch removes those devices and the soc-camera bus, they used to reside on. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/soc_camera.h19
-rw-r--r--include/media/soc_camera_platform.h15
2 files changed, 15 insertions, 19 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index c31d55be3e17..7582952dceae 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -21,11 +21,14 @@
21#include <media/v4l2-device.h> 21#include <media/v4l2-device.h>
22 22
23struct file; 23struct file;
24struct soc_camera_link;
24 25
25struct soc_camera_device { 26struct soc_camera_device {
26 struct list_head list; /* list of all registered devices */ 27 struct list_head list; /* list of all registered devices */
27 struct device dev; 28 struct soc_camera_link *link;
28 struct device *pdev; /* Platform device */ 29 struct device *pdev; /* Platform device */
30 struct device *parent; /* Camera host device */
31 struct device *control; /* E.g., the i2c client */
29 s32 user_width; 32 s32 user_width;
30 s32 user_height; 33 s32 user_height;
31 u32 bytesperline; /* for padding, zero if unused */ 34 u32 bytesperline; /* for padding, zero if unused */
@@ -127,8 +130,8 @@ struct soc_camera_link {
127 * For non-I2C devices platform has to provide methods to add a device 130 * For non-I2C devices platform has to provide methods to add a device
128 * to the system and to remove it 131 * to the system and to remove it
129 */ 132 */
130 int (*add_device)(struct soc_camera_link *, struct device *); 133 int (*add_device)(struct soc_camera_device *);
131 void (*del_device)(struct soc_camera_link *); 134 void (*del_device)(struct soc_camera_device *);
132 /* Optional callbacks to power on or off and reset the sensor */ 135 /* Optional callbacks to power on or off and reset the sensor */
133 int (*power)(struct device *, int); 136 int (*power)(struct device *, int);
134 int (*reset)(struct device *); 137 int (*reset)(struct device *);
@@ -142,12 +145,6 @@ struct soc_camera_link {
142 void (*free_bus)(struct soc_camera_link *); 145 void (*free_bus)(struct soc_camera_link *);
143}; 146};
144 147
145static inline struct soc_camera_device *to_soc_camera_dev(
146 const struct device *dev)
147{
148 return container_of(dev, struct soc_camera_device, dev);
149}
150
151static inline struct soc_camera_host *to_soc_camera_host( 148static inline struct soc_camera_host *to_soc_camera_host(
152 const struct device *dev) 149 const struct device *dev)
153{ 150{
@@ -159,13 +156,13 @@ static inline struct soc_camera_host *to_soc_camera_host(
159static inline struct soc_camera_link *to_soc_camera_link( 156static inline struct soc_camera_link *to_soc_camera_link(
160 const struct soc_camera_device *icd) 157 const struct soc_camera_device *icd)
161{ 158{
162 return icd->dev.platform_data; 159 return icd->link;
163} 160}
164 161
165static inline struct device *to_soc_camera_control( 162static inline struct device *to_soc_camera_control(
166 const struct soc_camera_device *icd) 163 const struct soc_camera_device *icd)
167{ 164{
168 return dev_get_drvdata(&icd->dev); 165 return icd->control;
169} 166}
170 167
171static inline struct v4l2_subdev *soc_camera_to_subdev( 168static inline struct v4l2_subdev *soc_camera_to_subdev(
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 6d7a4fd00fc0..74f0fa15ca47 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -21,7 +21,7 @@ struct soc_camera_platform_info {
21 unsigned long format_depth; 21 unsigned long format_depth;
22 struct v4l2_mbus_framefmt format; 22 struct v4l2_mbus_framefmt format;
23 unsigned long bus_param; 23 unsigned long bus_param;
24 struct device *dev; 24 struct soc_camera_device *icd;
25 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 25 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
26}; 26};
27 27
@@ -30,8 +30,7 @@ static inline void soc_camera_platform_release(struct platform_device **pdev)
30 *pdev = NULL; 30 *pdev = NULL;
31} 31}
32 32
33static inline int soc_camera_platform_add(const struct soc_camera_link *icl, 33static inline int soc_camera_platform_add(struct soc_camera_device *icd,
34 struct device *dev,
35 struct platform_device **pdev, 34 struct platform_device **pdev,
36 struct soc_camera_link *plink, 35 struct soc_camera_link *plink,
37 void (*release)(struct device *dev), 36 void (*release)(struct device *dev),
@@ -40,7 +39,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
40 struct soc_camera_platform_info *info = plink->priv; 39 struct soc_camera_platform_info *info = plink->priv;
41 int ret; 40 int ret;
42 41
43 if (icl != plink) 42 if (icd->link != plink)
44 return -ENODEV; 43 return -ENODEV;
45 44
46 if (*pdev) 45 if (*pdev)
@@ -50,7 +49,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
50 if (!*pdev) 49 if (!*pdev)
51 return -ENOMEM; 50 return -ENOMEM;
52 51
53 info->dev = dev; 52 info->icd = icd;
54 53
55 (*pdev)->dev.platform_data = info; 54 (*pdev)->dev.platform_data = info;
56 (*pdev)->dev.release = release; 55 (*pdev)->dev.release = release;
@@ -59,17 +58,17 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
59 if (ret < 0) { 58 if (ret < 0) {
60 platform_device_put(*pdev); 59 platform_device_put(*pdev);
61 *pdev = NULL; 60 *pdev = NULL;
62 info->dev = NULL; 61 info->icd = NULL;
63 } 62 }
64 63
65 return ret; 64 return ret;
66} 65}
67 66
68static inline void soc_camera_platform_del(const struct soc_camera_link *icl, 67static inline void soc_camera_platform_del(const struct soc_camera_device *icd,
69 struct platform_device *pdev, 68 struct platform_device *pdev,
70 const struct soc_camera_link *plink) 69 const struct soc_camera_link *plink)
71{ 70{
72 if (icl != plink || !pdev) 71 if (icd->link != plink || !pdev)
73 return; 72 return;
74 73
75 platform_device_unregister(pdev); 74 platform_device_unregister(pdev);