huangliang 87498f5edd first commit(v1.0) пре 3 година
..
Makefile 87498f5edd first commit(v1.0) пре 3 година
README 87498f5edd first commit(v1.0) пре 3 година
driver_load.sh 87498f5edd first commit(v1.0) пре 3 година
hx280enc.c 87498f5edd first commit(v1.0) пре 3 година
hx280enc.h 87498f5edd first commit(v1.0) пре 3 година

README


-- BUILD --

You need a fully configured kernel source tree in order to build the
driver. Please set the location of the kernel tree in the Makefile (KDIR).
If you want some extra debug information in the kernel logs, you could
define the HX280ENC_DEBUG but please be aware that allot of things are traced
with this option.
Also you could set a particular device MAJOR in the 'hx280enc.c' if you don't want
dynamic allocation.

Just run in this dir:

%make

If you want to install the modules please check first the install destination
in the Makefile (MDIR, DEST) and run:

%make install

-- USAGE --

Run script driver_load.sh to do all the things described below.
> sh driver_load.sh base_port=0xc0000000 irq=30

The parameters that can be set when loading the driver are the HW IO base
address and the assigned IRQ number. The default values are:
base_port=0xc0000000 and irq=30

First of all the module has to be inserted into the kernel with:
(you need a Linux shell cmd line)

%insmod hx280enc.o base_port=0xc0000000 irq=30

Set the correct values for the HW IO base address and the IRQ number if
the default values compiled into the module are not valid.

Second of all a char device file has to be created:

%mknod /tmp/dev/hx280 c 254 0

Replace MAJOR = 254 with the correct value (i.e. read /proc/devices to find out
the exact value).

Make sure that you have RW rights for the newly created dev file (use 'chmod').

The 'driver_load' script is provided for preparing all the things necessary for
the driver to be usable. The script is using 'cat' to retrieve the device's
major from /proc/devices. Remember to set the driver parameters.