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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
443fed9fa4
commit
85e092190b
@@ -21,6 +21,9 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/i2c.h>
|
||||
#if defined(CONFIG_SPI)
|
||||
#include <linux/spi/spi.h>
|
||||
#endif
|
||||
#include <linux/videodev2.h>
|
||||
#include <media/v4l2-device.h>
|
||||
|
||||
@@ -96,6 +99,14 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev)
|
||||
if (client)
|
||||
i2c_unregister_device(client);
|
||||
}
|
||||
#endif
|
||||
#if defined(CONFIG_SPI)
|
||||
if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) {
|
||||
struct spi_device *spi = v4l2_get_subdevdata(sd);
|
||||
|
||||
if (spi)
|
||||
spi_unregister_device(spi);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user