drivers: misc: add over temp shutdown for opiaimax
This commit is contained in:
parent
37be4bf486
commit
e65ecde6de
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
/dts-v1/;
|
||||
|
||||
#include "rk3588-orangepi-5-plus.dtsi"
|
||||
#include "rk3588-orangepi-ai-max.dtsi"
|
||||
#include "rk3588-linux.dtsi"
|
||||
#include "rk3588-orangepi-5-plus-lcd.dtsi"
|
||||
#include "rk3588-orangepi-5-plus-camera1.dtsi"
|
||||
|
|
@ -51,6 +51,19 @@
|
|||
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
over-temp-shutdown@0 {
|
||||
compatible = "orangepi,over-temp-shutdown";
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&over_temp_gpio>;
|
||||
|
||||
input-gpio = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>;
|
||||
output1-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
|
||||
output2-gpio = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
|
||||
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&sdhci {
|
||||
|
|
@ -183,6 +196,12 @@
|
|||
<3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
};
|
||||
|
||||
over_temp_gpio {
|
||||
over_temp_gpio: over-temp-gpio {
|
||||
rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,751 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
/*
|
||||
* Copyright (c) 2021 Rockchip Electronics Co., Ltd.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dt-bindings/usb/pd.h"
|
||||
#include "rk3588.dtsi"
|
||||
#include "rk3588-orangepi.dtsi"
|
||||
#include "rk3588-rk806-single.dtsi"
|
||||
|
||||
/ {
|
||||
/* If hdmirx node is disabled, delete the reserved-memory node here. */
|
||||
reserved-memory {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
/* Reserve 128MB memory for hdmirx-controller@fdee0000 */
|
||||
cma {
|
||||
compatible = "shared-dma-pool";
|
||||
reusable;
|
||||
reg = <0x0 (256 * 0x100000) 0x0 (256 * 0x100000)>;
|
||||
linux,cma-default;
|
||||
};
|
||||
};
|
||||
|
||||
es8388_sound: es8388-sound {
|
||||
status = "okay";
|
||||
compatible = "rockchip,multicodecs-card";
|
||||
rockchip,card-name = "rockchip,es8388";
|
||||
hp-det-gpio = <&gpio1 RK_PD3 GPIO_ACTIVE_HIGH>;
|
||||
io-channels = <&saradc 3>;
|
||||
io-channel-names = "adc-detect";
|
||||
keyup-threshold-microvolt = <1800000>;
|
||||
poll-interval = <100>;
|
||||
spk-con-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>;
|
||||
hp-con-gpio = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
|
||||
rockchip,format = "i2s";
|
||||
rockchip,mclk-fs = <256>;
|
||||
rockchip,cpu = <&i2s0_8ch>;
|
||||
rockchip,codec = <&es8388>;
|
||||
rockchip,audio-routing =
|
||||
"Headphone", "LOUT1",
|
||||
"Headphone", "ROUT1",
|
||||
"Speaker", "LOUT2",
|
||||
"Speaker", "ROUT2",
|
||||
"Headphone", "Headphone Power",
|
||||
"Headphone", "Headphone Power",
|
||||
"Speaker", "Speaker Power",
|
||||
"Speaker", "Speaker Power",
|
||||
"LINPUT1", "Main Mic",
|
||||
"LINPUT2", "Main Mic",
|
||||
"RINPUT1", "Headset Mic",
|
||||
"RINPUT2", "Headset Mic";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hp_det>;
|
||||
play-pause-key {
|
||||
label = "playpause";
|
||||
linux,code = <KEY_PLAYPAUSE>;
|
||||
press-threshold-microvolt = <2000>;
|
||||
};
|
||||
};
|
||||
|
||||
hdmiin-sound {
|
||||
compatible = "rockchip,hdmi";
|
||||
rockchip,mclk-fs = <128>;
|
||||
rockchip,format = "i2s";
|
||||
rockchip,bitclock-master = <&hdmirx_ctrler>;
|
||||
rockchip,frame-master = <&hdmirx_ctrler>;
|
||||
rockchip,card-name = "rockchip,hdmiin";
|
||||
rockchip,cpu = <&i2s7_8ch>;
|
||||
rockchip,codec = <&hdmirx_ctrler 0>;
|
||||
rockchip,jack-det;
|
||||
};
|
||||
|
||||
pcie20_avdd0v85: pcie20-avdd0v85 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "pcie20_avdd0v85";
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <850000>;
|
||||
regulator-max-microvolt = <850000>;
|
||||
vin-supply = <&vdd_0v85_s0>;
|
||||
};
|
||||
|
||||
pcie20_avdd1v8: pcie20-avdd1v8 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "pcie20_avdd1v8";
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
vin-supply = <&avcc_1v8_s0>;
|
||||
};
|
||||
|
||||
pcie30_avdd0v75: pcie30-avdd0v75 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "pcie30_avdd0v75";
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <750000>;
|
||||
vin-supply = <&avdd_0v75_s0>;
|
||||
};
|
||||
|
||||
pcie30_avdd1v8: pcie30-avdd1v8 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "pcie30_avdd1v8";
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
vin-supply = <&avcc_1v8_s0>;
|
||||
};
|
||||
|
||||
rk_headset: rk-headset {
|
||||
status = "disabled";
|
||||
compatible = "rockchip_headset";
|
||||
headset_gpio = <&gpio1 RK_PD3 GPIO_ACTIVE_HIGH>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hp_det>;
|
||||
io-channels = <&saradc 3>;
|
||||
};
|
||||
|
||||
vbus5v0_typec: vbus5v0-typec {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vbus5v0_typec";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
enable-active-high;
|
||||
gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>;
|
||||
vin-supply = <&vcc5v0_usb>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&typec5v_pwren>;
|
||||
};
|
||||
|
||||
vcc3v3_pcie30: vcc3v3-pcie30 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc3v3_pcie30";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
enable-active-high;
|
||||
gpios = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
|
||||
startup-delay-us = <5000>;
|
||||
vin-supply = <&vcc5v0_sys>;
|
||||
};
|
||||
|
||||
vcc5v0_host: vcc5v0-host {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc5v0_host";
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
enable-active-high;
|
||||
gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
|
||||
vin-supply = <&vcc5v0_usb>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&vcc5v0_host_en>;
|
||||
};
|
||||
|
||||
vcc3v3_pcie2x1l0: vcc3v3-pcie2x1l0 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc3v3_pcie2x1l0";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
enable-active-high;
|
||||
gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>;
|
||||
startup-delay-us = <50000>;
|
||||
vin-supply = <&vcc12v_dcin>;
|
||||
};
|
||||
|
||||
vcc_mipicsi0: vcc-mipicsi0-regulator {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc_mipicsi0";
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
vcc_mipicsi1: vcc-mipicsi1-regulator {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc_mipicsi1";
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
vcc_mipidcphy0: vcc-mipidcphy0-regulator {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc_mipicsi1";
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
wireless_bluetooth: wireless-bluetooth {
|
||||
compatible = "bluetooth-platdata";
|
||||
clocks = <&hym8563>;
|
||||
clock-names = "ext_clock";
|
||||
uart_rts_gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>;
|
||||
pinctrl-names = "default", "rts_gpio";
|
||||
pinctrl-0 = <&uart9m0_rtsn>, <&bt_reset_gpio>, <&bt_wake_gpio>, <&bt_irq_gpio>;
|
||||
pinctrl-1 = <&uart9_gpios>;
|
||||
BT,reset_gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
|
||||
BT,wake_gpio = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
|
||||
BT,wake_host_irq = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
wireless_wlan: wireless-wlan {
|
||||
compatible = "wlan-platdata";
|
||||
wifi_chip_type = "ap6275p";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&wifi_host_wake_irq>;
|
||||
WIFI,host_wake_irq = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
wifi_disable: wifi-diable-gpio-regulator {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "wifi_disable";
|
||||
enable-active-high;
|
||||
gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
};
|
||||
|
||||
&backlight {
|
||||
pwms = <&pwm2 0 25000 0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&can2 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&combphy0_ps {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&combphy1_ps {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&combphy2_psu {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dp0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dp0_in_vp0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&dp0_in_vp1 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&dp0_in_vp2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dp0_sound{
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spdif_tx2{
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
/*
|
||||
* mipi_dcphy0 needs to be enabled
|
||||
* when dsi0 is enabled
|
||||
*/
|
||||
&dsi0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&dsi0_in_vp2 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&dsi0_in_vp3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&dsi0_panel {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/*
|
||||
* mipi_dcphy1 needs to be enabled
|
||||
* when dsi1 is enabled
|
||||
*/
|
||||
&dsi1 {
|
||||
status = "disabled";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mipi_te1>;
|
||||
};
|
||||
|
||||
&dsi1_in_vp2 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&dsi1_in_vp3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&dsi1_panel {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&gmac0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&hdmi0 {
|
||||
status = "okay";
|
||||
enable-gpios = <&gpio4 RK_PB1 GPIO_ACTIVE_HIGH>;
|
||||
cec-enable = "true";
|
||||
};
|
||||
|
||||
&hdmi0_in_vp0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hdmi0_in_vp1 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&hdmi0_in_vp2 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&hdmi0_sound {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hdmi1 {
|
||||
status = "okay";
|
||||
enable-gpios = <&gpio4 RK_PB2 GPIO_ACTIVE_HIGH>;
|
||||
cec-enable = "true";
|
||||
};
|
||||
|
||||
&hdmi1_in_vp0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&hdmi1_in_vp1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hdmi1_in_vp2 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&hdmi1_sound {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
/* Should work with at least 128MB cma reserved above. */
|
||||
&hdmirx_ctrler {
|
||||
status = "disabled";
|
||||
|
||||
#sound-dai-cells = <1>;
|
||||
/* Effective level used to trigger HPD: 0-low, 1-high */
|
||||
hpd-trigger-level = <1>;
|
||||
hdmirx-det-gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>;
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hdmim1_rx_cec &hdmim1_rx_hpdin &hdmim1_rx_scl &hdmim1_rx_sda &hdmirx_det>;
|
||||
};
|
||||
|
||||
&hdptxphy_hdmi0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hdptxphy_hdmi1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c0m2_xfer>;
|
||||
|
||||
vdd_cpu_big0_s0: vdd_cpu_big0_mem_s0: rk8602@42 {
|
||||
compatible = "rockchip,rk8602";
|
||||
reg = <0x42>;
|
||||
vin-supply = <&vcc5v0_sys>;
|
||||
regulator-compatible = "rk860x-reg";
|
||||
regulator-name = "vdd_cpu_big0_s0";
|
||||
regulator-min-microvolt = <550000>;
|
||||
regulator-max-microvolt = <1050000>;
|
||||
regulator-ramp-delay = <2300>;
|
||||
rockchip,suspend-voltage-selector = <1>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vdd_cpu_big1_s0: vdd_cpu_big1_mem_s0: rk8603@43 {
|
||||
compatible = "rockchip,rk8603";
|
||||
reg = <0x43>;
|
||||
vin-supply = <&vcc5v0_sys>;
|
||||
regulator-compatible = "rk860x-reg";
|
||||
regulator-name = "vdd_cpu_big1_s0";
|
||||
regulator-min-microvolt = <550000>;
|
||||
regulator-max-microvolt = <1050000>;
|
||||
regulator-ramp-delay = <2300>;
|
||||
rockchip,suspend-voltage-selector = <1>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c6 {
|
||||
status = "okay";
|
||||
clock-frequency = <400000>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c6m0_xfer>;
|
||||
|
||||
usbc0: fusb302@22 {
|
||||
compatible = "fcs,fusb302";
|
||||
reg = <0x22>;
|
||||
interrupt-parent = <&gpio0>;
|
||||
interrupts = <RK_PD3 IRQ_TYPE_LEVEL_LOW>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&usbc0_int>;
|
||||
vbus-supply = <&vbus5v0_typec>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
usbc0_role_sw: endpoint@0 {
|
||||
remote-endpoint = <&dwc3_0_role_switch>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
usb_con: connector {
|
||||
compatible = "usb-c-connector";
|
||||
label = "USB-C";
|
||||
data-role = "dual";
|
||||
power-role = "dual";
|
||||
try-power-role = "sink";
|
||||
op-sink-microwatt = <1000000>;
|
||||
sink-pdos =
|
||||
<PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
|
||||
source-pdos =
|
||||
<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
|
||||
|
||||
altmodes {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
altmode@0 {
|
||||
reg = <0>;
|
||||
svid = <0xff01>;
|
||||
vdo = <0xffffffff>;
|
||||
};
|
||||
};
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
usbc0_orien_sw: endpoint {
|
||||
remote-endpoint = <&usbdp_phy0_orientation_switch>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
dp_altmode_mux: endpoint {
|
||||
remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hym8563: hym8563@51 {
|
||||
compatible = "haoyu,hym8563";
|
||||
reg = <0x51>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
clock-output-names = "hym8563";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hym8563_int>;
|
||||
interrupt-parent = <&gpio0>;
|
||||
interrupts = <RK_PC6 IRQ_TYPE_LEVEL_LOW>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c1m2_xfer>;
|
||||
|
||||
vdd_npu_s0: vdd_npu_mem_s0: rk8602@42 {
|
||||
compatible = "rockchip,rk8602";
|
||||
reg = <0x42>;
|
||||
vin-supply = <&vcc5v0_sys>;
|
||||
regulator-compatible = "rk860x-reg";
|
||||
regulator-name = "vdd_npu_s0";
|
||||
regulator-min-microvolt = <550000>;
|
||||
regulator-max-microvolt = <950000>;
|
||||
regulator-ramp-delay = <2300>;
|
||||
rockchip,suspend-voltage-selector = <1>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c7 {
|
||||
status = "okay";
|
||||
|
||||
es8388: es8388@11 {
|
||||
status = "okay";
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "everest,es8388", "everest,es8323";
|
||||
reg = <0x11>;
|
||||
clocks = <&mclkout_i2s0>;
|
||||
clock-names = "mclk";
|
||||
assigned-clocks = <&mclkout_i2s0>;
|
||||
assigned-clock-rates = <12288000>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2s0_mclk>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2s5_8ch {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2s6_8ch {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2s7_8ch {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
rgmii_phy: phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <0x1>;
|
||||
};
|
||||
};
|
||||
|
||||
&mipi_dcphy0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&mipi_dcphy1 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
//phy1
|
||||
&pcie2x1l0 {
|
||||
reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
|
||||
vpcie3v3-supply = <&vcc3v3_pcie2x1l0>;
|
||||
rockchip,skip-scan-in-resume;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
//phy2
|
||||
&pcie2x1l1 {
|
||||
reset-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
//phy0
|
||||
&pcie2x1l2 {
|
||||
reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie30phy {
|
||||
rockchip,pcie30-phymode = <PHY_MODE_PCIE_AGGREGATION>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie3x4 {
|
||||
reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
|
||||
vpcie3v3-supply = <&vcc3v3_pcie30>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
hdmi {
|
||||
hdmirx_det: hdmirx-det {
|
||||
rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
};
|
||||
|
||||
headphone {
|
||||
hp_det: hp-det {
|
||||
rockchip,pins = <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
hym8563 {
|
||||
hym8563_int: hym8563-int {
|
||||
rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
};
|
||||
|
||||
lcd {
|
||||
lcd_rst_gpio: lcd-rst-gpio {
|
||||
rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
usb {
|
||||
vcc5v0_host_en: vcc5v0-host-en {
|
||||
rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
usb-typec {
|
||||
usbc0_int: usbc0-int {
|
||||
rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
|
||||
typec5v_pwren: typec5v-pwren {
|
||||
rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
wireless-bluetooth {
|
||||
uart9_gpios: uart9-gpios {
|
||||
rockchip,pins = <4 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
bt_reset_gpio: bt-reset-gpio {
|
||||
rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
bt_wake_gpio: bt-wake-gpio {
|
||||
rockchip,pins = <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
bt_irq_gpio: bt-irq-gpio {
|
||||
rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
};
|
||||
|
||||
wireless-wlan {
|
||||
wifi_host_wake_irq: wifi-host-wake-irq {
|
||||
rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
};
|
||||
|
||||
sdmmc {
|
||||
sdmmc_pwr: sdmmc_pwr {
|
||||
rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pwm2 {
|
||||
pinctrl-names = "active";
|
||||
pinctrl-0 = <&pwm2m2_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sata0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&u2phy1_otg {
|
||||
phy-supply = <&vcc5v0_host>;
|
||||
};
|
||||
|
||||
&u2phy2_host {
|
||||
phy-supply = <&vcc5v0_host>;
|
||||
};
|
||||
|
||||
&u2phy3_host {
|
||||
phy-supply = <&vcc5v0_host>;
|
||||
};
|
||||
|
||||
&uart9 {
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart9m0_xfer &uart9m0_ctsn>;
|
||||
};
|
||||
|
||||
&usbdp_phy0 {
|
||||
orientation-switch;
|
||||
svid = <0xff01>;
|
||||
sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
|
||||
sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
usbdp_phy0_orientation_switch: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&usbc0_orien_sw>;
|
||||
};
|
||||
|
||||
usbdp_phy0_dp_altmode_mux: endpoint@1 {
|
||||
reg = <1>;
|
||||
remote-endpoint = <&dp_altmode_mux>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&usbdp_phy1 {
|
||||
rockchip,dp-lane-mux = <2 3>;
|
||||
};
|
||||
|
||||
&usbdrd_dwc3_0 {
|
||||
status = "okay";
|
||||
dr_mode = "otg";
|
||||
usb-role-switch;
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
dwc3_0_role_switch: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&usbc0_role_sw>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&usbhost3_0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usbhost_dwc3_0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
|
@ -498,6 +498,14 @@ config HISI_HIKEY_USB
|
|||
switching between the dual-role USB-C port and the USB-A host ports
|
||||
using only one USB controller.
|
||||
|
||||
config OVER_TEMP_SHUTDOWN
|
||||
tristate "Orange Pi Ai MAX over temp shutdown"
|
||||
depends on (OF && GPIOLIB)
|
||||
help
|
||||
If you are using Opiaimax, please enable this configuration. It will
|
||||
turn off the power to the two 310B units when the temperature
|
||||
reaches 105 degrees.
|
||||
|
||||
source "drivers/misc/c2port/Kconfig"
|
||||
source "drivers/misc/eeprom/Kconfig"
|
||||
source "drivers/misc/cb710/Kconfig"
|
||||
|
|
|
|||
|
|
@ -62,3 +62,4 @@ obj-$(CONFIG_UACCE) += uacce/
|
|||
obj-$(CONFIG_XILINX_SDFEC) += xilinx_sdfec.o
|
||||
obj-$(CONFIG_HISI_HIKEY_USB) += hisi_hikey_usb.o
|
||||
obj-$(CONFIG_UID_SYS_STATS) += uid_sys_stats.o
|
||||
obj-$(CONFIG_OVER_TEMP_SHUTDOWN) += over_temp_shutdown.o
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
static struct gpio_desc *gpio_input;
|
||||
static struct gpio_desc *gpio_output1;
|
||||
static struct gpio_desc *gpio_output2;
|
||||
static int irq_number;
|
||||
|
||||
static irqreturn_t gpio_irq_handler(int irq, void *dev_id)
|
||||
{
|
||||
gpiod_set_value(gpio_output1, 0);
|
||||
gpiod_set_value(gpio_output2, 0);
|
||||
|
||||
printk(KERN_INFO "GPIO Interrupt: Over temp triggered, setting GPIO %d and %d to low to close 310B.\n",
|
||||
desc_to_gpio(gpio_output1), desc_to_gpio(gpio_output2));
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int over_temp_shutdown_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
gpio_input = devm_gpiod_get_optional(&pdev->dev, "input", GPIOD_IN);
|
||||
if (IS_ERR(gpio_input)) {
|
||||
printk(KERN_ALERT "Failed to get GPIO input\n");
|
||||
return PTR_ERR(gpio_input);
|
||||
}
|
||||
|
||||
gpio_output1 = devm_gpiod_get_optional(&pdev->dev, "output1", GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(gpio_output1)) {
|
||||
printk(KERN_ALERT "Failed to get GPIO output1\n");
|
||||
return PTR_ERR(gpio_output1);
|
||||
}
|
||||
|
||||
gpio_output2 = devm_gpiod_get_optional(&pdev->dev, "output2", GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(gpio_output2)) {
|
||||
printk(KERN_ALERT "Failed to get GPIO output2\n");
|
||||
return PTR_ERR(gpio_output2);
|
||||
}
|
||||
|
||||
if (gpio_input) {
|
||||
irq_number = gpiod_to_irq(gpio_input);
|
||||
if (irq_number < 0) {
|
||||
printk(KERN_ALERT "Failed to get IRQ number for GPIO input\n");
|
||||
return irq_number;
|
||||
}
|
||||
|
||||
ret = request_irq(irq_number, gpio_irq_handler, IRQF_TRIGGER_RISING, "over_temp_irq_handler", NULL);
|
||||
if (ret < 0) {
|
||||
printk(KERN_ALERT "Failed to request IRQ %d\n", irq_number);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int over_temp_shutdown_remove(struct platform_device *pdev)
|
||||
{
|
||||
if (gpio_input) {
|
||||
free_irq(irq_number, NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id over_temp_shutdown_of_match[] = {
|
||||
{ .compatible = "orangepi,over-temp-shutdown", },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, over_temp_shutdown_of_match);
|
||||
|
||||
static struct platform_driver over_temp_shutdown_driver = {
|
||||
.probe = over_temp_shutdown_probe,
|
||||
.remove = over_temp_shutdown_remove,
|
||||
.driver = {
|
||||
.name = "over_temp_shutdown-device",
|
||||
.of_match_table = over_temp_shutdown_of_match,
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
};
|
||||
|
||||
module_platform_driver(over_temp_shutdown_driver);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Orange Pi");
|
||||
MODULE_DESCRIPTION("opiaimax over temp shutdown");
|
||||
Loading…
Reference in New Issue