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

Sergey Korolew ds at bittu.org.ru
Sun Jun 29 14:11:44 EDT 2014


Hello !

Here is the v2 of the patch, with suggestions from John Crispin. Three 
packages (one main and two for i2c/spi) selected using submenu.
Kernel patch separated from other.mk part, possibly we will have it 
included in linux kernel.

===================================================================
--- a/package/kernel/linux/modules/other.mk	2014-06-29 
15:21:39.359850523 +0400
+++ b/package/kernel/linux/modules/other.mk	2014-06-29 
15:17:27.000000000 +0400
@@ -698,6 +698,54 @@

  $(eval $(call KernelPackage,regmap))

+
+define KernelPackage/bmp085
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=BMP085 digital pressure sensor
+  KCONFIG:=CONFIG_BMP085
+  DEPENDS:=+kmod-regmap
+  FILES:= \
+	$(LINUX_DIR)/drivers/misc/bmp085.ko
+endef
+
+define KernelPackage/bmp085/description
+ Kernel module for BOSCH Sensortec pressure sensor generic support
+endef
+
+$(eval $(call KernelPackage,bmp085))
+
+define KernelPackage/bmp085-i2c
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=BMP085 sensor on I2C bus
+  KCONFIG:=CONFIG_BMP085_I2C
+  FILES:= \
+	$(LINUX_DIR)/drivers/misc/bmp085-i2c.ko
+  DEPENDS:=kmod-bmp085
+  AUTOLOAD:=$(call AutoProbe,bmp085-i2c)
+endef
+
+define KernelPackage/bmp085-i2c/description
+ Kernel module for BOSCH Sensortec pressure sensor on I2C bus
+endef
+
+$(eval $(call KernelPackage,bmp085-i2c))
+
+define KernelPackage/bmp085-spi
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=BMP085 sensor on SPI bus
+  KCONFIG:=CONFIG_BMP085_SPI
+  FILES:= \
+	$(LINUX_DIR)/drivers/misc/bmp085-spi.ko
+  DEPENDS:=kmod-bmp085
+  AUTOLOAD:=$(call AutoProbe,bmp085-spi)
+endef
+
+define KernelPackage/bmp085-spi/description
+ Kernel module for BOSCH Sensortec pressure sensor on SPI bus
+endef
+
+$(eval $(call KernelPackage,bmp085-spi))
+
  define KernelPackage/ikconfig
    SUBMENU:=$(OTHER_MENU)
    TITLE:=Kernel configuration via /proc/config.gz
===================================================================

Kernel part, adapted for OpenWRT, if someone want to compile now.
Actually its only replace bool with tristate.
===================================================================
--- 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
===================================================================
_______________________________________________
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