MS5611-01BA03 Barometric Pressure Sensor, with statinless steel cap.
- Clone driver code
git clone https://github.com/Sarlor/ms5611-driver.git
cd ms5611-driver/src
- Edit Makefile file, set the correct kernel directory 'KERN_DIR'
vim Makefile
- Copy the driver files to the 'hwmon' directory
make cp
- Add board-level support code to the appropriate place
vim arch/arm/plat-s5p4418/realarm/device.c
#if defined(CONFIG_SENSORS_MS561101BA) || defined(CONFIG_SENSORS_MS561101BA_MODULE)
#include <linux/i2c.h>
/* CODEC */
static struct i2c_board_info __initdata ms561101ba_i2c_bdi = {
.type = "ms561101ba",
.addr = 0x77
};
#endif
#if defined(CONFIG_SENSORS_MS561101BA) || defined(CONFIG_SENSORS_MS561101BA_MODULE)
printk("plat: add pressure MS5611-01BA03\n");
i2c_register_board_info(1, &ms561101ba_i2c_bdi, 1);
#endif
- Modify the kernel configuration file for ms5611, and add the code to the appropriate place
vim drivers/hwmon/Kconfig
config SENSORS_MS561101BA
tristate "MS5611-01BA03 Barometric Pressure Sensor"
depends on I2C
default n
help
Say Y here to enable the pressure sensor.
If unsure, say N.
- Edit Makefile for add ms5611 driver module
vim drivers/hwmon/Makefile
obj-$(CONFIG_SENSORS_MS561101BA) += ms561101ba.o
- Configure the kernel for required submodule, then save config
make menuconfig
Device Drivers -> Hardware Monitoring support -> MS5611-01BA03 Barometric Pressure Sensor