# GNUmakefile for the videotext-driver # # Copyright (c) 1994-99 Martin Buck # # $Id: Makefile,v 1.23 1999/10/14 23:26:07 mb Exp mb $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # Uncomment the suitable line for your VTX-interface # IF_CT is an internal VTX-decoder-card equipped with a SAA5246 as # published in the german computer-magazine c't 11/91, p. 228 # and c't 7/92, p. 176 (only the version with a 5246 is # supported; the 5244 will _never_ be supported) # IF_CTSERIAL is the same c't-interface connected to a serial port (thanks # to Carsten Bobek for patches) # IF_VTX2000 is an internal VTX-decoder-card with a SAA5246. It should be # compatible with the internal videodat-cards (VD3000) made by # Wiegand Datentechnik/Videodat Medien GmbH (thanks to Volker # Schuermann for info about these cards) # IF_VTX2000EXT is the external version of the VTX2000-card by Wiegand. It # can be connected to a serial port. # IF_PCVT7000 is an external decoder with an internal interface-card which # was published in ELV journal 2/90, p. 54, 3/90, p. 54 and # 4/90, p. 16. # IF_SATCOM is an external VTX-decoder connected to a serial port made # by KDK Satcom (thanks to Martin Höppner for info and # patches) # IF_PCVTX_STD is an internal ISA-card (PCVTXstandard) equipped with a # SAA5243 made by TechConsult, Munich (thanks to them for # giving me information about these cards and borrowing me one # to test the driver) # IF_PCVTX_CIRC is also an internal card (PCVTXcircular) made by # TechConsult, but this one uses a SAA5249 and has a 512kB # page-cache on board # IF_LPT can be any interface connected to a printer port as long as # it uses the pinout Gerald Sinzig described in the docs for # his TOPTEXT program for DOS (thanks to Roland Alder for # patches) # IF_LPTPCVTEXT can be any interface connected to a printer port using the # the same pinout as the interfaces for the DOS-decoder # PC-VText # IF_TELEKIT is an internal interface made by Totobit Informatica and sold # the italian television RAI # IF_CEA is an internal interface (CEA comdata) made by an unknown # company in the Netherlands # IF_KEYWORDDTN /* FIXME */ # IF_KEYWORDCHK /* FIXME */ # IF_KEYWORDRES /* FIXME */ # IF_WINTVPCI_PHILIPS # IF_WINTVPCI_TEMIC # is a PCI card containing a video grabber, a tuner and a # videotext interface made by Hauppauge Computer Works, Inc. # (thanks to Ralph Metzler and Volker Widor for patches). At # the moment, you also need the module bt848_i2c.o for this # interface. Use IF_WINTVPCI_PHILIPS if your board has a # Philips tuner (5 in bttv's Makefile) or IF_WINTVPCI_TEMIC # if you have a Temic tuner (0 in bttv's Makefile). # IF_WINTVPCI_PHILIPS is the same as the former IF_WINTVPCI. # WARNING: Newer WinTVs (especially those with a radio # tuner) might contain a videotext-chip (SAA5284) that # doesn't work with this driver! # IF_MICROTEXT /* FIXME */ # IF_MICROTEXTLPT /* FIXME */ # IF_TIMTRONIX is an external interface connected to a serial port made # by Timtronix, the Netherlands (thanks to Ico Doornekamp for # patches) # IF_MIRAGEVIDEOTV # is a VGA+framegrabber+VTX card made by Spea. # The driver currently doesn't work!!! # Thanks to Michael Böhmer for bugging me long enough to # disassemble the DOS software and write the Linux driver, # for supplying me with information from S3, Temic and # Spea/Diamond (although they were not really willing/able # to help) and for testing and patching the driver. # Many thanks also to Georg Schultz from TEMIC Telefunken # Hochfrequenztechnik GmbH for providing programming # information about the Temic 4002FH5 tuner. Without his # help, it would have been much more difficult to find out # how to program this really strange piece of hardware. # IF_HOMEBREW is my own interface attached to a printer port (maybe not # useful for anybody but me) #VTXIF = IF_CT #VTXIF = IF_CTSERIAL #VTXIF = IF_VTX2000 #VTXIF = IF_VTX2000EXT #VTXIF = IF_PCVT7000 #VTXIF = IF_SATCOM #VTXIF = IF_PCVTX_STD #VTXIF = IF_PCVTX_CIRC #VTXIF = IF_LPT #VTXIF = IF_LPTPCVTEXT #VTXIF = IF_TELEKIT #VTXIF = IF_CEA #VTXIF = IF_KEYWORDDTN #VTXIF = IF_KEYWORDCHK #VTXIF = IF_KEYWORDRES #VTXIF = IF_WINTVPCI_PHILIPS #VTXIF = IF_WINTVPCI_TEMIC #VTXIF = IF_MICROTEXT #VTXIF = IF_MICROTEXTLPT #VTXIF = IF_TIMTRONIX #VTXIF = IF_MIRAGEVIDEOTV #VTXIF = IF_HOMEBREW # Define the base-IO-port of your I²C-/VTX-interface here (can be overridden # on the insmod-commandline with io_base=0x???). In the comments, 0 means # jumper open, 1 means jumper closed. # PCI cards (such as IF_WINTVPCI_*) determine their IO-ports automatically, # so you don't have to set them below. # Possible addresses for internal c't cards: #VTX_DEFAULT_IO_BASE = 0x100 # IF_CT with S3/S2/S1 set to 000 #VTX_DEFAULT_IO_BASE = 0x1f0 # IF_CT with S3/S2/S1 set to 001 #VTX_DEFAULT_IO_BASE = 0x200 # IF_CT with S3/S2/S1 set to 010 #VTX_DEFAULT_IO_BASE = 0x220 # IF_CT with S3/S2/S1 set to 011 #VTX_DEFAULT_IO_BASE = 0x300 # IF_CT with S3/S2/S1 set to 100 #VTX_DEFAULT_IO_BASE = 0x3e0 # IF_CT with S3/S2/S1 set to 101 # Use one of the next values for interfaces connected to a serial port # (IF_CTSERIAL, IF_VTX2000EXT, IF_SATCOM or IF_TIMTRONIX) #VTX_DEFAULT_IO_BASE = 0x3f8 # Serial IF connected to ttyS0 #VTX_DEFAULT_IO_BASE = 0x2f8 # Serial IF connected to ttyS1 #VTX_DEFAULT_IO_BASE = 0x3e8 # Serial IF connected to ttyS2 #VTX_DEFAULT_IO_BASE = 0x2e8 # Serial IF connected to ttyS3 # The next four values can be used for an internal VTX2000 or VD3000 #VTX_DEFAULT_IO_BASE = 0x3e0 # IF_VTX2000 with JP1/JP2 set to 00 #VTX_DEFAULT_IO_BASE = 0x300 # IF_VTX2000 with JP1/JP2 set to 01 #VTX_DEFAULT_IO_BASE = 0x330 # IF_VTX2000 with JP1/JP2 set to 10 #VTX_DEFAULT_IO_BASE = 0x250 # IF_VTX2000 with JP1/JP2 set to 11 # If you have a VTX2000SL (the ones with 3 address-jumpers), use one of # these addresses: #VTX_DEFAULT_IO_BASE = 0x238 # IF_VTX2000 (SL) with JP4/JP3/JP2 set to 000 #VTX_DEFAULT_IO_BASE = 0x278 # IF_VTX2000 (SL) with JP4/JP3/JP2 set to 001 #VTX_DEFAULT_IO_BASE = 0x2b8 # IF_VTX2000 (SL) with JP4/JP3/JP2 set to 010 #VTX_DEFAULT_IO_BASE = 0x2f8 # IF_VTX2000 (SL) with JP4/JP3/JP2 set to 011 #VTX_DEFAULT_IO_BASE = 0x338 # IF_VTX2000 (SL) with JP4/JP3/JP2 set to 100 #VTX_DEFAULT_IO_BASE = 0x378 # IF_VTX2000 (SL) with JP4/JP3/JP2 set to 101 #VTX_DEFAULT_IO_BASE = 0x3b8 # IF_VTX2000 (SL) with JP4/JP3/JP2 set to 110 #VTX_DEFAULT_IO_BASE = 0x3f8 # IF_VTX2000 (SL) with JP4/JP3/JP2 set to 111 # The PC-VT 7000 card be be set to any port you like. BR0-BR9 correspond to # A0-A9. A closed jumper sets the corresponding bit to 0. #VTX_DEFAULT_IO_BASE = 0x300 # IF_PCVT7000 with default-settings # Use the one of the next settings for the TechConsult cards (PCVTXstandard # and PCVTXcircular). Warning: In contrast to the DOS-programs you have to # give the lowest address (in hexadecimal) here. #VTX_DEFAULT_IO_BASE = 0x31c # IF_PCVTX_* with JP3/JP2/JP1 set to 000 #VTX_DEFAULT_IO_BASE = 0x318 # IF_PCVTX_* with JP3/JP2/JP1 set to 001 #VTX_DEFAULT_IO_BASE = 0x30c # IF_PCVTX_* with JP3/JP2/JP1 set to 010 #VTX_DEFAULT_IO_BASE = 0x308 # IF_PCVTX_* with JP3/JP2/JP1 set to 011 #VTX_DEFAULT_IO_BASE = 0x21c # IF_PCVTX_* with JP3/JP2/JP1 set to 100 #VTX_DEFAULT_IO_BASE = 0x218 # IF_PCVTX_* with JP3/JP2/JP1 set to 101 #VTX_DEFAULT_IO_BASE = 0x20c # IF_PCVTX_* with JP3/JP2/JP1 set to 110 #VTX_DEFAULT_IO_BASE = 0x208 # IF_PCVTX_* with JP3/JP2/JP1 set to 111 # Common addresses for interfaces connected to a parallel port: #VTX_DEFAULT_IO_BASE = 0x3bc # IF_LPT* connected to lp0 #VTX_DEFAULT_IO_BASE = 0x378 # IF_LPT* connected to lp1 #VTX_DEFAULT_IO_BASE = 0x278 # IF_LPT* connected to lp2 # Possbile addresses for Totobit Telekit interfaces #VTX_DEFAULT_IO_BASE = 0x300 # IF_TELEKIT at 0x300 #VTX_DEFAULT_IO_BASE = 0x310 # IF_TELEKIT at 0x310 #VTX_DEFAULT_IO_BASE = 0x320 # IF_TELEKIT at 0x320 #VTX_DEFAULT_IO_BASE = 0x330 # IF_TELEKIT at 0x330 # As far as I know, the CEA comdata interface has only one possible base- # address. Broken as designed, if you ask me: #VTX_DEFAULT_IO_BASE = 0x308 # IF_CEA at 0x308 # Possible addresses for the internal Microtext interface: #VTX_DEFAULT_IO_BASE = 0x234 # IF_MICROTEXT with jumper in pos. A #VTX_DEFAULT_IO_BASE = 0x224 # IF_MICROTEXT with jumper in pos. B # Uncomment the following line if you get I/O-Errors when using the driver # (can be overridden on the insmod-commandline with slow_if=?; possible # values are 0 (fast) or 1 (slow)): #I2C_SPEED = -DVTX_CHIPSET_IS_DAMN_SLOW # Choose your favourite major-number here (can be overridden on the insmod- # commandline with major=??). # NEWS: VideoteXt now has an officially registered major number which is # different from the old default. Make sure to install both the new driver # and the new device files. VTX_DEFAULT_MAJOR = 83 # To get debugging messages, uncomment the following line and use debug=x # (with x > 0) when loading the driver (WARNING: x >= 2 is *very* verbose, you # definitely want to kill your klogd before you do this) #DEBUG = -DDEBUG_VTX # Uncomment the next line to make the driver quiet on (un)loading (i.e. no # version- and interface-type messages). This is useful if you load vtx with # kerneld. You can override this setting with quiet=0 or quiet=1 on the # insmod-commandline (or in /etc/conf.modules). #VTX_QUIET = -DVTX_QUIET # Uncomment the next line if you want direct access to the I²C-bus with # special IOCTLs (might be useful for debugging or for testing new videotext- # chips). To use this, you also have to do a "make install.devi2c" to install # the corresponding device special file /dev/vti2c. #RAW_I2C_SUPPORT = -DRAW_I2C_SUPPORT # This is where the kernel you want to compile the driver for is installed # (make sure you've done a 'make config; make dep' in this directory) KERNELDIR = /usr/src/linux # Set the installation-directories & permissions here: # $(KERNEL_VERSION) will be automagically set to your currently installed (not # necessarily running!) kernel-version DRVDIR = /lib/modules/$(KERNEL_VERSION)/misc DRVSUFFIX = .o DRVPERM = 644 DRVGRP = DRVDIRPERM = 755 DEVPERM = 666 DEVGRP = HDRDIR = /usr/include/sys OLDHDRDIR = /usr/include/linux HDRPERM = 644 HDRGRP = VTXDEV = /dev/vtx TUNERDEV = /dev/vttuner I2CDEV = /dev/vti2c # Compiler options INCLUDEDIRS = CC = gcc CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -Wall -Wstrict-prototypes # Options that will be put into /etc/conf.modules when doing # "make install.kdconf". quiet=1 is rather useful once you're sure the # driver works correctly. #KDOPTIONS = quiet=1 ##################################################################### # No user-serviceable parts beyond this line! ##################################################################### ifeq ($(VTXIF),) VTXIF = IF_NONE endif ifeq ($(VTXIF),IF_WINTVPCI_PHILIPS) _IS_IF_WINTVPCI = 1 endif ifeq ($(VTXIF),IF_WINTVPCI_TEMIC) _IS_IF_WINTVPCI = 1 endif ifeq ($(VTX_DEFAULT_IO_BASE),) VTX_DEFAULT_IO_BASE = 0 endif VTX_MINOR = 0 TUNER_MINOR = 16 I2C_MINOR = 32 DEFINES = -D$(VTXIF) -DVTX_DEFAULT_IO_BASE=$(VTX_DEFAULT_IO_BASE) $(I2C_SPEED) \ -DVTX_DEFAULT_MAJOR=$(VTX_DEFAULT_MAJOR) \ $(DEBUG) $(NO_REQUEST_REGION) $(VTX_QUIET) $(RAW_I2C_SUPPORT) CFLAGS = $(DEFINES) $(CCFLAGS) $(INCLUDEDIRS) -I$(KERNELDIR)/include $(XCFLAGS) INSMOD_VARS = debug=1 KERNEL_VERSION = \ $(shell { grep "define.*UTS_RELEASE" $(KERNELDIR)/include/linux/version.h 2>/dev/null | \ cut -d\" -f2; uname -r; } | head -n 1) KDCONF = /etc/conf.modules /etc/modules.conf SRC = vtx.c bt848_i2c.c OBJS = vtx.o bt848_i2c.o HEADERS = vtx.h bt848_i2c.h DOCS = README programming.txt ChangeLog kerneld-conf.modules ifneq ($(DRVGRP),) _DRVGRP = -g $(DRVGRP) endif ifneq ($(HDRGRP),) _HDRGRP = -g $(HDRGRP) endif .PHONY: all test rmmod insmod install install.dev install.mod install.headers uninstall \ uninstall.mod uninstall.headers uninstall.dev clean disclean sub-dist depend ifdef _IS_IF_WINTVPCI all: vtx.o bt848_i2c.o else all: vtx.o endif all_drivers: -rm -f vtx.o for DRVDEF in $(shell grep '^#VTXIF = IF_' Makefile | cut -c13-); do \ DRVNAME=`echo $$DRVDEF | tr A-Z a-z`; \ $(MAKE) VTXIF=IF_$$DRVDEF VTX_DEFAULT_IO_BASE=0 || break; \ mv vtx.o vtx-$$DRVNAME.o; \ done test: rmmod all insmod rmmod: -rmmod vtx ifdef _IS_IF_WINTVPCI -rmmod bt848_i2c endif insmod: ifdef _IS_IF_WINTVPCI insmod ./bt848_i2c.o $(BT848_INSMOD_VARS) endif insmod ./vtx.o $(INSMOD_VARS) lsmod install: install.mod install.headers install.dev install.dev: -rm -f $(VTXDEV) $(TUNERDEV) mknod -m $(DEVPERM) $(VTXDEV) c $(VTX_DEFAULT_MAJOR) $(VTX_MINOR) mknod -m $(DEVPERM) $(TUNERDEV) c $(VTX_DEFAULT_MAJOR) $(TUNER_MINOR) ifneq ($(DEVGRP),) chgrp $(DEVGRP) $(VTXDEV) $(TUNERDEV) endif -rm -f /dev/tuner # Remove device file installed by old version install.devi2c: -rm -f $(I2CDEV) mknod -m $(DEVPERM) $(I2CDEV) c $(VTX_DEFAULT_MAJOR) $(I2C_MINOR) install.mod: vtx.o install -d -m $(DRVDIRPERM) $(DRVDIR) install $(_DRVGRP) -m $(DRVPERM) vtx.o $(DRVDIR)/vtx$(DRVSUFFIX) ifdef _IS_IF_WINTVPCI install $(_DRVGRP) -m $(DRVPERM) bt848_i2c.o $(DRVDIR)/bt848_i2c$(DRVSUFFIX) endif install.headers: vtx.h install $(_HDRGRP) -m $(HDRPERM) vtx.h $(HDRDIR) ifdef _IS_IF_WINTVPCI install $(_HDRGRP) -m $(HDRPERM) bt848_i2c.h $(HDRDIR) endif -rm -f $(OLDHDRDIR)/vtx.h # Remove header file from old location install.kdconf: uninstall.kdconf for kdconf in $(KDCONF); do \ if [ -f "$$kdconf" ]; then \ echo "alias char-major-$(VTX_DEFAULT_MAJOR) vtx" >> "$$kdconf"; \ [ -n "$(KDOPTIONS)" ] && echo "options vtx $(KDOPTIONS)" >> "$$kdconf"; \ fi; \ done install.all_drivers: install.headers install.dev install $(_HDRGRP) -m $(HDRPERM) bt848_i2c.h $(HDRDIR) install -d -m $(DRVDIRPERM) $(DRVDIR) for DRVNAME in $(shell grep '^#VTXIF = IF_' Makefile | cut -c13- | tr A-Z a-z); do \ install $(_DRVGRP) -m $(DRVPERM) vtx-$$DRVNAME.o $(DRVDIR)/vtx-$$DRVNAME$(DRVSUFFIX) || exit 1; \ done install $(_DRVGRP) -m $(DRVPERM) bt848_i2c.o $(DRVDIR)/bt848_i2c$(DRVSUFFIX) uninstall: uninstall.mod uninstall.headers uninstall.dev uninstall.dev: -rm -f $(VTXDEV) $(TUNERDEV) -rm -f /dev/tuner # Remove device file installed by old version uninstall.devi2c: -rm -f $(I2CDEV) uninstall.mod: -rm -f $(DRVDIR)/vtx$(DRVSUFFIX) [ -f $(DRVDIR)/modules.dep ] && [ -x /sbin/depmod ] && /sbin/depmod -a $(KERNEL_VERSION) uninstall.headers: -rm -f $(HDRDIR)/vtx.h $(HDRDIR)/bt848_i2c.h uninstall.kdconf: for kdconf in $(KDCONF); do \ if [ -f "$$kdconf" ]; then \ cp -p "$$kdconf" "$$kdconf.vtxnew" && \ { \ egrep -v '^(alias char-major-.*vtx|options vtx )' "$$kdconf" > "$$kdconf.vtxnew"; \ [ $$? -le 1 ] && ln -f "$$kdconf.vtxnew" "$$kdconf"; \ rm -f "$$kdconf.vtxnew"; \ } \ fi; \ done clean distclean: rm -f $(OBJS) vtx-*.o *~ sub-dist: depend cp -a $(SRC) $(HEADERS) .depend Makefile $(DOCS) ../$(DISTDIR)/driver depend: $(CC) -c -MM $(CFLAGS) $(SRC) > .depend ifeq (.depend,$(wildcard .depend)) include .depend endif