I compiled a linux kernel on my RasPi, following the Guide from the Raspberry Dokumentation and the Readme file from the driver sources.
sudo apt-get update
sudo apt-get upgrade
mkdir temp
cd temp
git clone --depth=1 https://github.com/raspberrypi/linux
# bc must be installed
sudo apt-get install bc
wget http://www.silabs.com/Support%20Documents/Software/Si70xx-Linux.zip
unzip Si70xx-Linux.zip
# After unzip Si7034.c starts with a uppcase letter
# I renamed it
mv Si7034.c si7034.c
cp *.c files to linux/drivers/hwmon
cp si7005 linux/Documentation/hwmon
cp si7034 linux/Documentation/hwmon
cp si70xx linux/Documentation/hwmon
cd linux/drivers/hwmon
# remove all occurrences of __devinit, __devexit and
# __devexit_p(<do not delete this content>) in the *.c file
# (there are no longer supported by modern kernels >= 3.8).
# edit the Makefile and Kconfig
# I used vi but nano can be used too ;-)
vi Makefile
# insert the drivers objectfiles between sis5595 and smm665
obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o
obj-$(CONFIG_SENSORS_SI7005) += si7005.o
obj-$(CONFIG_SENSORS_SI7034) += si7034.o
obj-$(CONFIG_SENSORS_SI70XX) += si70xx.o
obj-$(CONFIG_SENSORS_SMM665) += smm665.o
# save Makefile and exit vi
vi Kconfig
# search for SENSORS_SIS5595
# add the content of the Kconfig file from the
# driver zip before the config of SIS5595
# open file arch/arm/bcmrpi_defconfig
# search for HWMON (its a comment line)
# insert the following lines to it
CONFIG_HWMON=y
CONFIG_SENSORS_SI7005=m
CONFIG_SENSORS_SI70XX=m
CONFIG_SENSORS_SI7034=m
# go back to the linux dir
make bcmrpi_defconfig
# The first execution of make takes about 15h
# After it had completed the
# next runs (I started many of them ;-) ) took just minutes.
make
sudo make modules_install
sudo cp arch/arm/boot/Image /boot/kernel.img
sudo reboot
Then on my Pi modprobe si7005 worked even if had no sensor hardware connected.
I also tried to cross compile it on my linux box. (Linux Mint 17)
As mentioned in the driver description, the driver is part of the hwmon module. HWMON is not enabled by default if you use the bcmrpi_defconfig-defaults to configure the kernel using:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig
In your kernel sources there's a config file arch/arm/configs/bcmrpi_defconfig
.
Search for HWMON. That line is comment out. Edit the file by adding the following lines:
CONFIG_HWMON=y
CONFIG_SENSORS_SI7005=m
CONFIG_SENSORS_SI70XX=m
CONFIG_SENSORS_SI7034=m
Be sure to paste the drivers Kconfig into the drivers/hwmon/Kconfig
and add the object files to drivers/hwmon/Makefile
as described in the driver docs.
Then restart a build cycle:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
Because I had succes with my build on the RasPi, Idid not try the copy the cross compiled kernel to the device.