Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue-53]: add one wire device tree overlay #75

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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";
};
};
};
};