[OpenWrt-Devel] [Patch] Support for BMP085 pressure sensor

Sergey Korolew ds at bittu.org.ru
Sun Jun 29 04:13:58 EDT 2014


Hello !

Bosch Sensortec is one of most popular pressure sensors for building home weather stations, its cheap and easy to use.
I decided to add two packages for each bus type because device usually have only one barometer and we does no need to waste firmware space for unused bus.
Tested on trunk, ar71xx (ML2030) with kernel 3.10, i2c only (due absent of spi version), but I added patch files for all current kernels.

===============================================================
--- a/target/linux/generic/patches-3.6/263-bmp085_dynamic.patch	1970-01-01 04:00:00.000000000 +0400
+++ b/target/linux/generic/patches-3.6/263-bmp085_dynamic.patch	2014-06-08 14:42:38.000000000 +0400
@@ -0,0 +1,11 @@
+--- a/drivers/misc/Kconfig	2014-04-03 23:01:22.000000000 +0400
++++ b/drivers/misc/Kconfig	2014-06-08 14:40:09.129048438 +0400
+@@ -453,7 +453,7 @@
+ 	  still useful.
+ 
+ config BMP085
+-	bool
++	tristate "BMP085 digital pressure sensor generic support"
+ 	depends on SYSFS
+ 
+ config BMP085_I2C
--- a/target/linux/generic/patches-3.8/263-bmp085_dynamic.patch	1970-01-01 04:00:00.000000000 +0400
+++ b/target/linux/generic/patches-3.8/263-bmp085_dynamic.patch	2014-06-08 14:42:38.000000000 +0400
@@ -0,0 +1,11 @@
+--- a/drivers/misc/Kconfig	2014-04-03 23:01:22.000000000 +0400
++++ b/drivers/misc/Kconfig	2014-06-08 14:40:09.129048438 +0400
+@@ -443,7 +443,7 @@
+ 	  still useful.
+ 
+ config BMP085
+-	bool
++	tristate "BMP085 digital pressure sensor generic support"
+ 	depends on SYSFS
+ 
+ config BMP085_I2C
--- a/target/linux/generic/patches-3.9/263-bmp085_dynamic.patch	1970-01-01 04:00:00.000000000 +0400
+++ b/target/linux/generic/patches-3.9/263-bmp085_dynamic.patch	2014-06-08 14:42:38.000000000 +0400
@@ -0,0 +1,11 @@
+--- a/drivers/misc/Kconfig	2014-04-03 23:01:22.000000000 +0400
++++ b/drivers/misc/Kconfig	2014-06-08 14:40:09.129048438 +0400
+@@ -443,7 +443,7 @@
+ 	  still useful.
+ 
+ config BMP085
+-	bool
++	tristate "BMP085 digital pressure sensor generic support"
+ 	depends on SYSFS
+ 
+ config BMP085_I2C
--- a/target/linux/generic/patches-3.10/263-bmp085_dynamic.patch	1970-01-01 04:00:00.000000000 +0400
+++ b/target/linux/generic/patches-3.10/263-bmp085_dynamic.patch	2014-06-08 14:42:38.000000000 +0400
@@ -0,0 +1,11 @@
+--- a/drivers/misc/Kconfig	2014-04-03 23:01:22.000000000 +0400
++++ b/drivers/misc/Kconfig	2014-06-08 14:40:09.129048438 +0400
+@@ -451,7 +451,7 @@
+ 	  still useful.
+ 
+ config BMP085
+-	bool
++	tristate "BMP085 digital pressure sensor generic support"
+ 	depends on SYSFS
+ 
+ config BMP085_I2C
--- a/target/linux/generic/patches-3.12/263-bmp085_dynamic.patch	1970-01-01 04:00:00.000000000 +0400
+++ b/target/linux/generic/patches-3.12/263-bmp085_dynamic.patch	2014-06-08 14:42:38.000000000 +0400
@@ -0,0 +1,11 @@
+--- a/drivers/misc/Kconfig	2014-04-03 23:01:22.000000000 +0400
++++ b/drivers/misc/Kconfig	2014-06-08 14:40:09.129048438 +0400
+@@ -451,7 +451,7 @@
+ 	  still useful.
+ 
+ config BMP085
+-	bool
++	tristate "BMP085 digital pressure sensor generic support"
+ 	depends on SYSFS
+ 
+ config BMP085_I2C
--- a/target/linux/generic/patches-3.13/263-bmp085_dynamic.patch	1970-01-01 04:00:00.000000000 +0400
+++ b/target/linux/generic/patches-3.13/263-bmp085_dynamic.patch	2014-06-08 14:42:38.000000000 +0400
@@ -0,0 +1,11 @@
+--- a/drivers/misc/Kconfig	2014-04-03 23:01:22.000000000 +0400
++++ b/drivers/misc/Kconfig	2014-06-08 14:40:09.129048438 +0400
+@@ -438,7 +438,7 @@
+ 	  still useful.
+ 
+ config BMP085
+-	bool
++	tristate "BMP085 digital pressure sensor generic support"
+ 	depends on SYSFS
+ 
+ config BMP085_I2C
--- a/target/linux/generic/patches-3.14/263-bmp085_dynamic.patch	1970-01-01 04:00:00.000000000 +0400
+++ b/target/linux/generic/patches-3.14/263-bmp085_dynamic.patch	2014-06-08 14:42:38.000000000 +0400
@@ -0,0 +1,11 @@
+--- a/drivers/misc/Kconfig	2014-04-03 23:01:22.000000000 +0400
++++ b/drivers/misc/Kconfig	2014-06-08 14:40:09.129048438 +0400
+@@ -438,7 +438,7 @@
+ 	  still useful.
+ 
+ config BMP085
+-	bool
++	tristate "BMP085 digital pressure sensor generic support"
+ 	depends on SYSFS
+ 
+ config BMP085_I2C
--- a/package/kernel/linux/modules/other.mk	2014-05-30 13:53:34.000000000 +0400
+++ b/package/kernel/linux/modules/other.mk	2014-06-08 16:47:48.315028290 +0400
@@ -698,6 +698,43 @@
 
 $(eval $(call KernelPackage,regmap))
 
+define KernelPackage/bmp085-i2c
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=BMP085 digital pressure sensor on I2C
+  KCONFIG:=CONFIG_BMP085_I2C \
+	   CONFIG_BMP085
+  DEPENDS:=+kmod-regmap
+  FILES:= \
+	$(LINUX_DIR)/drivers/misc/bmp085-i2c.ko \
+	$(LINUX_DIR)/drivers/misc/bmp085.ko
+  AUTOLOAD:=$(call AutoLoad,55,bmp085 bmp085-i2c)
+endef
+
+define KernelPackage/bmp085-i2c/description
+ Kernel module for BOSCH Sensortec pressure sensor on I2C
+endef
+
+$(eval $(call KernelPackage,bmp085-i2c))
+
+define KernelPackage/bmp085-spi
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=BMP085 digital pressure sensor on SPI
+  KCONFIG:=CONFIG_BMP085_SPI \
+	   CONFIG_BMP085
+  DEPENDS:=+kmod-regmap
+  FILES:= \
+	$(LINUX_DIR)/drivers/misc/bmp085-spi.ko \
+	$(LINUX_DIR)/drivers/misc/bmp085.ko
+  AUTOLOAD:=$(call AutoLoad,55,bmp085 bmp085-spi)
+endef
+
+define KernelPackage/bmp085-spi/description
+ Kernel module for BOSCH Sensortec pressure sensor on SPI
+endef
+
+$(eval $(call KernelPackage,bmp085-spi))
+
+
 define KernelPackage/ikconfig
   SUBMENU:=$(OTHER_MENU)
   TITLE:=Kernel configuration via /proc/config.gz
===============================================================

-- 
 Sergey                          mailto:ds at bittu.org.ru
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list