From 40ab5ee22b0055e2a67a73bdcda94217d23fe2a0 Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Fri, 7 Dec 2018 16:23:35 -0500 Subject: [PATCH] add W1-GPIO overlay to rockchip64 --- config/kernel/linux-rockchip64-dev.config | 32 ++++++++++++++++++- .../general-rockchip-overlays.patch | 31 ++++++++++++++++-- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/config/kernel/linux-rockchip64-dev.config b/config/kernel/linux-rockchip64-dev.config index 3eda3d983a..6878c9a434 100644 --- a/config/kernel/linux-rockchip64-dev.config +++ b/config/kernel/linux-rockchip64-dev.config @@ -2900,7 +2900,37 @@ CONFIG_GPIO_MAX77620=y # # USB GPIO expanders # -# CONFIG_W1 is not set + +CONFIG_W1=m +# +# 1-wire Bus Masters +# +# CONFIG_W1_MASTER_DS2490 is not set +# CONFIG_W1_MASTER_DS2482 is not set +# CONFIG_W1_MASTER_DS1WM is not set +CONFIG_W1_MASTER_GPIO=m + +# +# 1-wire Slaves +# +CONFIG_W1_SLAVE_THERM=m +CONFIG_W1_SLAVE_SMEM=m +CONFIG_W1_SLAVE_DS2405=m +CONFIG_W1_SLAVE_DS2408=m +CONFIG_W1_SLAVE_DS2408_READBACK=y +CONFIG_W1_SLAVE_DS2413=m +CONFIG_W1_SLAVE_DS2406=m +CONFIG_W1_SLAVE_DS2423=m +# CONFIG_W1_SLAVE_DS2805 is not set +CONFIG_W1_SLAVE_DS2431=m +CONFIG_W1_SLAVE_DS2433=m +# CONFIG_W1_SLAVE_DS2433_CRC is not set +# CONFIG_W1_SLAVE_DS2438 is not set +# CONFIG_W1_SLAVE_DS2780 is not set +# CONFIG_W1_SLAVE_DS2781 is not set +# CONFIG_W1_SLAVE_DS28E04 is not set +# CONFIG_W1_SLAVE_DS28E17 is not set + CONFIG_POWER_AVS=y CONFIG_ROCKCHIP_IODOMAIN=m CONFIG_POWER_RESET=y diff --git a/patch/kernel/rockchip64-dev/general-rockchip-overlays.patch b/patch/kernel/rockchip64-dev/general-rockchip-overlays.patch index 3ffe178d9c..b79704f41b 100644 --- a/patch/kernel/rockchip64-dev/general-rockchip-overlays.patch +++ b/patch/kernel/rockchip64-dev/general-rockchip-overlays.patch @@ -12,10 +12,11 @@ diff --git a/arch/arm64/boot/dts/rockchip/overlay/Makefile b/arch/arm64/boot/dts index e69de29..576e190 100644 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlay/Makefile -@@ -0,0 +1,16 @@ +@@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0 +dtbo-$(CONFIG_ARCH_ROCKCHIP) += \ -+ rockchip-i2c8.dtbo ++ rockchip-i2c8.dtbo \ ++ rockchip-w1-gpio.dtbo + +scr-$(CONFIG_ARCH_ROCKCHIP) += \ + rockchip-fixup.scr @@ -81,6 +82,32 @@ index 0000000..54bc844 + }; + }; +}; +diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-w1-gpio.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-w1-gpio.dts +new file mode 100644 +index 0000000..bfbc16a +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-w1-gpio.dts +@@ -0,0 +1,20 @@ ++// Definitions for w1-gpio module (without external pullup) ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "rockchip,rk3399"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ ++ w1: onewire@0 { ++ compatible = "w1-gpio"; ++ pinctrl-names = "default"; ++ gpios = <&gpio1 4 0 0xae>; // GPIO1_A4 ++ status = "okay"; ++ }; ++ }; ++ }; ++}; diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 26e6af4..65b9435 100644 --- a/scripts/Makefile.lib