From df6287579d5b8608a78b2780f1070885f3f003da Mon Sep 17 00:00:00 2001 From: Feng Zhang Date: Wed, 10 Jul 2024 16:34:55 +0800 Subject: [PATCH] rock 5d: add antenna toggle switch Signed-off-by: Feng Zhang --- .../arm64/boot/dts/rockchip/overlays/Makefile | 1 + .../rockchip/overlays/rock-5d-ext-antenna.dts | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rock-5d-ext-antenna.dts diff --git a/arch/arm64/boot/dts/rockchip/overlays/Makefile b/arch/arm64/boot/dts/rockchip/overlays/Makefile index 76540037..2d6aee15 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/Makefile +++ b/arch/arm64/boot/dts/rockchip/overlays/Makefile @@ -449,6 +449,7 @@ dtb-$(CONFIG_CLK_RK3588) += \ rock-5b-radxa-display-8hd.dtbo \ rock-5b-rpi-camera-v2.dtbo \ rock-5b-sata.dtbo \ + rock-5d-ext-antenna.dtbo \ rock-5d-rpi-camera-v1p3.dtbo \ rock-5d-rpi-camera-v2.dtbo \ rock-5d-okdo-camera-5mp.dtbo \ diff --git a/arch/arm64/boot/dts/rockchip/overlays/rock-5d-ext-antenna.dts b/arch/arm64/boot/dts/rockchip/overlays/rock-5d-ext-antenna.dts new file mode 100644 index 00000000..3ffb69fd --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rock-5d-ext-antenna.dts @@ -0,0 +1,35 @@ +/dts-v1/; +/plugin/; +#include +#include + +/ { + metadata { + title = "Enable External Antenna"; + compatible = "radxa,rock-5d"; + category = "misc"; + exclusive = "GPIO0_B2"; + description = "Enable External Antenna."; + }; +}; + +&{/} { + antenna_mux: antenna-mux { + status = "okay"; + compatible = "regulator-fixed"; + regulator-name = "antenna_mux"; + gpio = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; + regulator-always-on; + regulator-boot-on; + pinctrl-0 = <&ant_mux>; + pinctrl-names = "default"; + }; +}; + +&pinctrl { + antenna { + ant_mux: ant-mux { + rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; +};