[PATCH 5/5] DO NOT MERGE: full sensehat device tree overlay for raspberry pi 4

Charles Mirabile posted 6 patches 3 years, 3 months ago
Only 5 patches received!
[PATCH 5/5] DO NOT MERGE: full sensehat device tree overlay for raspberry pi 4
Posted by Charles Mirabile 3 years, 3 months ago
This patch shold not be merged - dtbs files are not stored in the
kernel tree. We just provide this file so the code can be tested.

This overlay is suitable for testing the driver, it can be compiled with
dtc and put in the /boot/overlays/ folder then specified in config.txt
by putting the lines:

dtoverlay=		#suppress loading of default overlay for HAT
dtoverlay=sensehat	#load custom overlay

at the beginning before any other lines in config.txt

Co-developed-by: Joel Savitz <jsavitz@redhat.com>
Signed-off-by: Joel Savitz <jsavitz@redhat.com>
Signed-off-by: Charles Mirabile <cmirabil@redhat.com>
---
 sensehat.dtbs | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 sensehat.dtbs

diff --git a/sensehat.dtbs b/sensehat.dtbs
new file mode 100644
index 000000000000..9e5a6d9229b1
--- /dev/null
+++ b/sensehat.dtbs
@@ -0,0 +1,52 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+	compatible = "brcm,bcm2835";
+};
+
+&i2c1 {
+	#address-cells = <0x01>;
+	#size-cells = <0x00>;
+	status = "okay";
+
+	sensehat@46 {
+		compatible = "raspberrypi,sensehat";
+		reg = <0x46>;
+		interrupt-parent = <&gpio>;
+		status = "okay";
+		display {
+			compatible = "raspberrypi,sensehat-display";
+			status = "okay";
+		};
+		joystick {
+			compatible = "raspberrypi,sensehat-joystick";
+			interrupts = <23 1>;
+			status = "okay";
+		};
+	};
+
+	lsm9ds1-magn@1c {
+		compatible = "st,lsm9ds1-magn";
+		reg = <0x1c>;
+		status = "okay";
+	};
+
+	lsm9ds1-accel@6a {
+		compatible = "st,lsm9ds1-accel";
+		reg = <0x6a>;
+		status = "okay";
+	};
+
+	lps25h-press@5c {
+		compatible = "st,lps25h-press";
+		reg = <0x5c>;
+		status = "okay";
+	};
+
+	hts221-humid@5f {
+		compatible = "st,hts221-humid\0st,hts221";
+		reg = <0x5f>;
+		status = "okay";
+	};
+};
-- 
2.31.1
Re: [PATCH 5/5] DO NOT MERGE: full sensehat device tree overlay for raspberry pi 4
Posted by Bagas Sanjaya 3 years, 3 months ago
On Tue, Aug 23, 2022 at 01:41:58PM -0400, Charles Mirabile wrote:
> This patch shold not be merged - dtbs files are not stored in the
> kernel tree. We just provide this file so the code can be tested.
> 

Hmm, if this is DO NOT MERGE patch due to build artifacts (in this case
dtbs), then how testing of this driver can be done with just DT source
(like other drivers)? Does providing custom overlay needed for testing
it?

Thanks.

-- 
An old man doll... just what I always wanted! - Clara
Re: [PATCH 5/5] DO NOT MERGE: full sensehat device tree overlay for raspberry pi 4
Posted by Matthias Brugger 3 years, 3 months ago

On 06/09/2022 04:52, Bagas Sanjaya wrote:
> On Tue, Aug 23, 2022 at 01:41:58PM -0400, Charles Mirabile wrote:
>> This patch shold not be merged - dtbs files are not stored in the
>> kernel tree. We just provide this file so the code can be tested.
>>
> 
> Hmm, if this is DO NOT MERGE patch due to build artifacts (in this case
> dtbs), then how testing of this driver can be done with just DT source
> (like other drivers)? Does providing custom overlay needed for testing
> it?
> 

As it's a extension board to the RaspberryPi the DTs are not included into the 
Linux kernel. Instead an overlay is build which can be loaded to the base DT via 
a special mechanism of the RPi FW.

Adding this file helps anybody who wants to test the drivers to do so without 
any hustle.

Regards,
Matthias