From: T-Firefly Date: Tue, 19 Dec 2017 09:19:40 +0000 (+0800) Subject: ARM64: DTS: update firefly dts X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=02ebaf5ddb3cb9beafae297f3e29874d5262249d;p=firefly-linux-kernel-4.4.55.git ARM64: DTS: update firefly dts --- diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly-aio-linux.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly-aio-linux.dts index 4252921d3632..d389a70084a4 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly-aio-linux.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly-aio-linux.dts @@ -242,7 +242,7 @@ regulator-always-on; regulator-boot-on; //gpio = <&gpio1 17 GPIO_ACTIVE_HIGH>; - gpio = <&gpio2 2 GPIO_ACTIVE_HIGH>; + gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pcie_drv>; regulator-name = "vcc3v3_pcie"; @@ -257,7 +257,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pcie_3g_drv>; regulator-name = "vcc3v3_3g"; - }; + }; vcc3v3_sys: vcc3v3-sys { compatible = "regulator-fixed"; @@ -370,7 +370,7 @@ label = "firefly:blue:power"; linux,default-trigger = "ir-power-click"; default-state = "on"; - gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&led_power>; }; @@ -378,7 +378,7 @@ label = "firefly:yellow:user"; linux,default-trigger = "ir-user-click"; default-state = "off"; - gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&led_user>; }; @@ -511,6 +511,7 @@ #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <0>; + //ddc-i2c-bus = <&i2c3>; status = "okay"; }; @@ -765,8 +766,9 @@ pinctrl-0 = <&rt5640_hpcon>; hp-con-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>; //hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>; - aux-det-gpio = <&gpio2 0 GPIO_ACTIVE_LOW>; - io-channels = <&saradc 4>; + aux-det-adc-value = <1000>; + io-channels = <&saradc 4>, <&saradc 2>; + io-channel-names = "hp-det", "aux-det"; hp-det-adc-value = <500>; }; }; @@ -803,9 +805,9 @@ revert_y = <0>; touch-gpio = <&gpio4 28 IRQ_TYPE_LEVEL_LOW>; reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; + }; - mpu6050:mpu@68{ + mpu6050: mpu@68 { status = "disabled"; compatible = "invensense,mpu6050"; reg = <0x68>; @@ -841,8 +843,8 @@ }; &i2s2 { - status = "okay"; #sound-dai-cells = <0>; + status = "okay"; }; &io_domains { @@ -874,41 +876,30 @@ &pinctrl { buttons { pwrbtn: pwrbtn { - rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 5 RK_FUNC_GPIO &pcfg_pull_up>; }; }; lcd-panel { lcd_panel_reset: lcd-panel-reset { - rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <4 29 RK_FUNC_GPIO &pcfg_pull_up>; }; - lcd_en: lcd-en { - rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 1 RK_FUNC_GPIO &pcfg_pull_up>; }; }; pcie { pcie_drv: pcie-drv { rockchip,pins = - <2 2 RK_FUNC_GPIO &pcfg_pull_none>; + <0 13 RK_FUNC_GPIO &pcfg_pull_none>; }; pcie_3g_drv: pcie-3g-drv { - rockchip,pins = - <2 6 RK_FUNC_GPIO &pcfg_pull_up>; - }; - - }; - - pmic { - vsel1_gpio: vsel1-gpio { rockchip,pins = - <1 18 RK_FUNC_GPIO &pcfg_pull_down>; - }; - - vsel2_gpio: vsel2-gpio { - rockchip,pins = - <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + <2 6 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -929,17 +920,18 @@ leds { led_power: led-power { rockchip,pins = - <2 27 RK_FUNC_GPIO &pcfg_pull_none>; + <2 7 RK_FUNC_GPIO &pcfg_pull_none>; }; led_user: led-user { rockchip,pins = - <0 13 RK_FUNC_GPIO &pcfg_pull_none>; + <2 2 RK_FUNC_GPIO &pcfg_pull_none>; }; }; rt5640 { rt5640_hpcon: rt5640-hpcon { - rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <4 21 RK_FUNC_GPIO &pcfg_pull_none>; }; }; @@ -948,7 +940,6 @@ rockchip,pins = <1 21 RK_FUNC_GPIO &pcfg_pull_up>; }; - pmic_dvs2: pmic-dvs2 { rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; @@ -963,11 +954,11 @@ }; vsel1_gpio: vsel1-gpio { rockchip,pins = - <1 18 0 &pcfg_pull_down>; + <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; vsel2_gpio: vsel2-gpio { rockchip,pins = - <1 14 0 &pcfg_pull_down>; + <1 14 RK_FUNC_GPIO &pcfg_pull_down>; }; }; @@ -980,9 +971,11 @@ fusb30x { fusb0_int: fusb0-int { - rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 2 RK_FUNC_GPIO &pcfg_pull_up>; }; }; + vbus { vbus_5v_drv: vbus-5v-drv { rockchip,pins = @@ -996,7 +989,7 @@ }; &pwm1 { - status = "okay"; + status = "okay"; }; &pwm2 { @@ -1023,26 +1016,32 @@ }; &cdn_dp { - status = "disabled"; - extcon = <&fusb0>; - phys = <&tcphy0_dp>; + status = "disabled"; + extcon = <&fusb0>; + phys = <&tcphy0_dp>; }; -&hdmi_in_vopl { +&dp_in_vopb { status = "disabled"; }; -&dsi_in_vopb { +&hdmi_in_vopb { status = "okay"; }; -&dsi_in_vopl { +&hdmi_in_vopl { + status = "disabled"; +}; + +/* +&dsi_in_vopb { status = "okay"; }; -&dp_in_vopb { - status = "disabled"; +&dsi_in_vopl { + status = "disabled"; }; +*/ &saradc { status = "okay"; @@ -1068,7 +1067,7 @@ disable-wp; num-slots = <1>; vqmmc-supply = <&vcc_sd>; - pwrseq-gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>; + pwrseq-gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; status = "okay"; @@ -1171,7 +1170,7 @@ remote_pwm_id = <3>; handle_cpu_id = <0>; - ir_key1{ + ir_key1 { rockchip,usercode = <0xff00>; rockchip,key_table = <0xeb KEY_POWER>, @@ -1200,9 +1199,9 @@ }; &uart4 { - status = "disabled"; current-speed = <9600>; no-loopback-test; + status = "okay"; }; &usbdrd3_0 { diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux-edp.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux-edp.dts index afb686f930e3..2de55694b69c 100755 --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux-edp.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux-edp.dts @@ -106,6 +106,7 @@ }; edp_panel: edp-panel { + status = "okay"; compatible = "sharp,lcd-f402", "panel-simple"; backlight = <&backlight>; power-supply = <&vcc_lcd>; @@ -246,6 +247,17 @@ regulator-name = "vcc3v3_pcie"; }; + vcc3v3_3g: vcc3v3-3g-regulator { + compatible = "regulator-fixed"; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_3g_drv>; + regulator-name = "vcc3v3_3g"; + }; + vcc3v3_sys: vcc3v3-sys { compatible = "regulator-fixed"; regulator-name = "vcc3v3_sys"; @@ -286,7 +298,7 @@ pwms = <&pwm2 0 25000 1>; regulator-name = "vdd_log"; regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1400000>; + regulator-max-microvolt = <1100000>; regulator-always-on; regulator-boot-on; @@ -422,7 +434,7 @@ pinctrl-names = "default"; pinctrl-0 = <&rgmii_pins>; tx_delay = <0x28>; - rx_delay = <0x11>; + rx_delay = <0x1B>; status = "okay"; }; @@ -435,7 +447,7 @@ #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <0>; - ddc-i2c-bus = <&i2c3>; + //ddc-i2c-bus = <&i2c3>; status = "okay"; }; @@ -487,8 +499,10 @@ reg = <0x1b>; interrupt-parent = <&gpio1>; interrupts = <21 IRQ_TYPE_LEVEL_LOW>; + pmic,stby-gpio = <&gpio1 24 GPIO_ACTIVE_LOW>; + pmic,hold-gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; - pinctrl-0 = <&pmic_int_l &pmic_dvs2>; + pinctrl-0 = <&pmic_int_l &pmic_dvs2 &pmic_stby &pmic_hold>; rockchip,system-power-controller; wakeup-source; #clock-cells = <1>; @@ -708,28 +722,32 @@ status = "okay"; }; - gsl3680: gsl3680@41 { - status = "okay"; - compatible = "gslX680-pad"; - reg = <0x41>; - screen_max_x = <1536>; - screen_max_y = <2048>; - touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>; - reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; - - mpu6050:mpu@68{ - compatible = "invensense,mpu6050"; - reg = <0x68>; - mpu-int_config = <0x10>; - mpu-level_shifter = <0>; - mpu-orientation = <0 1 0 1 0 0 0 0 1>; - orientation-x= <1>; - orientation-y= <1>; - orientation-z= <1>; - irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; - mpu-debug = <1>; - }; + gsl3680: gsl3680@41 { + status = "okay"; + compatible = "gslX680"; + reg = <0x41>; + screen_max_x = <1536>; + screen_max_y = <2048>; + revert_xy = <0>; + revert_x = <0>; + revert_y = <0>; + touch-gpio = <&gpio4 28 IRQ_TYPE_LEVEL_LOW>; + reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + + mpu6050: mpu@68 { + status = "disabled"; + compatible = "invensense,mpu6050"; + reg = <0x68>; + mpu-int_config = <0x10>; + mpu-level_shifter = <0>; + mpu-orientation = <0 1 0 1 0 0 0 0 1>; + orientation-x= <1>; + orientation-y= <1>; + orientation-z= <1>; + irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; + mpu-debug = <1>; + }; }; &i2s0 { @@ -786,17 +804,19 @@ &pinctrl { buttons { pwrbtn: pwrbtn { - rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 5 RK_FUNC_GPIO &pcfg_pull_up>; }; }; lcd-panel { lcd_panel_reset: lcd-panel-reset { - rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <4 29 RK_FUNC_GPIO &pcfg_pull_up>; }; - lcd_en: lcd-en { - rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 1 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -804,12 +824,11 @@ pcie_drv: pcie-drv { rockchip,pins = <1 17 RK_FUNC_GPIO &pcfg_pull_none>; - }; - pcie_3g_drv: pcie-3g-drv { + }; + pcie_3g_drv: pcie-3g-drv { rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>; }; - }; pmic { @@ -817,10 +836,17 @@ rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; - vsel2_gpio: vsel2-gpio { rockchip,pins = - <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + }; + pmic_stby: pmic-stby { + rockchip,pins = + <1 24 RK_FUNC_GPIO &pcfg_pull_up>; + }; + pmic_hold: pmic-hold{ + rockchip,pins = + <1 13 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -840,17 +866,19 @@ leds { led_power: led-power { - rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <2 27 RK_FUNC_GPIO &pcfg_pull_none>; }; - led_user: led-user { - rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 13 RK_FUNC_GPIO &pcfg_pull_none>; }; }; rt5640 { rt5640_hpcon: rt5640-hpcon { - rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <4 21 RK_FUNC_GPIO &pcfg_pull_none>; }; }; @@ -859,7 +887,6 @@ rockchip,pins = <1 21 RK_FUNC_GPIO &pcfg_pull_up>; }; - pmic_dvs2: pmic-dvs2 { rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; @@ -907,6 +934,32 @@ logo,mode = "center"; }; +&cdn_dp { + status = "disabled"; + extcon = <&fusb0>; + phys = <&tcphy0_dp>; +}; + +&dp_in_vopb { + status = "disabled"; +}; + +&hdmi_in_vopb { + status = "disabled"; +}; + +&hdmi_in_vopl { + status = "okay"; +}; + +&edp_in_vopb { + status = "okay"; +}; + +&edp_in_vopl { + status = "disabled"; +}; + &saradc { status = "okay"; vref-supply = <&vccadc_ref>; @@ -1011,7 +1064,7 @@ remote_pwm_id = <3>; handle_cpu_id = <0>; - ir_key1{ + ir_key1 { rockchip,usercode = <0xff00>; rockchip,key_table = <0xeb KEY_POWER>, @@ -1039,6 +1092,12 @@ status = "okay"; }; +&uart4 { + current-speed = <9600>; + no-loopback-test; + status = "okay"; +}; + &usbdrd3_0 { status = "okay"; extcon = <&fusb0>; diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux-mipi.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux-mipi.dts index 09f544a4565c..fda4c4a6a876 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux-mipi.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux-mipi.dts @@ -256,7 +256,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pcie_3g_drv>; regulator-name = "vcc3v3_3g"; - }; + }; vcc3v3_sys: vcc3v3-sys { compatible = "regulator-fixed"; @@ -499,6 +499,7 @@ #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <0>; + //ddc-i2c-bus = <&i2c3>; status = "okay"; }; @@ -550,8 +551,10 @@ reg = <0x1b>; interrupt-parent = <&gpio1>; interrupts = <21 IRQ_TYPE_LEVEL_LOW>; + pmic,stby-gpio = <&gpio1 24 GPIO_ACTIVE_LOW>; + pmic,hold-gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; - pinctrl-0 = <&pmic_int_l &pmic_dvs2>; + pinctrl-0 = <&pmic_int_l &pmic_dvs2 &pmic_stby &pmic_hold>; rockchip,system-power-controller; wakeup-source; #clock-cells = <1>; @@ -777,22 +780,25 @@ reg = <0x40>; screen_max_x = <1536>; screen_max_y = <2048>; + revert_xy = <0>; + revert_x = <0>; + revert_y = <0>; touch-gpio = <&gpio4 28 IRQ_TYPE_LEVEL_LOW>; reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; + }; - mpu6050:mpu@68{ - status = "disabled"; - compatible = "invensense,mpu6050"; - reg = <0x68>; - mpu-int_config = <0x10>; - mpu-level_shifter = <0>; - mpu-orientation = <0 1 0 1 0 0 0 0 1>; - orientation-x= <1>; - orientation-y= <1>; - orientation-z= <1>; - irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; - mpu-debug = <1>; + mpu6050: mpu@68 { + status = "disabled"; + compatible = "invensense,mpu6050"; + reg = <0x68>; + mpu-int_config = <0x10>; + mpu-level_shifter = <0>; + mpu-orientation = <0 1 0 1 0 0 0 0 1>; + orientation-x= <1>; + orientation-y= <1>; + orientation-z= <1>; + irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; + mpu-debug = <1>; }; }; @@ -850,28 +856,31 @@ &pinctrl { buttons { pwrbtn: pwrbtn { - rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 5 RK_FUNC_GPIO &pcfg_pull_up>; }; }; + lcd-panel { lcd_panel_reset: lcd-panel-reset { - rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <4 29 RK_FUNC_GPIO &pcfg_pull_up>; }; - lcd_en: lcd-en { - rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 1 RK_FUNC_GPIO &pcfg_pull_up>; }; }; + pcie { pcie_drv: pcie-drv { rockchip,pins = <1 17 RK_FUNC_GPIO &pcfg_pull_none>; }; pcie_3g_drv: pcie-3g-drv { - rockchip,pins = + rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>; }; - }; pmic { @@ -879,10 +888,17 @@ rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; - vsel2_gpio: vsel2-gpio { rockchip,pins = - <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + }; + pmic_stby: pmic-stby { + rockchip,pins = + <1 24 RK_FUNC_GPIO &pcfg_pull_up>; + }; + pmic_hold: pmic-hold{ + rockchip,pins = + <1 13 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -902,17 +918,19 @@ leds { led_power: led-power { - rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <2 27 RK_FUNC_GPIO &pcfg_pull_none>; }; - led_user: led-user { - rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 13 RK_FUNC_GPIO &pcfg_pull_none>; }; }; rt5640 { rt5640_hpcon: rt5640-hpcon { - rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <4 21 RK_FUNC_GPIO &pcfg_pull_none>; }; }; @@ -921,7 +939,6 @@ rockchip,pins = <1 21 RK_FUNC_GPIO &pcfg_pull_up>; }; - pmic_dvs2: pmic-dvs2 { rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; @@ -974,25 +991,29 @@ }; &cdn_dp { - status = "disabled"; - extcon = <&fusb0>; - phys = <&tcphy0_dp>; + status = "disabled"; + extcon = <&fusb0>; + phys = <&tcphy0_dp>; }; -&hdmi_in_vopl { +&dp_in_vopb { status = "disabled"; }; -&dsi_in_vopb { +&hdmi_in_vopb { + status = "disabled"; +}; + +&hdmi_in_vopl { status = "okay"; }; -&dsi_in_vopl { +&dsi_in_vopb { status = "okay"; }; -&dp_in_vopb { - status = "disabled"; +&dsi_in_vopl { + status = "disabled"; }; &saradc { @@ -1099,7 +1120,7 @@ remote_pwm_id = <3>; handle_cpu_id = <0>; - ir_key1{ + ir_key1 { rockchip,usercode = <0xff00>; rockchip,key_table = <0xeb KEY_POWER>, diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux.dts index 44a8d24ed9ab..fd5d8d4dd944 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly-linux.dts @@ -256,7 +256,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pcie_3g_drv>; regulator-name = "vcc3v3_3g"; - }; + }; vcc3v3_sys: vcc3v3-sys { compatible = "regulator-fixed"; @@ -447,6 +447,7 @@ #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <0>; + //ddc-i2c-bus = <&i2c3>; status = "okay"; }; @@ -721,29 +722,32 @@ status = "okay"; }; - gsl3680: gsl3680@41 { - status = "disabled"; - compatible = "gslX680-pad"; - reg = <0x41>; - screen_max_x = <1536>; - screen_max_y = <2048>; - touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>; - reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; - - mpu6050:mpu@68{ - status = "disabled"; - compatible = "invensense,mpu6050"; - reg = <0x68>; - mpu-int_config = <0x10>; - mpu-level_shifter = <0>; - mpu-orientation = <0 1 0 1 0 0 0 0 1>; - orientation-x= <1>; - orientation-y= <1>; - orientation-z= <1>; - irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; - mpu-debug = <1>; - }; + gsl3680: gsl3680@40 { + status = "disabled"; + compatible = "gslX680"; + reg = <0x40>; + screen_max_x = <1536>; + screen_max_y = <2048>; + revert_xy = <0>; + revert_x = <0>; + revert_y = <0>; + touch-gpio = <&gpio4 28 IRQ_TYPE_LEVEL_LOW>; + reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + + mpu6050: mpu@68 { + status = "disabled"; + compatible = "invensense,mpu6050"; + reg = <0x68>; + mpu-int_config = <0x10>; + mpu-level_shifter = <0>; + mpu-orientation = <0 1 0 1 0 0 0 0 1>; + orientation-x= <1>; + orientation-y= <1>; + orientation-z= <1>; + irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; + mpu-debug = <1>; + }; }; &i2s0 { @@ -800,17 +804,19 @@ &pinctrl { buttons { pwrbtn: pwrbtn { - rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 5 RK_FUNC_GPIO &pcfg_pull_up>; }; }; lcd-panel { lcd_panel_reset: lcd-panel-reset { - rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <4 29 RK_FUNC_GPIO &pcfg_pull_up>; }; - lcd_en: lcd-en { - rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 1 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -820,10 +826,9 @@ <1 17 RK_FUNC_GPIO &pcfg_pull_none>; }; pcie_3g_drv: pcie-3g-drv { - rockchip,pins = + rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>; }; - }; pmic { @@ -831,21 +836,18 @@ rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; - vsel2_gpio: vsel2-gpio { rockchip,pins = - <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + <1 14 RK_FUNC_GPIO &pcfg_pull_down>; }; pmic_stby: pmic-stby { rockchip,pins = <1 24 RK_FUNC_GPIO &pcfg_pull_up>; }; - pmic_hold: pmic-hold{ rockchip,pins = <1 13 RK_FUNC_GPIO &pcfg_pull_up>; }; - }; sdio-pwrseq { @@ -864,17 +866,19 @@ leds { led_power: led-power { - rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <2 27 RK_FUNC_GPIO &pcfg_pull_none>; }; - led_user: led-user { - rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 13 RK_FUNC_GPIO &pcfg_pull_none>; }; }; rt5640 { rt5640_hpcon: rt5640-hpcon { - rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <4 21 RK_FUNC_GPIO &pcfg_pull_none>; }; }; @@ -883,7 +887,6 @@ rockchip,pins = <1 21 RK_FUNC_GPIO &pcfg_pull_up>; }; - pmic_dvs2: pmic-dvs2 { rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; @@ -932,13 +935,21 @@ }; &cdn_dp { - status = "disabled"; - extcon = <&fusb0>; - phys = <&tcphy0_dp>; + status = "disabled"; + extcon = <&fusb0>; + phys = <&tcphy0_dp>; }; &dp_in_vopb { - status = "disabled"; + status = "disabled"; +}; + +&hdmi_in_vopb { + status = "okay"; +}; + +&hdmi_in_vopl { + status = "disabled"; }; &saradc { @@ -1045,7 +1056,7 @@ remote_pwm_id = <3>; handle_cpu_id = <0>; - ir_key1{ + ir_key1 { rockchip,usercode = <0xff00>; rockchip,key_table = <0xeb KEY_POWER>, diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux-edp.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux-edp.dts index 999e145e9ed2..a90874548dc4 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux-edp.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux-edp.dts @@ -105,7 +105,7 @@ #sound-dai-cells = <0>; }; - edp_panel: edp-panel { + edp_panel: edp-panel { status = "okay"; compatible = "sharp,lcd-f402", "panel-simple"; backlight = <&backlight>; @@ -121,7 +121,7 @@ }; }; - fiq_debugger: fiq-debugger { + fiq_debugger: fiq-debugger { compatible = "rockchip,fiq-debugger"; rockchip,serial-id = <2>; rockchip,signal-irq = <182>; @@ -178,21 +178,20 @@ simple-audio-card,format = "i2s"; simple-audio-card,name = "rockchip,es8323-codec"; simple-audio-card,mclk-fs = <256>; - simple-audio-card,widgets = + simple-audio-card,widgets = "Microphone","Mic Jack", "Headphone","Headphone Jack"; - simple-audio-card,routing = + simple-audio-card,routing = "Mic Jack","MICBIAS1", "IN1P","Mic Jack", "Headphone Jack","HPOL", "Headphone Jack","HPOR"; simple-audio-card,cpu { - sound-dai = <&i2c1>; + sound-dai = <&i2s1>; }; simple-audio-card,codec { sound-dai = <&es8323>; }; - }; hdmi_sound: hdmi-sound { @@ -219,7 +218,6 @@ simple-audio-card,cpu { sound-dai = <&i2s2>; }; - simple-audio-card,codec { sound-dai = <&hdmi>; }; @@ -272,6 +270,17 @@ regulator-always-on; }; + vbus_5v: vbus-5v-regulator { + compatible = "regulator-fixed"; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vbus_5v_drv>; + regulator-name = "vbus_5v"; + }; + vcc5v0_sys: vcc5v0-sys { compatible = "regulator-fixed"; regulator-name = "vcc5v0_sys"; @@ -335,7 +344,7 @@ compatible = "bluetooth-platdata"; //wifi-bt-power-toggle; clocks = <&rk808 1>; - clock-names = "ext_clock"; + clock-names = "ext_clock"; uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */ pinctrl-names = "default", "rts_gpio"; pinctrl-0 = <&uart0_rts>; @@ -348,7 +357,6 @@ }; leds { - status = "disabled"; compatible = "gpio-leds"; power { label = "firefly:blue:power"; @@ -397,7 +405,7 @@ status = "okay"; }; -&edp { +&edp { status = "okay"; ports { @@ -443,6 +451,7 @@ #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <0>; + //ddc-i2c-bus = <&i2c3>; status = "okay"; }; @@ -494,8 +503,10 @@ reg = <0x1b>; interrupt-parent = <&gpio1>; interrupts = <21 IRQ_TYPE_LEVEL_LOW>; + pmic,stby-gpio = <&gpio1 24 GPIO_ACTIVE_LOW>; + pmic,hold-gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; - pinctrl-0 = <&pmic_int_l &pmic_dvs2>; + pinctrl-0 = <&pmic_int_l &pmic_dvs2 &pmic_stby &pmic_hold>; rockchip,system-power-controller; wakeup-source; #clock-cells = <1>; @@ -678,7 +689,7 @@ i2c-scl-rising-time-ns = <300>; i2c-scl-falling-time-ns = <15>; - es8323: es8323@10{ + es8323: es8323@10 { compatible = "everest,es8323"; reg = <0x10>; ear-con-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; @@ -691,6 +702,7 @@ pinctrl-names = "default"; pinctrl-0 = <&es8323_earcon &es8323_hpdet>; }; + rt5640: rt5640@1c { status = "disabled"; #sound-dai-cells = <0>; @@ -708,7 +720,7 @@ }; }; -&i2c3 { +&i2c3 { status = "okay"; i2c-scl-rising-time-ns = <450>; i2c-scl-falling-time-ns = <15>; @@ -726,32 +738,35 @@ pinctrl-0 = <&fusb0_int>; int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; vbus-5v-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + status = "disabled"; + }; + + gsl3680: gsl3680@41 { status = "okay"; + compatible = "gslX680"; + reg = <0x41>; + screen_max_x = <1536>; + screen_max_y = <2048>; + revert_xy = <0>; + revert_x = <0>; + revert_y = <0>; + touch-gpio = <&gpio4 28 IRQ_TYPE_LEVEL_LOW>; + reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; }; - gsl3680: gsl3680@41 { - status = "okay"; - compatible = "gslX680-pad"; - reg = <0x41>; - screen_max_x = <1536>; - screen_max_y = <2048>; - touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>; - reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; - - mpu6050:mpu@68{ - status = "disabled"; - compatible = "invensense,mpu6050"; - reg = <0x68>; - mpu-int_config = <0x10>; - mpu-level_shifter = <0>; - mpu-orientation = <0 1 0 1 0 0 0 0 1>; - orientation-x= <1>; - orientation-y= <1>; - orientation-z= <1>; - irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; - mpu-debug = <1>; - }; + mpu6050: mpu@68 { + status = "disabled"; + compatible = "invensense,mpu6050"; + reg = <0x68>; + mpu-int_config = <0x10>; + mpu-level_shifter = <0>; + mpu-orientation = <0 1 0 1 0 0 0 0 1>; + orientation-x= <1>; + orientation-y= <1>; + orientation-z= <1>; + irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; + mpu-debug = <1>; + }; }; &i2s0 { @@ -768,10 +783,11 @@ rockchip,playback-channels = <2>; rockchip,capture-channels = <2>; #sound-dai-cells = <0>; + assigned-clocks = <&cru SCLK_I2S1_DIV>, <&cru SCLK_I2S_8CH>; + assigned-clock-parents = <&cru PLL_GPLL>, <&cru SCLK_I2S1_8CH>; }; &i2s2 { - #sound-dai-cells = <0>; status = "okay"; }; @@ -803,32 +819,33 @@ }; &pinctrl { - buttons { + buttons { pwrbtn: pwrbtn { - rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 5 RK_FUNC_GPIO &pcfg_pull_up>; }; }; lcd-panel { lcd_panel_reset: lcd-panel-reset { - rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <4 29 RK_FUNC_GPIO &pcfg_pull_up>; }; - lcd_en: lcd-en { - rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 1 RK_FUNC_GPIO &pcfg_pull_up>; }; }; - pcie { + pcie { pcie_drv: pcie-drv { rockchip,pins = <1 17 RK_FUNC_GPIO &pcfg_pull_none>; - }; - pcie_3g_drv: pcie-3g-drv { + }; + pcie_3g_drv: pcie-3g-drv { rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>; }; - }; pmic { @@ -836,10 +853,17 @@ rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; - vsel2_gpio: vsel2-gpio { rockchip,pins = - <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + }; + pmic_stby: pmic-stby { + rockchip,pins = + <1 24 RK_FUNC_GPIO &pcfg_pull_up>; + }; + pmic_hold: pmic-hold{ + rockchip,pins = + <1 13 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -860,26 +884,30 @@ leds { led_power: led-power { - rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <2 27 RK_FUNC_GPIO &pcfg_pull_none>; }; - led_user: led-user { - rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 13 RK_FUNC_GPIO &pcfg_pull_none>; }; }; rt5640 { rt5640_hpcon: rt5640-hpcon { - rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <4 21 RK_FUNC_GPIO &pcfg_pull_none>; }; }; es8223 { es8323_hpdet: es8323-hpdet { - rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 11 RK_FUNC_GPIO &pcfg_pull_up>; }; es8323_earcon: es8323-earcon { - rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 12 RK_FUNC_GPIO &pcfg_pull_none>; }; }; @@ -888,12 +916,10 @@ rockchip,pins = <1 21 RK_FUNC_GPIO &pcfg_pull_up>; }; - pmic_dvs2: pmic-dvs2 { rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; - }; usb2 { @@ -903,10 +929,17 @@ }; }; - fusb30x { fusb0_int: fusb0-int { - rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 2 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + vbus { + vbus_5v_drv: vbus-5v-drv { + rockchip,pins = + <1 3 RK_FUNC_GPIO &pcfg_pull_up>; }; }; }; @@ -923,7 +956,7 @@ status = "okay"; }; -&rockchip_suspend { +&rockchip_suspend { rockchip,power-ctrl = <&gpio1 18 GPIO_ACTIVE_LOW>, <&gpio1 14 GPIO_ACTIVE_HIGH>; @@ -939,13 +972,29 @@ }; &cdn_dp { - status = "disabled"; - extcon = <&fusb0>; - phys = <&tcphy0_dp>; + status = "disabled"; + extcon = <&fusb0>; + phys = <&tcphy0_dp>; }; &dp_in_vopb { - status = "disabled"; + status = "disabled"; +}; + +&hdmi_in_vopb { + status = "disabled"; +}; + +&hdmi_in_vopl { + status = "okay"; +}; + +&edp_in_vopb { + status = "okay"; +}; + +&edp_in_vopl { + status = "disabled"; }; &saradc { @@ -994,11 +1043,11 @@ }; &tcphy0 { - extcon = <&fusb0>; + //extcon = <&fusb0>; status = "okay"; }; -&tcphy1 { +&tcphy1 { status = "okay"; }; @@ -1010,9 +1059,9 @@ status = "okay"; }; -&u2phy0 { +&u2phy0 { status = "okay"; - extcon = <&fusb0>; + //extcon = <&fusb0>; u2phy0_otg: otg-port { status = "okay"; @@ -1037,14 +1086,14 @@ }; }; -&pwm3 { +&pwm3 { status = "okay"; interrupts = ; compatible = "rockchip,remotectl-pwm"; remote_pwm_id = <3>; handle_cpu_id = <0>; - ir_key1{ + ir_key1 { rockchip,usercode = <0xff00>; rockchip,key_table = <0xeb KEY_POWER>, @@ -1068,49 +1117,57 @@ status = "okay"; }; -&uart2 { +&uart2 { status = "okay"; }; -&usbdrd3_0 { +&uart4 { + current-speed = <9600>; + no-loopback-test; status = "okay"; - extcon = <&fusb0>; }; -&usbdrd3_1 { +&usbdrd3_0 { + status = "okay"; + //extcon = <&fusb0>; +}; + +&usbdrd3_1 { status = "okay"; }; &usbdrd_dwc3_0 { status = "okay"; + //dr_mode = "peripheral"; + dr_mode = "host"; }; -&usbdrd_dwc3_1 { +&usbdrd_dwc3_1 { status = "okay"; dr_mode = "host"; }; - -&usb_host0_ehci { + +&usb_host0_ehci { status = "okay"; }; -&usb_host0_ohci { +&usb_host0_ohci { status = "okay"; }; -&usb_host1_ehci { +&usb_host1_ehci { status = "okay"; }; -&usb_host1_ohci { +&usb_host1_ohci { status = "okay"; }; -&vopb { +&vopb { status = "okay"; }; -&vopb_mmu { +&vopb_mmu { status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux-mipi.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux-mipi.dts index 84decf71fcb7..42dd2cfa4005 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux-mipi.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux-mipi.dts @@ -344,7 +344,7 @@ compatible = "bluetooth-platdata"; //wifi-bt-power-toggle; clocks = <&rk808 1>; - clock-names = "ext_clock"; + clock-names = "ext_clock"; uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */ pinctrl-names = "default", "rts_gpio"; pinctrl-0 = <&uart0_rts>; @@ -356,23 +356,23 @@ status = "okay"; }; - leds { - compatible = "gpio-leds"; - power { - label = "firefly:blue:power"; - linux,default-trigger = "ir-power-click"; - default-state = "on"; - gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&led_power>; - }; - user { - label = "firefly:yellow:user"; - linux,default-trigger = "ir-user-click"; - default-state = "off"; - gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&led_user>; + leds { + compatible = "gpio-leds"; + power { + label = "firefly:blue:power"; + linux,default-trigger = "ir-power-click"; + default-state = "on"; + gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&led_power>; + }; + user { + label = "firefly:yellow:user"; + linux,default-trigger = "ir-user-click"; + default-state = "off"; + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&led_user>; }; }; }; @@ -498,7 +498,7 @@ pinctrl-names = "default"; pinctrl-0 = <&rgmii_pins>; tx_delay = <0x28>; - rx_delay = <0x11>; + rx_delay = <0x1B>; status = "okay"; }; @@ -511,6 +511,7 @@ #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <0>; + //ddc-i2c-bus = <&i2c3>; status = "okay"; }; @@ -562,8 +563,10 @@ reg = <0x1b>; interrupt-parent = <&gpio1>; interrupts = <21 IRQ_TYPE_LEVEL_LOW>; + pmic,stby-gpio = <&gpio1 24 GPIO_ACTIVE_LOW>; + pmic,hold-gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; - pinctrl-0 = <&pmic_int_l &pmic_dvs2>; + pinctrl-0 = <&pmic_int_l &pmic_dvs2 &pmic_stby &pmic_hold>; rockchip,system-power-controller; wakeup-source; #clock-cells = <1>; @@ -746,7 +749,7 @@ i2c-scl-rising-time-ns = <300>; i2c-scl-falling-time-ns = <15>; - es8323: es8323@10{ + es8323: es8323@10 { compatible = "everest,es8323"; reg = <0x10>; ear-con-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; @@ -759,6 +762,7 @@ pinctrl-names = "default"; pinctrl-0 = <&es8323_earcon &es8323_hpdet>; }; + rt5640: rt5640@1c { status = "disabled"; #sound-dai-cells = <0>; @@ -803,6 +807,9 @@ reg = <0x40>; screen_max_x = <1536>; screen_max_y = <2048>; + revert_xy = <0>; + revert_x = <0>; + revert_y = <0>; touch-gpio = <&gpio4 28 IRQ_TYPE_LEVEL_LOW>; reset-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>; }; @@ -874,17 +881,19 @@ &pinctrl { buttons { pwrbtn: pwrbtn { - rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 5 RK_FUNC_GPIO &pcfg_pull_up>; }; }; lcd-panel { lcd_panel_reset: lcd-panel-reset { - rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <4 29 RK_FUNC_GPIO &pcfg_pull_up>; }; - lcd_en: lcd-en { - rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 1 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -892,8 +901,8 @@ pcie_drv: pcie-drv { rockchip,pins = <1 17 RK_FUNC_GPIO &pcfg_pull_none>; - }; - pcie_3g_drv: pcie-3g-drv { + }; + pcie_3g_drv: pcie-3g-drv { rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>; }; @@ -904,10 +913,17 @@ rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; - vsel2_gpio: vsel2-gpio { rockchip,pins = - <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + }; + pmic_stby: pmic-stby { + rockchip,pins = + <1 24 RK_FUNC_GPIO &pcfg_pull_up>; + }; + pmic_hold: pmic-hold{ + rockchip,pins = + <1 13 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -928,25 +944,30 @@ leds { led_power: led-power { - rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <2 27 RK_FUNC_GPIO &pcfg_pull_none>; }; - led_user: led-user { - rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 13 RK_FUNC_GPIO &pcfg_pull_none>; }; }; + rt5640 { rt5640_hpcon: rt5640-hpcon { - rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <4 21 RK_FUNC_GPIO &pcfg_pull_none>; }; }; es8223 { es8323_hpdet: es8323-hpdet { - rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 11 RK_FUNC_GPIO &pcfg_pull_up>; }; es8323_earcon: es8323-earcon { - rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 12 RK_FUNC_GPIO &pcfg_pull_none>; }; }; @@ -955,7 +976,6 @@ rockchip,pins = <1 21 RK_FUNC_GPIO &pcfg_pull_up>; }; - pmic_dvs2: pmic-dvs2 { rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; @@ -971,13 +991,15 @@ fusb30x { fusb0_int: fusb0-int { - rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 2 RK_FUNC_GPIO &pcfg_pull_up>; }; }; vbus { vbus_5v_drv: vbus-5v-drv { - rockchip,pins = <1 3 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 3 RK_FUNC_GPIO &pcfg_pull_up>; }; }; }; @@ -1019,6 +1041,22 @@ status = "disabled"; }; +&hdmi_in_vopb { + status = "disabled"; +}; + +&hdmi_in_vopl { + status = "okay"; +}; + +&dsi_in_vopb { + status = "okay"; +}; + +&dsi_in_vopl { + status = "disabled"; +}; + &saradc { status = "okay"; vref-supply = <&vccadc_ref>; @@ -1064,7 +1102,7 @@ status = "okay"; }; -&tcphy0 { +&tcphy0 { //extcon = <&fusb0>; status = "okay"; }; @@ -1115,7 +1153,7 @@ remote_pwm_id = <3>; handle_cpu_id = <0>; - ir_key1{ + ir_key1 { rockchip,usercode = <0xff00>; rockchip,key_table = <0xeb KEY_POWER>, @@ -1143,6 +1181,12 @@ status = "okay"; }; +&uart4 { + current-speed = <9600>; + no-loopback-test; + status = "okay"; +}; + &usbdrd3_0 { status = "okay"; //extcon = <&fusb0>; @@ -1197,4 +1241,6 @@ &vpu { status = "okay"; + /* 0 means ion, 1 means drm */ + //allocator = <0>; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux.dts index 025e43fce19a..e6cbffe7bc55 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly-mini-linux.dts @@ -105,7 +105,7 @@ #sound-dai-cells = <0>; }; - edp_panel: edp-panel { + edp_panel: edp-panel { status = "disabled"; compatible = "sharp,lcd-f402", "panel-simple"; backlight = <&backlight>; @@ -121,7 +121,7 @@ }; }; - fiq_debugger: fiq-debugger { + fiq_debugger: fiq-debugger { compatible = "rockchip,fiq-debugger"; rockchip,serial-id = <2>; rockchip,signal-irq = <182>; @@ -178,10 +178,10 @@ simple-audio-card,format = "i2s"; simple-audio-card,name = "rockchip,es8323-codec"; simple-audio-card,mclk-fs = <256>; - simple-audio-card,widgets = + simple-audio-card,widgets = "Microphone","Mic Jack", "Headphone","Headphone Jack"; - simple-audio-card,routing = + simple-audio-card,routing = "Mic Jack","MICBIAS1", "IN1P","Mic Jack", "Headphone Jack","HPOL", @@ -192,7 +192,6 @@ simple-audio-card,codec { sound-dai = <&es8323>; }; - }; hdmi_sound: hdmi-sound { @@ -219,7 +218,6 @@ simple-audio-card,cpu { sound-dai = <&i2s2>; }; - simple-audio-card,codec { sound-dai = <&hdmi>; }; @@ -346,7 +344,7 @@ compatible = "bluetooth-platdata"; //wifi-bt-power-toggle; clocks = <&rk808 1>; - clock-names = "ext_clock"; + clock-names = "ext_clock"; uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */ pinctrl-names = "default", "rts_gpio"; pinctrl-0 = <&uart0_rts>; @@ -407,7 +405,7 @@ status = "okay"; }; -&edp { +&edp { status = "disabled"; ports { @@ -440,7 +438,7 @@ pinctrl-names = "default"; pinctrl-0 = <&rgmii_pins>; tx_delay = <0x28>; - rx_delay = <0x11>; + rx_delay = <0x1B>; status = "okay"; }; @@ -453,6 +451,7 @@ #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <0>; + //ddc-i2c-bus = <&i2c3>; status = "okay"; }; @@ -504,8 +503,10 @@ reg = <0x1b>; interrupt-parent = <&gpio1>; interrupts = <21 IRQ_TYPE_LEVEL_LOW>; + pmic,stby-gpio = <&gpio1 24 GPIO_ACTIVE_LOW>; + pmic,hold-gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; - pinctrl-0 = <&pmic_int_l &pmic_dvs2>; + pinctrl-0 = <&pmic_int_l &pmic_dvs2 &pmic_stby &pmic_hold>; rockchip,system-power-controller; wakeup-source; #clock-cells = <1>; @@ -688,7 +689,7 @@ i2c-scl-rising-time-ns = <300>; i2c-scl-falling-time-ns = <15>; - es8323: es8323@10{ + es8323: es8323@10 { compatible = "everest,es8323"; reg = <0x10>; ear-con-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; @@ -701,6 +702,7 @@ pinctrl-names = "default"; pinctrl-0 = <&es8323_earcon &es8323_hpdet>; }; + rt5640: rt5640@1c { status = "disabled"; #sound-dai-cells = <0>; @@ -718,7 +720,7 @@ }; }; -&i2c3 { +&i2c3 { status = "okay"; i2c-scl-rising-time-ns = <450>; i2c-scl-falling-time-ns = <15>; @@ -739,29 +741,32 @@ status = "disabled"; }; - gsl3680: gsl3680@41 { - status = "disabled"; - compatible = "gslX680-pad"; - reg = <0x41>; - screen_max_x = <1536>; - screen_max_y = <2048>; - touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>; - reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; - - mpu6050:mpu@68{ - status = "disabled"; - compatible = "invensense,mpu6050"; - reg = <0x68>; - mpu-int_config = <0x10>; - mpu-level_shifter = <0>; - mpu-orientation = <0 1 0 1 0 0 0 0 1>; - orientation-x= <1>; - orientation-y= <1>; - orientation-z= <1>; - irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; - mpu-debug = <1>; - }; + gsl3680: gsl3680@40 { + status = "disabled"; + compatible = "gslX680"; + reg = <0x40>; + screen_max_x = <1536>; + screen_max_y = <2048>; + revert_xy = <0>; + revert_x = <0>; + revert_y = <0>; + touch-gpio = <&gpio4 28 IRQ_TYPE_LEVEL_LOW>; + reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + + mpu6050: mpu@68 { + status = "disabled"; + compatible = "invensense,mpu6050"; + reg = <0x68>; + mpu-int_config = <0x10>; + mpu-level_shifter = <0>; + mpu-orientation = <0 1 0 1 0 0 0 0 1>; + orientation-x= <1>; + orientation-y= <1>; + orientation-z= <1>; + irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>; + mpu-debug = <1>; + }; }; &i2s0 { @@ -783,7 +788,6 @@ }; &i2s2 { - #sound-dai-cells = <0>; status = "okay"; }; @@ -815,32 +819,33 @@ }; &pinctrl { - buttons { + buttons { pwrbtn: pwrbtn { - rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 5 RK_FUNC_GPIO &pcfg_pull_up>; }; }; lcd-panel { lcd_panel_reset: lcd-panel-reset { - rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <4 29 RK_FUNC_GPIO &pcfg_pull_up>; }; - lcd_en: lcd-en { - rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 1 RK_FUNC_GPIO &pcfg_pull_up>; }; }; - pcie { + pcie { pcie_drv: pcie-drv { rockchip,pins = <1 17 RK_FUNC_GPIO &pcfg_pull_none>; - }; - pcie_3g_drv: pcie-3g-drv { + }; + pcie_3g_drv: pcie-3g-drv { rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>; }; - }; pmic { @@ -848,10 +853,17 @@ rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; - vsel2_gpio: vsel2-gpio { rockchip,pins = - <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + <1 14 RK_FUNC_GPIO &pcfg_pull_down>; + }; + pmic_stby: pmic-stby { + rockchip,pins = + <1 24 RK_FUNC_GPIO &pcfg_pull_up>; + }; + pmic_hold: pmic-hold{ + rockchip,pins = + <1 13 RK_FUNC_GPIO &pcfg_pull_up>; }; }; @@ -872,26 +884,30 @@ leds { led_power: led-power { - rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <2 27 RK_FUNC_GPIO &pcfg_pull_none>; }; - led_user: led-user { - rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 13 RK_FUNC_GPIO &pcfg_pull_none>; }; }; rt5640 { rt5640_hpcon: rt5640-hpcon { - rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <4 21 RK_FUNC_GPIO &pcfg_pull_none>; }; }; es8223 { es8323_hpdet: es8323-hpdet { - rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <0 11 RK_FUNC_GPIO &pcfg_pull_up>; }; es8323_earcon: es8323-earcon { - rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>; + rockchip,pins = + <0 12 RK_FUNC_GPIO &pcfg_pull_none>; }; }; @@ -900,12 +916,10 @@ rockchip,pins = <1 21 RK_FUNC_GPIO &pcfg_pull_up>; }; - pmic_dvs2: pmic-dvs2 { rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_down>; }; - }; usb2 { @@ -915,16 +929,17 @@ }; }; - fusb30x { fusb0_int: fusb0-int { - rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 2 RK_FUNC_GPIO &pcfg_pull_up>; }; }; vbus { vbus_5v_drv: vbus-5v-drv { - rockchip,pins = <1 3 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = + <1 3 RK_FUNC_GPIO &pcfg_pull_up>; }; }; }; @@ -941,7 +956,7 @@ status = "okay"; }; -&rockchip_suspend { +&rockchip_suspend { rockchip,power-ctrl = <&gpio1 18 GPIO_ACTIVE_LOW>, <&gpio1 14 GPIO_ACTIVE_HIGH>; @@ -957,13 +972,21 @@ }; &cdn_dp { - status = "disabled"; - extcon = <&fusb0>; - phys = <&tcphy0_dp>; + status = "disabled"; + extcon = <&fusb0>; + phys = <&tcphy0_dp>; }; &dp_in_vopb { - status = "disabled"; + status = "disabled"; +}; + +&hdmi_in_vopb { + status = "okay"; +}; + +&hdmi_in_vopl { + status = "disabled"; }; &saradc { @@ -1016,7 +1039,7 @@ status = "okay"; }; -&tcphy1 { +&tcphy1 { status = "okay"; }; @@ -1028,7 +1051,7 @@ status = "okay"; }; -&u2phy0 { +&u2phy0 { status = "okay"; //extcon = <&fusb0>; @@ -1055,14 +1078,14 @@ }; }; -&pwm3 { +&pwm3 { status = "okay"; interrupts = ; compatible = "rockchip,remotectl-pwm"; remote_pwm_id = <3>; handle_cpu_id = <0>; - ir_key1{ + ir_key1 { rockchip,usercode = <0xff00>; rockchip,key_table = <0xeb KEY_POWER>, @@ -1086,22 +1109,22 @@ status = "okay"; }; -&uart2 { +&uart2 { status = "okay"; }; &uart4 { - current-speed = <9600>; - no-loopback-test; - status = "okay"; + current-speed = <9600>; + no-loopback-test; + status = "okay"; }; -&usbdrd3_0 { +&usbdrd3_0 { status = "okay"; //extcon = <&fusb0>; }; -&usbdrd3_1 { +&usbdrd3_1 { status = "okay"; }; @@ -1111,32 +1134,32 @@ dr_mode = "host"; }; -&usbdrd_dwc3_1 { +&usbdrd_dwc3_1 { status = "okay"; dr_mode = "host"; }; - -&usb_host0_ehci { + +&usb_host0_ehci { status = "okay"; }; -&usb_host0_ohci { +&usb_host0_ohci { status = "okay"; }; -&usb_host1_ehci { +&usb_host1_ehci { status = "okay"; }; -&usb_host1_ohci { +&usb_host1_ohci { status = "okay"; }; -&vopb { +&vopb { status = "okay"; }; -&vopb_mmu { +&vopb_mmu { status = "okay"; }; diff --git a/scripts/resource_tool b/scripts/resource_tool index 53318bd73664..18e9f00ead36 100755 Binary files a/scripts/resource_tool and b/scripts/resource_tool differ diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 515a5b0aefb2..5bc7baf79f13 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -49,7 +49,6 @@ #define LINE_IN_OKAY 1 #define LINE_IN_NO 0 static int line_in_status = 0; -static bool aux_irq_flag = true; /*true:enable false:disable*/ static const struct regmap_range_cfg rt5640_ranges[] = { { .name = "PR", .range_min = RT5640_PR_BASE, @@ -226,83 +225,47 @@ static void rt5640_set_linein(struct rt5640_priv *rt5640)//struct snd_soc_codec rt5640_hp_gpio_ctrl(rt5640, 1); } -static void aux_det_work_func(struct work_struct *work) +static int rt5640_aux_adc_iio_read(struct rt5640_priv *rt5640) { - struct rt5640_priv *rt5640 = container_of(work, struct rt5640_priv, aux_det_work.work); - line_in_status = gpio_get_value(rt5640->aux_det_gpio); - printk("%s", __func__); - - if (line_in_status == LINE_IN_OKAY){ - printk(" [on] \n"); - rt5640_set_linein(rt5640); - } - else if (line_in_status == LINE_IN_NO) - { - printk(" [off]\n"); - } - - if(!aux_irq_flag) { - enable_irq(rt5640->aux_det_irq); - aux_irq_flag = true; - } -} - -static irqreturn_t aux_det_isr(int irq, void *data) -{ - struct rt5640_priv *rt5640 = data; - - printk("%s\n", __func__); - - line_in_status = gpio_get_value(rt5640->aux_det_gpio); - if(aux_irq_flag) { - disable_irq_nosync(rt5640->aux_det_irq); - aux_irq_flag = false; - } + struct iio_channel *channel = rt5640->aux_chan; + int val, ret; - if (line_in_status == LINE_IN_OKAY) { - //set line in on - printk(" line_in: [on] \n"); - line_in_status = LINE_IN_OKAY; - schedule_delayed_work(&rt5640->aux_det_work, msecs_to_jiffies(0)); - //rt5640_set_linein(rt5640); - } - else if (line_in_status == LINE_IN_NO) { - //set line in off - printk(" line_in: [off] \n"); - if (!aux_irq_flag) { - enable_irq(rt5640->aux_det_irq); - aux_irq_flag = true; - } - line_in_status = LINE_IN_NO; + if (!channel) + return RT5640_ADC_INVALID_ADVALUE; + ret = iio_read_channel_raw(channel, &val); + if (ret < 0) { + dev_err(rt5640->codec->dev, "read aux_det channel() error: %d\n", ret); + return ret; } - - return IRQ_HANDLED; + return val; } -static void rt5640_delay_workq(struct work_struct *work) +static void rt5640_aux_adc_poll(struct work_struct *work) { - int ret; - struct rt5640_priv *rt5640 = container_of(work, struct rt5640_priv, init_delayed_work.work); - printk("%s\n", __func__); + struct rt5640_priv *rt5640; + int result = -1; - rt5640->aux_det_irq = gpio_to_irq(rt5640->aux_det_gpio); - if (rt5640->aux_det_irq < 0) { - gpio_free(rt5640->aux_det_gpio); - printk("aux_det_irq req fail\n"); - } - else { - ret = request_irq(rt5640->aux_det_irq, aux_det_isr, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "irq_aux_det", rt5640); - if (ret) - printk(KERN_ALERT "Cannot allocate linein INT!ERRNO:%d\n", ret); - else { - if (aux_irq_flag) { - disable_irq(rt5640->aux_det_irq); - aux_irq_flag = false; - } + rt5640 = container_of(work, struct rt5640_priv, adc_aux_work.work); + if (1/*!rt5640->in_suspend*/) { + result = rt5640_aux_adc_iio_read(rt5640); + if (result > RT5640_ADC_INVALID_ADVALUE && result < 1023) + { + //dev_dbg(rt5640->codec->dev, "scan: headphone insert=%d, adc=%d\n", rt5640->hp_insert, result); + if (result < rt5640->aux_det_adc_value + RT5640_ADC_DRIFT_ADVALUE && + result > rt5640->aux_det_adc_value - RT5640_ADC_DRIFT_ADVALUE) + { + dev_dbg(rt5640->codec->dev, "line_in insert, adc=%d\n", result); + if (line_in_status == LINE_IN_NO) + rt5640_set_linein(rt5640); + line_in_status = LINE_IN_OKAY; + } else { + line_in_status = LINE_IN_NO; + dev_dbg(rt5640->codec->dev, "line_in not insert, adc=%d\n", result); + } } } - schedule_delayed_work(&rt5640->aux_det_work, msecs_to_jiffies(100)); + schedule_delayed_work(&rt5640->adc_aux_work, RT5640_ADC_SAMPLE_JIFFIES); } static int rt5640_reset(struct snd_soc_codec *codec) @@ -2330,11 +2293,11 @@ static int rt5640_probe(struct snd_soc_codec *codec) 1000); } - /* Init workquence to set up line in func */ - INIT_DELAYED_WORK(&rt5640->init_delayed_work, rt5640_delay_workq); - INIT_DELAYED_WORK(&rt5640->aux_det_work, aux_det_work_func); - - schedule_delayed_work(&rt5640->init_delayed_work, msecs_to_jiffies(20000)); + if (rt5640->aux_chan) { + INIT_DELAYED_WORK(&rt5640->adc_aux_work, rt5640_aux_adc_poll); + schedule_delayed_work(&rt5640->adc_aux_work, + msecs_to_jiffies(20000)); + } return 0; } @@ -2496,9 +2459,9 @@ static int rt5640_parse_dt(struct rt5640_priv *rt5640, struct device *dev) { struct device_node *np = dev->of_node; struct iio_channel *chan; + struct iio_channel *aux_chan; u32 adc_value; enum of_gpio_flags flags; - unsigned long irq_flags; int gpio, ret; chan = iio_channel_get(dev, NULL); @@ -2515,6 +2478,20 @@ static int rt5640_parse_dt(struct rt5640_priv *rt5640, struct device *dev) } rt5640->chan = chan; + aux_chan = iio_channel_get(dev, "aux-det"); + if (IS_ERR(chan)) { + dev_warn(dev, "rt5640 have no io-channels-aux defined\n"); + aux_chan = NULL; + } else { + if (!of_property_read_u32(np, "aux-det-adc-value", &adc_value)) { + rt5640->aux_det_adc_value = adc_value; + } else { + aux_chan = NULL; + dev_err(dev, "rt5640 have no aux_det_adc_value defined\n"); + } + } + rt5640->aux_chan = aux_chan; + gpio = of_get_named_gpio_flags(np, "hp-con-gpio", 0, &flags); if (gpio < 0) { dev_err(dev, "Can not read property hp-con-gpio\n"); @@ -2529,23 +2506,6 @@ static int rt5640_parse_dt(struct rt5640_priv *rt5640, struct device *dev) } rt5640->hp_con_gpio = gpio; - gpio = of_get_named_gpio_flags(np, "aux-det-gpio", 0, (enum of_gpio_flags *)&irq_flags); - if (gpio < 0) { - dev_err(dev, "Can not read property aux-det-gpio\n"); - } else { - if (gpio_is_valid(gpio)) { - ret = devm_gpio_request(dev, gpio, "aux-det-gpio"); - if (ret < 0) { - dev_err(dev, "aux-det-gpio request ERROR\n"); - } else { - ret = gpio_direction_input(gpio); - if (ret < 0) - dev_err(dev, "gpio_direction_input aux-det-gpio set ERROR\n"); - } - } - } - rt5640->aux_det_gpio = gpio; - rt5640->pdata.in1_diff = of_property_read_bool(np, "realtek,in1-differential"); rt5640->pdata.in2_diff = of_property_read_bool(np, diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h index e96e9915230f..206bf551f7c0 100644 --- a/sound/soc/codecs/rt5640.h +++ b/sound/soc/codecs/rt5640.h @@ -2111,11 +2111,10 @@ struct rt5640_priv { bool hp_insert; int hp_con_gpio; bool hp_con_gpio_active_high; - struct delayed_work init_delayed_work; - struct delayed_work aux_det_work; - int aux_det_gpio; - int aux_det_irq; struct snd_soc_jack hp_jack; + struct delayed_work adc_aux_work; + struct iio_channel *aux_chan; + int aux_det_adc_value; }; int rt5640_dmic_enable(struct snd_soc_codec *codec,