From da7393d09223319dcb67a553abbc2a72aa410c36 Mon Sep 17 00:00:00 2001 From: Wangqiang Guo Date: Fri, 12 Nov 2021 16:56:53 +0800 Subject: [PATCH] arm64: dts: rockchip: rk3588s-evbx: add sensors dts Signed-off-by: Wangqiang Guo Change-Id: I664bf37bc8f4ad7642104cb2bb9d7561d57d8a04 --- .../boot/dts/rockchip/rk3588s-evb1-lp4x.dtsi | 55 ++++++++--- .../boot/dts/rockchip/rk3588s-evb2-lp5.dtsi | 57 ++++++++++++ .../boot/dts/rockchip/rk3588s-evb4-lp4x.dtsi | 93 +++++++++++++++---- 3 files changed, 170 insertions(+), 35 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-evb1-lp4x.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-evb1-lp4x.dtsi index 566045e57d18..996a3f25b891 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-evb1-lp4x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s-evb1-lp4x.dtsi @@ -62,6 +62,15 @@ }; }; + hall_sensor: hall-mh248 { + compatible = "hall-mh248"; + pinctrl-names = "default"; + pinctrl-0 = <&mh248_irq_gpio>; + irq-gpio = <&gpio0 RK_PD4 IRQ_TYPE_EDGE_BOTH>; + hall-active = <1>; + status = "okay"; + }; + rk_headset: rk-headset { status = "okay"; compatible = "rockchip_headset"; @@ -316,20 +325,32 @@ &i2c5 { status = "okay"; - mpu6500@68 { + ls_stk3332: light@47 { + compatible = "ls_stk3332"; status = "disabled"; - compatible = "invensense,mpu6500"; - reg = <0x68>; - irq-gpio = <&gpio3 RK_PB4 IRQ_TYPE_EDGE_RISING>; - pinctrl-names = "default"; - pinctrl-0 = <&mpu6500_irq_gpio>; - mpu-int_config = <0x10>; - mpu-level_shifter = <0>; - mpu-orientation = <0 1 0 1 0 0 0 0 1>; - orientation-x= <0>; - orientation-y= <0>; - orientation-z= <0>; - mpu-debug = <1>; + reg = <0x47>; + type = ; + irq_enable = <0>; + als_threshold_high = <100>; + als_threshold_low = <10>; + als_ctrl_gain = <2>; /* 0:x1 1:x4 2:x16 3:x64 */ + poll_delay_ms = <100>; + }; + + ps_stk3332: proximity@47 { + compatible = "ps_stk3332"; + status = "disabled"; + reg = <0x47>; + type = ; + //pinctrl-names = "default"; + //pinctrl-0 = <&gpio3_c6>; + //irq-gpio = <&gpio3 RK_PC6 IRQ_TYPE_LEVEL_LOW>; + //irq_enable = <1>; + ps_threshold_high = <0x200>; + ps_threshold_low = <0x100>; + ps_ctrl_gain = <3>; /* 0:x1 1:x2 2:x5 3:x8 */ + ps_led_current = <4>; /* 0:3.125mA 1:6.25mA 2:12.5mA 3:25mA 4:50mA 5:100mA*/ + poll_delay_ms = <100>; }; mpu6500_acc: mpu_acc@68 { @@ -459,8 +480,12 @@ }; }; - mpu6500 { - mpu6500_irq_gpio: mpu6500-irq-gpio { + sensor { + mh248_irq_gpio: mh248_irq_gpio { + rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + mpu6500_irq_gpio: mpu6500_irq_gpio { rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; }; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-evb2-lp5.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-evb2-lp5.dtsi index 04d2805d57ea..06c2f4d47e4f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-evb2-lp5.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s-evb2-lp5.dtsi @@ -704,6 +704,57 @@ }; }; +&i2c5 { + status = "okay"; + + ls_stk3332: light@47 { + compatible = "ls_stk3332"; + status = "disabled"; + reg = <0x47>; + type = ; + irq_enable = <0>; + als_threshold_high = <100>; + als_threshold_low = <10>; + als_ctrl_gain = <2>; /* 0:x1 1:x4 2:x16 3:x64 */ + poll_delay_ms = <100>; + }; + + ps_stk3332: proximity@47 { + compatible = "ps_stk3332"; + status = "disabled"; + reg = <0x47>; + type = ; + //pinctrl-names = "default"; + //pinctrl-0 = <&gpio3_c6>; + //irq-gpio = <&gpio3 RK_PC6 IRQ_TYPE_LEVEL_LOW>; + //irq_enable = <1>; + ps_threshold_high = <0x200>; + ps_threshold_low = <0x100>; + ps_ctrl_gain = <3>; /* 0:x1 1:x2 2:x5 3:x8 */ + ps_led_current = <4>; /* 0:3.125mA 1:6.25mA 2:12.5mA 3:25mA 4:50mA 5:100mA*/ + poll_delay_ms = <100>; + }; + + mpu6500_acc: mpu_acc@68 { + compatible = "mpu6500_acc"; + reg = <0x68>; + irq-gpio = <&gpio3 RK_PB4 IRQ_TYPE_EDGE_RISING>; + irq_enable = <0>; + poll_delay_ms = <30>; + type = ; + layout = <8>; + }; + + mpu6500_gyro: mpu_gyro@68 { + compatible = "mpu6500_gyro"; + reg = <0x68>; + irq_enable = <0>; + poll_delay_ms = <30>; + type = ; + layout = <8>; + }; +}; + &i2c6 { status = "okay"; pinctrl-names = "default"; @@ -781,6 +832,12 @@ }; }; + sensor { + mpu6500_irq_gpio: mpu6500_irq_gpio { + rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + touch { touch_gpio: touch-gpio { rockchip,pins = diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-evb4-lp4x.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-evb4-lp4x.dtsi index c5d3fbb79862..ad7dcefb08e2 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-evb4-lp4x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s-evb4-lp4x.dtsi @@ -266,6 +266,29 @@ }; }; +&i2c3 { + status = "okay"; + + es8388: es8388@11 { + status = "okay"; + #sound-dai-cells = <0>; + compatible = "everest,es8388", "everest,es8323"; + reg = <0x11>; + clocks = <&cru I2S0_8CH_MCLKOUT>; + clock-names = "mclk"; + pinctrl-names = "default"; + pinctrl-0 = <&i2s0_mclk>; + spk-con-gpio = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>; + }; + + es7202: es7202@32 { + status = "okay"; + #sound-dai-cells = <0>; + compatible = "ES7202_PDM_ADC_1"; + reg = <0x32>; + }; +}; + &i2c4 { status = "okay"; pinctrl-names = "default"; @@ -281,30 +304,54 @@ }; }; -&i2c3 { +&i2c5 { status = "okay"; - es8388: es8388@11 { - status = "okay"; - #sound-dai-cells = <0>; - compatible = "everest,es8388", "everest,es8323"; - reg = <0x11>; - clocks = <&cru I2S0_8CH_MCLKOUT>; - clock-names = "mclk"; - assigned-clocks = <&cru I2S0_8CH_MCLKOUT>; - assigned-clock-rates = <12288000>; - pinctrl-names = "default"; - pinctrl-0 = <&i2s0_mclk>; - spk-con-gpio = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>; - hp-con-gpio = <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>; - extcon = <&rk_headset>; + ls_stk3332: light@47 { + compatible = "ls_stk3332"; + status = "disabled"; + reg = <0x47>; + type = ; + irq_enable = <0>; + als_threshold_high = <100>; + als_threshold_low = <10>; + als_ctrl_gain = <2>; /* 0:x1 1:x4 2:x16 3:x64 */ + poll_delay_ms = <100>; }; - es7202: es7202@32 { - status = "okay"; - #sound-dai-cells = <0>; - compatible = "ES7202_PDM_ADC_1"; - reg = <0x32>; + ps_stk3332: proximity@47 { + compatible = "ps_stk3332"; + status = "disabled"; + reg = <0x47>; + type = ; + //pinctrl-names = "default"; + //pinctrl-0 = <&gpio3_c6>; + //irq-gpio = <&gpio3 RK_PC6 IRQ_TYPE_LEVEL_LOW>; + //irq_enable = <1>; + ps_threshold_high = <0x200>; + ps_threshold_low = <0x100>; + ps_ctrl_gain = <3>; /* 0:x1 1:x2 2:x5 3:x8 */ + ps_led_current = <4>; /* 0:3.125mA 1:6.25mA 2:12.5mA 3:25mA 4:50mA 5:100mA*/ + poll_delay_ms = <100>; + }; + + mpu6500_acc: mpu_acc@68 { + compatible = "mpu6500_acc"; + reg = <0x68>; + irq-gpio = <&gpio3 RK_PB4 IRQ_TYPE_EDGE_RISING>; + irq_enable = <0>; + poll_delay_ms = <30>; + type = ; + layout = <8>; + }; + + mpu6500_gyro: mpu_gyro@68 { + compatible = "mpu6500_gyro"; + reg = <0x68>; + irq_enable = <0>; + poll_delay_ms = <30>; + type = ; + layout = <8>; }; }; @@ -420,6 +467,12 @@ }; }; + sensor { + mpu6500_irq_gpio: mpu6500_irq_gpio { + rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + touch { touch_gpio: touch-gpio { rockchip,pins =