0558-BCM270X_DT-Add-i2c-sensor-overlay.patch 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. From ec94d922b57bb7d6586eaf1e1af02e9383680d15 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Mon, 5 Dec 2016 17:10:44 +0000
  4. Subject: [PATCH] BCM270X_DT: Add i2c-sensor overlay
  5. The i2c-sensor overlay is a container for various pressure and
  6. temperature sensors, currently bmp085 and bmp280. The standalone
  7. bmp085_i2c-sensor overlay is now deprecated.
  8. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  9. ---
  10. arch/arm/boot/dts/overlays/Makefile | 1 +
  11. arch/arm/boot/dts/overlays/README | 12 ++++++--
  12. arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 34 +++++++++++++++++++++++
  13. 3 files changed, 45 insertions(+), 2 deletions(-)
  14. create mode 100644 arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
  15. --- a/arch/arm/boot/dts/overlays/Makefile
  16. +++ b/arch/arm/boot/dts/overlays/Makefile
  17. @@ -42,6 +42,7 @@ dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
  18. dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo
  19. dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo
  20. dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
  21. +dtbo-$(RPI_DT_OVERLAYS) += i2c-sensor.dtbo
  22. dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
  23. dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
  24. dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31.dtbo
  25. --- a/arch/arm/boot/dts/overlays/README
  26. +++ b/arch/arm/boot/dts/overlays/README
  27. @@ -283,8 +283,7 @@ Params: swap_lr Reverse
  28. Name: bmp085_i2c-sensor
  29. -Info: Configures the BMP085/BMP180 digital barometric pressure and temperature
  30. - sensors from Bosch Sensortec
  31. +Info: This overlay is now deprecated - see i2c-sensor
  32. Load: dtoverlay=bmp085_i2c-sensor
  33. Params: <None>
  34. @@ -536,6 +535,15 @@ Params: abx80x Select o
  35. source
  36. +Name: i2c-sensor
  37. +Info: Adds support for a number of I2C barometric pressure and temperature
  38. + sensors on i2c_arm
  39. +Load: dtoverlay=i2c-sensor,<param>=<val>
  40. +Params: bmp085 Select the Bosch sensortronic BMP085
  41. +
  42. + bmp280 Select the Bosch sensortronic BMP280
  43. +
  44. +
  45. Name: i2c0-bcm2708
  46. Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations
  47. are usable on all platforms.
  48. --- /dev/null
  49. +++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
  50. @@ -0,0 +1,34 @@
  51. +// Definitions for a few digital barometric pressure and temperature sensors
  52. +/dts-v1/;
  53. +/plugin/;
  54. +
  55. +/ {
  56. + compatible = "brcm,bcm2708";
  57. +
  58. + fragment@0 {
  59. + target = <&i2c_arm>;
  60. + __overlay__ {
  61. + #address-cells = <1>;
  62. + #size-cells = <0>;
  63. + status = "okay";
  64. +
  65. + bmp085: bmp085@77 {
  66. + compatible = "bosch,bmp085";
  67. + reg = <0x77>;
  68. + default-oversampling = <3>;
  69. + status = "disable";
  70. + };
  71. +
  72. + bmp280: bmp280@76 {
  73. + compatible = "bosch,bmp280";
  74. + reg = <0x76>;
  75. + status = "disable";
  76. + };
  77. + };
  78. + };
  79. +
  80. + __overrides__ {
  81. + bmp085 = <&bmp085>,"status";
  82. + bmp280 = <&bmp280>,"status";
  83. + };
  84. +};