For integrating new drivers in the Comedi's source tree the following things have to be done:
Choose a sensible name for the source code file. Let's assume here that you call it “mydriver.c”
Put your new driver into comedi/drivers/mydriver.c
.
Edit comedi/drivers/Makefile.am
and add mydriver.ko
to the module_PROGRAMS
list. Also add a line
mydriver_ko_SOURCES = mydriver.c
in the alphabetically appropriate place.
Edit comedi/drivers/Kbuild
and a line according to
the type of driver:
obj-$(COMEDI_CONFIG_PCI_MODULES) += mydriver.o # for a PCI driver
obj-$(COMEDI_CONFIG_PCMCIA_MODULES) += mydriver.o # for a PCMCIA driver
obj-$(COMEDI_CONFIG_USB_MODULES) += mydriver.o # for a USB driver
obj-m += mydriver.o # for other driver types
Run ./autogen.sh in the top-level comedi directory. You will need to have (a recent version of) autoconf and automake installed to successfully run autogen.sh. Afterwards, your driver will be built along with the rest of the drivers when you run make.
If you want to have your driver included in the Comedi distribution
(you definitely want to :-) ) send it to
the Comedi mailing list
for review and integration. See the top-level README
for details of the Comedi mailing list.)
Note your work must be licensed under terms
compatible with the GNU GPL to be distributed as a part of Comedi.