From 1383d18ecceaf3c469993a2ae5424c0f5d2f2436 Mon Sep 17 00:00:00 2001 From: andreili Date: Sun, 17 Aug 2025 18:28:11 +0200 Subject: [PATCH] Add one wire support. --- cfg/kernel_v6.14-rc7 | 43 +++++++++++++++++-- patch/kernel/printer_defconfig_0_common.patch | 6 ++- tmp/rk3566-bigtreetech-cb2.dtsi | 16 +++++++ 3 files changed, 61 insertions(+), 4 deletions(-) diff --git a/cfg/kernel_v6.14-rc7 b/cfg/kernel_v6.14-rc7 index b164b12..eacc9c0 100644 --- a/cfg/kernel_v6.14-rc7 +++ b/cfg/kernel_v6.14-rc7 @@ -11,8 +11,8 @@ CONFIG_AS_VERSION=24400 CONFIG_LD_IS_BFD=y CONFIG_LD_VERSION=24400 CONFIG_LLD_VERSION=0 -CONFIG_RUSTC_VERSION=108800 -CONFIG_RUSTC_LLVM_VERSION=200105 +CONFIG_RUSTC_VERSION=108900 +CONFIG_RUSTC_LLVM_VERSION=200107 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y @@ -2540,7 +2540,42 @@ CONFIG_GPIO_ROCKCHIP=y # CONFIG_GPIO_VIRTUSER is not set # end of GPIO Debugging utilities -# CONFIG_W1 is not set +CONFIG_W1=y + +# +# 1-wire Bus Masters +# +# CONFIG_W1_MASTER_AMD_AXI is not set +# CONFIG_W1_MASTER_MATROX is not set +# CONFIG_W1_MASTER_DS2490 is not set +# CONFIG_W1_MASTER_DS2482 is not set +CONFIG_W1_MASTER_GPIO=y +# CONFIG_W1_MASTER_SGI is not set +# CONFIG_W1_MASTER_UART is not set +# end of 1-wire Bus Masters + +# +# 1-wire Slaves +# +CONFIG_W1_SLAVE_THERM=y +# CONFIG_W1_SLAVE_SMEM is not set +# CONFIG_W1_SLAVE_DS2405 is not set +# CONFIG_W1_SLAVE_DS2408 is not set +# CONFIG_W1_SLAVE_DS2413 is not set +# CONFIG_W1_SLAVE_DS2406 is not set +# CONFIG_W1_SLAVE_DS2423 is not set +# CONFIG_W1_SLAVE_DS2805 is not set +# CONFIG_W1_SLAVE_DS2430 is not set +# CONFIG_W1_SLAVE_DS2431 is not set +# CONFIG_W1_SLAVE_DS2433 is not set +# CONFIG_W1_SLAVE_DS2438 is not set +# CONFIG_W1_SLAVE_DS250X 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 +# end of 1-wire Slaves + CONFIG_POWER_RESET=y # CONFIG_POWER_RESET_GPIO is not set # CONFIG_POWER_RESET_GPIO_RESTART is not set @@ -2561,6 +2596,7 @@ CONFIG_POWER_SUPPLY_HWMON=y # CONFIG_TEST_POWER is not set # CONFIG_CHARGER_ADP5061 is not set # CONFIG_BATTERY_CW2015 is not set +# CONFIG_BATTERY_DS2760 is not set # CONFIG_BATTERY_DS2780 is not set # CONFIG_BATTERY_DS2781 is not set # CONFIG_BATTERY_DS2782 is not set @@ -2573,6 +2609,7 @@ CONFIG_POWER_SUPPLY_HWMON=y # CONFIG_BATTERY_MAX17040 is not set # CONFIG_BATTERY_MAX17042 is not set # CONFIG_BATTERY_MAX1720X is not set +# CONFIG_BATTERY_MAX1721X is not set # CONFIG_CHARGER_ISP1704 is not set # CONFIG_CHARGER_MAX8903 is not set # CONFIG_CHARGER_LP8727 is not set diff --git a/patch/kernel/printer_defconfig_0_common.patch b/patch/kernel/printer_defconfig_0_common.patch index ab7134a..e3a9560 100644 --- a/patch/kernel/printer_defconfig_0_common.patch +++ b/patch/kernel/printer_defconfig_0_common.patch @@ -3,7 +3,7 @@ new file mode 100644 index 000000000000..51de9e95b7d2 --- /dev/null +++ b/arch/arm64/configs/printer_defconfig -@@ -0,0 +1,513 @@ +@@ -0,0 +1,517 @@ +CONFIG_DEFAULT_HOSTNAME="Printer" +CONFIG_LOCALVERSION="-arm64" +CONFIG_LOCALVERSION_AUTO=n @@ -454,6 +454,10 @@ index 000000000000..51de9e95b7d2 +CONFIG_DEVFREQ_GOV_USERSPACE=y +CONFIG_DEVFREQ_GOV_PASSIVE=y +CONFIG_HW_RANDOM=y ++#sensors ++CONFIG_W1=y ++CONFIG_W1_MASTER_GPIO=y ++CONFIG_W1_SLAVE_THERM=y +#systemd +CONFIG_BPF_SYSCALL=y +CONFIG_CGROUP_BPF=y diff --git a/tmp/rk3566-bigtreetech-cb2.dtsi b/tmp/rk3566-bigtreetech-cb2.dtsi index 85fb75d..61c3f1f 100644 --- a/tmp/rk3566-bigtreetech-cb2.dtsi +++ b/tmp/rk3566-bigtreetech-cb2.dtsi @@ -225,6 +225,22 @@ regulator-name = "vcc_sd"; vin-supply = <&vcc3v3_sys>; }; + + onewire: onewire { + compatible = "w1-gpio"; + gpios = <&gpio4 RK_PB2 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&gpio_w1>; + status = "okay"; + }; +}; + +&pinctrl { + gpio-w1 { + gpio_w1:gpio-w1 { + rockchip,pins = <4 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; }; &combphy1 {