aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-device.c
diff options
context:
space:
mode:
authorDmitri Belimov <d.belimov@gmail.com>2010-03-23 10:23:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:50:24 -0400
commit85e092190b5f7dfe9b78556440472c5590a32b4e (patch)
tree95b38198c6b048d43fbda277ba6476eb9e8fbd55 /drivers/media/video/v4l2-device.c
parent443fed9fa42bbeacdb8d336b8a5002a262cac15c (diff)
V4L/DVB: Add SPI support to V4L2
Add support SPI bus to v4l2. Useful for control some device with SPI bus like hardware MPEG2 encoders and etc. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-device.c')
-rw-r--r--drivers/media/video/v4l2-device.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c
index 0d06e7cbd5b3..5a7dc4afe92a 100644
--- a/drivers/media/video/v4l2-device.c
+++ b/drivers/media/video/v4l2-device.c
@@ -21,6 +21,9 @@
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/ioctl.h> 22#include <linux/ioctl.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#if defined(CONFIG_SPI)
25#include <linux/spi/spi.h>
26#endif
24#include <linux/videodev2.h> 27#include <linux/videodev2.h>
25#include <media/v4l2-device.h> 28#include <media/v4l2-device.h>
26 29
@@ -97,6 +100,14 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev)
97 i2c_unregister_device(client); 100 i2c_unregister_device(client);
98 } 101 }
99#endif 102#endif
103#if defined(CONFIG_SPI)
104 if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) {
105 struct spi_device *spi = v4l2_get_subdevdata(sd);
106
107 if (spi)
108 spi_unregister_device(spi);
109 }
110#endif
100 } 111 }
101} 112}
102EXPORT_SYMBOL_GPL(v4l2_device_unregister); 113EXPORT_SYMBOL_GPL(v4l2_device_unregister);