[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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
d33b290a14
commit
7dfff95366
@@ -21,11 +21,14 @@
|
||||
#include <media/v4l2-device.h>
|
||||
|
||||
struct file;
|
||||
struct soc_camera_link;
|
||||
|
||||
struct soc_camera_device {
|
||||
struct list_head list; /* list of all registered devices */
|
||||
struct device dev;
|
||||
struct soc_camera_link *link;
|
||||
struct device *pdev; /* Platform device */
|
||||
struct device *parent; /* Camera host device */
|
||||
struct device *control; /* E.g., the i2c client */
|
||||
s32 user_width;
|
||||
s32 user_height;
|
||||
u32 bytesperline; /* for padding, zero if unused */
|
||||
@@ -127,8 +130,8 @@ struct soc_camera_link {
|
||||
* For non-I2C devices platform has to provide methods to add a device
|
||||
* to the system and to remove it
|
||||
*/
|
||||
int (*add_device)(struct soc_camera_link *, struct device *);
|
||||
void (*del_device)(struct soc_camera_link *);
|
||||
int (*add_device)(struct soc_camera_device *);
|
||||
void (*del_device)(struct soc_camera_device *);
|
||||
/* Optional callbacks to power on or off and reset the sensor */
|
||||
int (*power)(struct device *, int);
|
||||
int (*reset)(struct device *);
|
||||
@@ -142,12 +145,6 @@ struct soc_camera_link {
|
||||
void (*free_bus)(struct soc_camera_link *);
|
||||
};
|
||||
|
||||
static inline struct soc_camera_device *to_soc_camera_dev(
|
||||
const struct device *dev)
|
||||
{
|
||||
return container_of(dev, struct soc_camera_device, dev);
|
||||
}
|
||||
|
||||
static inline struct soc_camera_host *to_soc_camera_host(
|
||||
const struct device *dev)
|
||||
{
|
||||
@@ -159,13 +156,13 @@ static inline struct soc_camera_host *to_soc_camera_host(
|
||||
static inline struct soc_camera_link *to_soc_camera_link(
|
||||
const struct soc_camera_device *icd)
|
||||
{
|
||||
return icd->dev.platform_data;
|
||||
return icd->link;
|
||||
}
|
||||
|
||||
static inline struct device *to_soc_camera_control(
|
||||
const struct soc_camera_device *icd)
|
||||
{
|
||||
return dev_get_drvdata(&icd->dev);
|
||||
return icd->control;
|
||||
}
|
||||
|
||||
static inline struct v4l2_subdev *soc_camera_to_subdev(
|
||||
|
||||
@@ -21,7 +21,7 @@ struct soc_camera_platform_info {
|
||||
unsigned long format_depth;
|
||||
struct v4l2_mbus_framefmt format;
|
||||
unsigned long bus_param;
|
||||
struct device *dev;
|
||||
struct soc_camera_device *icd;
|
||||
int (*set_capture)(struct soc_camera_platform_info *info, int enable);
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ static inline void soc_camera_platform_release(struct platform_device **pdev)
|
||||
*pdev = NULL;
|
||||
}
|
||||
|
||||
static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
|
||||
struct device *dev,
|
||||
static inline int soc_camera_platform_add(struct soc_camera_device *icd,
|
||||
struct platform_device **pdev,
|
||||
struct soc_camera_link *plink,
|
||||
void (*release)(struct device *dev),
|
||||
@@ -40,7 +39,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
|
||||
struct soc_camera_platform_info *info = plink->priv;
|
||||
int ret;
|
||||
|
||||
if (icl != plink)
|
||||
if (icd->link != plink)
|
||||
return -ENODEV;
|
||||
|
||||
if (*pdev)
|
||||
@@ -50,7 +49,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
|
||||
if (!*pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
info->dev = dev;
|
||||
info->icd = icd;
|
||||
|
||||
(*pdev)->dev.platform_data = info;
|
||||
(*pdev)->dev.release = release;
|
||||
@@ -59,17 +58,17 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
|
||||
if (ret < 0) {
|
||||
platform_device_put(*pdev);
|
||||
*pdev = NULL;
|
||||
info->dev = NULL;
|
||||
info->icd = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void soc_camera_platform_del(const struct soc_camera_link *icl,
|
||||
static inline void soc_camera_platform_del(const struct soc_camera_device *icd,
|
||||
struct platform_device *pdev,
|
||||
const struct soc_camera_link *plink)
|
||||
{
|
||||
if (icl != plink || !pdev)
|
||||
if (icd->link != plink || !pdev)
|
||||
return;
|
||||
|
||||
platform_device_unregister(pdev);
|
||||
|
||||
Reference in New Issue
Block a user