V4L/DVB (12505): soc_camera_platform: pass device pointer from soc-camera core on .add_device()

Add a struct device pointer to struct soc_camera_platform_info and let the user
(ap325rxa) pass it down to soc_camera_platform.c in its .add_device() method.

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:
Guennadi Liakhovetski 2009-08-25 11:06:22 -03:00 коммит произвёл Mauro Carvalho Chehab
Родитель c41debafc6
Коммит bc1937b41d
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -345,6 +345,8 @@ static int ap325rxa_camera_add(struct soc_camera_link *icl,
if (icl != &camera_info.link || camera_probe() <= 0) if (icl != &camera_info.link || camera_probe() <= 0)
return -ENODEV; return -ENODEV;
camera_info.dev = dev;
return platform_device_register(&camera_device); return platform_device_register(&camera_device);
} }

Просмотреть файл

@ -14,6 +14,8 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/soc_camera.h> #include <media/soc_camera.h>
struct device;
struct soc_camera_platform_info { struct soc_camera_platform_info {
int iface; int iface;
char *format_name; char *format_name;
@ -21,6 +23,7 @@ struct soc_camera_platform_info {
struct v4l2_pix_format format; struct v4l2_pix_format format;
unsigned long bus_param; unsigned long bus_param;
void (*power)(int); void (*power)(int);
struct device *dev;
int (*set_capture)(struct soc_camera_platform_info *info, int enable); int (*set_capture)(struct soc_camera_platform_info *info, int enable);
struct soc_camera_link link; struct soc_camera_link link;
}; };