summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-08-01 12:14:44 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-08-01 12:14:44 -0300
commita7e568a2750e0a41e50c08c29c55128ea3a8c9f7 (patch)
treed9f8250796d58097241a075f474f86b19de12df4
parentf99add164ce3676cfb08aa46d689d7186317111c (diff)
downloadmediapointer-dvb-s2-a7e568a2750e0a41e50c08c29c55128ea3a8c9f7.tar.gz
mediapointer-dvb-s2-a7e568a2750e0a41e50c08c29c55128ea3a8c9f7.tar.bz2
Add a quick howto explaining how to add a newer driver at the tree
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--README.patches106
1 files changed, 101 insertions, 5 deletions
diff --git a/README.patches b/README.patches
index 87fe57be6..ea69fd2c0 100644
--- a/README.patches
+++ b/README.patches
@@ -1,5 +1,5 @@
-Mauro Carvalho Chehab <mchehab at infradead dot org>
-2007 Jun 22
+Mauro Carvalho Chehab <mchehab at infradead dot org>
+ Updated on 2007 August, 1st
This file describes the general procedures used by the LinuxTV team (*)
and by the v4l-dvb community.
@@ -21,6 +21,7 @@ TV and radio broadcast AM/FM.
6. Patch handling for kernel submission
7. Patch submission from the community
8. Identifying regressions with Mercurial
+ 9. Creating a newer driver
1. A Brief introduction about patch management
==========================================
@@ -409,12 +410,12 @@ e. People will eventually comment about the patch. In this case,
f. If the patch is fixing an existing maintained driver, the
low-level driver maintainer will apply to his tree, and at some later
- time, ask the subsystem maintainer to pull it. It is a good idea to
- send the patch to the maintainer C/C the mailing list for him to know
+ time, ask the subsystem maintainer to pull it. It is a good idea to
+ send the patch to the maintainer C/C the mailing list for him to know
that you're expecting him to forward the patch.
g. If it is a newer driver (not yet in one of the development trees),
- please send the patch to the subsystem maintainer, C/C the proper
+ please send the patch to the subsystem maintainer, C/C the proper
mailing lists.
8. Identifying regressions with Mercurial
@@ -484,3 +485,98 @@ g. If it is a newer driver (not yet in one of the development trees),
If, in the middle of the process, you need to know on what revision
you are, you can do something like:
hg log -r `hg id|cut -d' ' -f 1`
+
+9. Creating a newer driver
+ =======================
+
+ This quick HOWTO explains how to create a new driver using v4l-dvb
+ tree.
+
+ The v4l-dvb tree have a the following basic structure:
+ /
+ |-- Documentation
+ | |-- dvb <== DVB drivers documentation
+ | `-- video4linux <== V4L drivers documentation
+ |-- drivers
+ | `-- media
+ | |-- common <== Common stuff, like IR
+ | |-- dvb <== DVB only drivers
+ | |-- radio <== V4L Radio only drivers
+ | `-- video <== V4L Analog TV (plus radio and/or
+ | DVB) drivers
+ `-- include
+ |-- linux <== V4L userspace API files
+ | `-- dvb <== DVB userspace API files
+ `-- media <== V4L internal API files
+
+ 9.1 - simple drivers
+ ====================
+
+ For very simple drivers that have only one .c and one .h file, the
+ recommended way is not to create a newer directory, but keep the
+ driver into an existing one.
+
+ Assumming that the will be V4L+DVB, the better place for it to be is under
+ /linux/drivers/media/video. Assumming also that the newer driver
+ will be called as "newdevice", you need to do:
+
+ a) add at /linux/drivers/media/video/Kconfig something like:
+
+config VIDEO_NEWDEVICE
+ tristate "newdevice driver"
+ select VIDEO_V4L2
+ select VIDEO_BUF
+ help
+ Support for newdevice Device
+
+ Say Y if you own such a device and want to use it.
+
+ b) add at /linux/drivers/media/video/Makefile something like:
+
+obj-$(CONFIG_VIDEO_NEWDEVICE) += newdevice.o
+EXTRA_CFLAGS = -Idrivers/media/video
+
+ 9.2 - bigger drivers
+ ====================
+
+ In this case, a driver will be splitted into several different source
+ codes. Ideally, a source file should have up to 1000 source code
+ lines. After that, you should consider splitting it into smaller files.
+
+ In this case, assumming that the will be V4L+DVB, and that the driver
+ is called "newdevice", all that is needed to add the newer driver is:
+
+ a) create a newer dir with your driver, for example:
+ /linux/drivers/media/video/newdevice
+ b) create /linux/drivers/media/video/newdevice/Kconfig with something
+ like:
+
+config VIDEO_NEWDEVICE
+ tristate "newdevice driver"
+ select VIDEO_V4L2
+ select VIDEO_BUF
+ help
+ Support for new device Device
+
+ Say Y if you own such a device and want to use it.
+
+ c) create /linux/drivers/media/video/newdevice/Makefile with
+ something like:
+
+obj-$(CONFIG_VIDEO_NEWDEVICE) += newdevice.o
+EXTRA_CFLAGS = -Idrivers/media/video
+
+ d) Add your driver directory at /linux/drivers/media/Makefile:
+
+obj-$(CONFIG_VIDEO_NEWDEVICE) += newdevice/
+
+ e) Add your driver directory at /linux/drivers/media/Kconfig:
+
+source "drivers/media/video/newdevice/Kconfig"
+
+ After that, you will be able to use v4l-dvb makefile to compile your
+ driver. With:
+
+ make help
+
+ you'll see some useful syntax that may help your development.