Skip to content

Commit 3e25927

Browse files
Vincent Sanderspopcornmix
Vincent Sanders
authored andcommitted
bcm2835: add v4l2 camera device
- Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. - Uses 3.6.10 timestamping - Camera power based on use - Uses immutable input mode on video encoder Signed-off-by: Daniel Stone <[email protected]> Signed-off-by: Luke Diamand <[email protected]>
1 parent a99756a commit 3e25927

17 files changed

+5829
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
BCM2835 (aka Raspberry Pi) V4L2 driver
3+
======================================
4+
5+
1. Copyright
6+
============
7+
8+
Copyright © 2013 Raspberry Pi (Trading) Ltd.
9+
10+
2. License
11+
==========
12+
13+
This program is free software; you can redistribute it and/or modify
14+
it under the terms of the GNU General Public License as published by
15+
the Free Software Foundation; either version 2 of the License, or
16+
(at your option) any later version.
17+
18+
This program is distributed in the hope that it will be useful,
19+
but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
GNU General Public License for more details.
22+
23+
You should have received a copy of the GNU General Public License
24+
along with this program; if not, write to the Free Software
25+
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26+
27+
3. Quick Start
28+
==============
29+
30+
You need a version 1.0 or later of v4l2-ctl, available from:
31+
git://git.linuxtv.org/v4l-utils.git
32+
33+
$ sudo modprobe bcm2835-v4l2
34+
35+
Turn on the overlay:
36+
37+
$ v4l2-ctl --overlay=1
38+
39+
Turn off the overlay:
40+
41+
$ v4l2-ctl --overlay=0
42+
43+
Set the capture format for video:
44+
45+
$ v4l2-ctl --set-fmt-video=width=1920,height=1088,pixelformat=4
46+
47+
(Note: 1088 not 1080).
48+
49+
Capture:
50+
51+
$ v4l2-ctl --stream-mmap=3 --stream-count=100 --stream-to=somefile.h264
52+
53+
Stills capture:
54+
55+
$ v4l2-ctl --set-fmt-video=width=2592,height=1944,pixelformat=3
56+
$ v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=somefile.jpg
57+
58+
List of available formats:
59+
60+
$ v4l2-ctl --list-formats

drivers/media/platform/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ config VIDEO_S3C_CAMIF
124124
source "drivers/media/platform/soc_camera/Kconfig"
125125
source "drivers/media/platform/exynos4-is/Kconfig"
126126
source "drivers/media/platform/s5p-tv/Kconfig"
127+
source "drivers/media/platform/bcm2835/Kconfig"
127128

128129
endif # V4L_PLATFORM_DRIVERS
129130

drivers/media/platform/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ obj-y += davinci/
5050

5151
obj-$(CONFIG_ARCH_OMAP) += omap/
5252

53+
obj-$(CONFIG_VIDEO_BCM2835) += bcm2835/
54+
5355
ccflags-y += -I$(srctree)/drivers/media/i2c
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Broadcom VideoCore IV v4l2 camera support
2+
3+
config VIDEO_BCM2835
4+
bool "Broadcom BCM2835 camera interface driver"
5+
depends on VIDEO_V4L2 && ARCH_BCM2708
6+
---help---
7+
Say Y here to enable camera host interface devices for
8+
Broadcom BCM2835 SoC. This operates over the VCHIQ interface
9+
to a service running on VideoCore.
10+
11+
12+
if VIDEO_BCM2835
13+
14+
config VIDEO_BCM2835_MMAL
15+
tristate "Broadcom BM2835 MMAL camera interface driver"
16+
depends on BCM2708_VCHIQ
17+
select VIDEOBUF2_VMALLOC
18+
---help---
19+
This is a V4L2 driver for the Broadcom BCM2835 MMAL camera host interface
20+
21+
To compile this driver as a module, choose M here: the
22+
module will be called bcm2835-v4l2.o
23+
24+
25+
endif # VIDEO_BM2835
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bcm2835-v4l2-objs := bcm2835-camera.o controls.o mmal-vchiq.o
2+
3+
obj-$(CONFIG_VIDEO_BCM2835_MMAL) += bcm2835-v4l2.o
4+
5+
ccflags-$(CONFIG_VIDEO_BCM2835) += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000

0 commit comments

Comments
 (0)