Skip to content

Commit

Permalink
Merge pull request #75 from OnionIoT/Issue-53
Browse files Browse the repository at this point in the history
[Issue-53]: add one wire device tree overlay
  • Loading branch information
greenbreakfast committed Nov 9, 2023
2 parents e556524 + 24e807f commit 105373f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions omega2-base/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2021 Onion Corporation
#
# Author: Lazar Demin <lazar@onion.io>
# Author: Lazar Demin <lazar@onioniot.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
Expand All @@ -9,7 +9,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=omega2-base
PKG_VERSION:=22.03.5
PKG_RELEASE:=20231031
PKG_RELEASE:=20231109


PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
Expand Down
10 changes: 10 additions & 0 deletions onion-dt-overlay/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,19 @@ define BuildDtbo
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/$(1).dtbo $$(1)/lib/firmware/device-tree/overlays/$(1).dtbo
endef

define Package/onion-dt-overlay-$(1)/postinst
#!/bin/sh

if [ -z "$${IPKG_INSTROOT}" ]; then
mkdir -p /sys/kernel/config/device-tree/overlays/$(1)
cat /lib/firmware/device-tree/overlays/$(1).dtbo > /sys/kernel/config/device-tree/overlays/$(1)/dtbo
fi
endef

$$(eval $$(call BuildPackage,onion-dt-overlay-$(1)))

endef

$(eval $(call BuildPackage,onion-dt-overlay))
$(eval $(call BuildDtbo,sw-spi,,Provides SW SPI))
$(eval $(call BuildDtbo,w1-gpio,+kmod-w1 +kmod-w1-master-gpio +kmod-w1-slave-therm,Provides One Wire GPIO))
16 changes: 16 additions & 0 deletions onion-dt-overlay/src/w1-gpio.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/dts-v1/;
/plugin/;

/ {
fragment@0 {
target-path = "/";

__overlay__ {
onewire:onewire {
compatible = "w1-gpio";
gpios = <&gpio 19 0>;
status = "okay";
};
};
};
};

0 comments on commit 105373f

Please sign in to comment.