-- Installation of the mediafocusII driver --

LINUX KERNEL
  The (2.2.x) kernel sources have to be installed. Normally they can be
  found at /usr/src/linux. In order to have certain files present kernel
  configuration by "make [x|menu]config" has to be executed at least
  once.

IC STACK
  To run the mediafocusII modules the enhanced so called "Simon Vogl
  IC driver" is needed. If these routines are already present on your
  system, `locate i2c-core` or `locate i2c-algo` will find directories
  where the files reside. Else get the IC driver package from
  http://www.netroedge.com/~lm78, for example, and install it on your
  system.
  In doing so it is very commendable to choose method 3 "Patching of
  the kernel" which is described in the documentation of the package.
  Otherwise there is a certain risk that during compiling of the 
  mediafocusII modules the wrong IC header file i2c.h could be
  included - i.e. the old, in the kernel source tree already existing
  i2c.h. This failure situation is indicated by error messages from the
  compiler which contain the keyword "i2c" in a considerable number. So,
  if you insist on using methods 1 or 2 rename the file
  /usr/src/linux/include/linux/i2c.h *temporarily* to i2c-old.h or
  something similar.

  If more than that IC header files are in a directory which is not
  automatically taken into consideration by the compiler, adjust the
  file "driver/Makefile". In the first section of this file uncomment
  the line with the option "I2C_HEADERS" and enter the correct path. It
  is however supposed that the subordinated directory has already the
  name "linux". So, if the header files are in a directory called
  /x/y/z/linux/ enter in "driver/Makefile":

    I2C_HEADERS=/x/y/z

  After applying method 3 "Patching of the kernel" the Linux kernel must
  be configured ("make [x|menu]config"), compiled and installed again.

IC WITH SUSE LINUX DISTRIBUTION
  Newer SuSE versions already have the enhanced IC routines integrated.
  Tests under SuSE Linux 6.4 showed however that these routines are not
  working correctly. It is manifested by numerous syslog messages about
  IC errors when the mediafocusII modules are loaded. This misfunction
  can be overcome by a patch to the SuSE kernel source (lx_suse). The
  patch (diff) file is located in the SuSE-patch directory. To apply the
  patch execute as root:

    cd /usr/src/linux
    patch -p0 < {your_dir}/SuSE-patch/patch

  Adjust {your_dir} to your needs. Afterwards the kernel is compiled
  once more. If the kernel was already compiled before a "make modules"
  and a "make modules_install" should be sufficient.

  Tests and making of the patch file took place under SuSE 6.4. A user
  told that SuSE 7.0 shows the same IC errors. Whether the patch
  matches SuSE 7.0 can't be said at the time of writing this.

  Another test involved SuSE 6.2. 6.2 doesn't contain the enhanced IC
  routines yet. So install them the usual way (-> method 3). No
  additional patch is needed.

COMPILING OF THE MODULES

    su -c make

  at the mfII directory. Root permissions are needed because kernel
  modules are created here.

INSTALLING OF THE MODULES
  
    su -c "make install"

  at the mfII directory. The module files are copied to the directory
  /lib/modules/<kernel version>/misc, which also requires root
  permissions.

LOADING OF THE MODULES
  Loading can be done separately by

    insmod <module name> [<options>]

  (as root). Take into consideration the modules

    videodev
    i2c-core
    saa7146_core
    saa7146_v4l
    sp5055II
    stv0056af
    saa7113h
    msp3400satII
    drp3510II
    eeprom1k2k		# if required; not absolutely needed
    mfII

  and keep this sequence as possible. (At least load mfII last.)
  Execute these steps easily by calling the scripts

    scripts/ld_mod		resp.
    scripts/ld_mod_debug

  (as root). In the second case most of the modules are loaded with the
  option 'debug=1'. This will force a bunch of additional debug messages
   in the system logging file, generally /var/log/messages.

OPTIONS
  The driver modules can be loaded by specifying additional options.
  Besides the "vidmem" option (look below) there are mainly options
  which control the generation of debug messages. They describe the 
  internal driver proceedings as a protocol in the syslog files. If
  these messages are required such a combination of options is
  reasonable as contained in the script "ld_mod_debug". Debug options
  for "i2c-core" and "saa7146_core" force a considerable number of
  messages which are seldom really needed.

  videodev:

    - none -

  i2c-core:

    i2c_debug=0		No debug messages.
    i2c_debug=1		Debug messages in syslog.
    i2c_debug=2		More detailed debug messages.

  saa7146_core:

    buffers=n		Number of video buffers is n. Omitting this
			option causes the default value of n=4. It is
			desirable to use the default value.
    mode=m		Video mode is m (0 = PAL, 1 = NTSC). Some
			applications require to force a certain mode.
			Usually (i.e. for xawtv) not needed.
    debug=0		No debug messages.
    debug=1		Debug messages about called subroutines.
    debug=2		Debug messages about executed steps.
    debug=3		Combination of 1 + 2.

  saa7146_v4l:

    debug=0		No debug messages.
    debug=1		Debug messages in syslog.
    debug=2		More detailed debug messages.
    debug=3		Even more detailed debug messages.

  sp5055II, stv0056af, saa7113h, msp3400satII, drp3510II:

    debug=0		No debug messages.
    debug=1		Debug messages in syslog.

  mfII:

    debug,fdebug=0	No debug messages.
    debug=1		Debug messages about called ioctls.
    fdebug=1		Debug messages about called subroutines.
    vidmem=0xaaaa	Framebuffer hass address 0xaaaa.
    vidlow=0xbbbb	Low significant bits of framebuffer address are
                        0xbbbb.

  !! Option "vidmem" HAS TO BE SPECIFIED when loading the mfII    !!
  !! module, and it must match your configuration. Scripts ld_mod !!
  !! and ld_mod_debug must be edited before their first call to   !!
  !! take over the correct "vidmem" value.                        !!

  "vidmem" means the framebuffer address of the graphic card - more
  exactly: the high 4 digits of the address in an 8-digit hexadecimal
  notation. This value is displayed on the text console among the
  messages when you start the X Window System. (But perhaps this output
  is diverted into a file on your system, like .X.err or something like
  that.) The value may appear with the cue "aperture", too.

  If you are familiar with the technical parameters of your graphic
  card the framebuffer address can be read off from the output list
  of `cat /proc/pci` resp. `lspci -v` (graphic card's sections).
 
  If one of the lower 4 digits of the framebuffer address is different
  from zero, you must also specify the parameter 'vidlow'. Else 'vidlow'
  can be omitted.

  Example: A framebuffer address 0xc0004000 is typed as
    'vidmem=0xc000 vidlow=0x4000'

  If PCI/AGP cards are added or removed or if cards swap their places
  these values may change!

  If no debug options are specified the default setting of mediafocusII
  modules is "debug=0". But SuSE Linux distribution - SuSe 6.4 was
  examined - has a default setting of "i2c_debug=1" for the i2c-core
  module. Specify "i2c_debug=0" explicitly if you don't want any
  additional syslog messages from i2c-core.

CONF.MODULES.CONF
  Entries like

    alias char-major-81-0 mfII

  in /etc/modules.conf resp. /etc/conf.modules are NOT allowed at the
  moment because any automatic loading of mediafocusII driver modules
  is not supported yet.

UNLOADING OF THE MODULES
  Either separate by 'rmmod <module name>' or common by calling the
  script 'scripts/rm_mod' (as root). When unloading the modules
  separately mfII should be removed first.
