GPIO hardware buttons control with gpio-keys

Hi

We used to package Device Tree with some patches necessary for building for Raspberry Pi, but this is no longer necessary, and we are able to use the device tree compiler in the kernel tarball that we download.

OSMC doesn’t use ‘dtc’ from apt-get when building for Pi. It builds the in tree device tree compiler and adjusts PATH to prefer that one. If you are using the official OSMC build scripts it will all be handled for you.

I think something is wrong if you are having issues building DTBs. OSMC should build everything you need automatically and you should only need to adjust the patch which creates .config, and add a patch to add your driver.

Sam

Hi,

I’ll install a "“normal” osmc and try to compile the dts-file below without installing the device_tree package.

Regards,

Rob.

/dts-v1/;
/plugin/;
/ {
compatible = “brcm,bcm2835”, “brcm,bcm2708”, “brcm,bcm2709”;
fragment@0 {
target-path = “/”;
overlay {
keypad: comics_keys {
compatible = “gpio-keys”;
#address-cells = <1>;
#size-cells = <0>;
// autorepeat;
// key up = 1-1
button@13 {
label = “comics up”;
linux,code = <103>;
gpios = <&gpio 13 1>;
};
};
};
};
};

I’m not sure DT changes are necessary, but if they are, patch the DTS as a patches/ patch and OSMC will take care of it for you.

We build all overlays in the kernel build process.