rk3588 DTS文件中 &vbus5v0_typec_pwr_en{ status = "okay"; gpio = <&pca9555 PCA_IO1_4 GPIO_ACTIVE_HIGH>; //PCA_IO 14 };含义
时间: 2024-04-03 12:36:51 浏览: 50
这段代码是一个设备树节点的定义,其中包含一个名为`vbus5v0_typec_pwr_en`的节点。这个节点的作用是控制USB Type-C端口上的电源输出,它的状态被设置为"okay",表示该节点是可用的。同时,这个节点还包含了一个GPIO引脚的定义,它使用了PCA9555芯片的IO1_4引脚,并且被配置为高电平有效。这个GPIO引脚的状态可以通过软件控制,从而控制USB Type-C端口的电源输出状态。
相关问题
RK3588S DTS文件中 fusb302如何进行配置
在RK3588S的DTS文件中,如果要配置fusb302芯片,需要进行以下配置:
1. 声明fusb302节点:
```
&i2c3 {
fusb302: fusb302@22 {
compatible = "fairchild,fusb302";
reg = <0x22>;
};
};
```
2. 配置fusb302节点的属性:
```
&i2c3 {
fusb302: fusb302@22 {
compatible = "fairchild,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio>;
interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
vbus-gpio = <&gpio GPIO_PD0 GPIO_ACTIVE_LOW>;
vconn-gpio = <&gpio GPIO_PD1 GPIO_ACTIVE_LOW>;
reset-gpio = <&gpio GPIO_PD2 GPIO_ACTIVE_LOW>;
irq-gpio = <&gpio GPIO_PD3 GPIO_ACTIVE_LOW>;
alert-gpio = <&gpio GPIO_PD4 GPIO_ACTIVE_LOW>;
};
};
```
这里的属性包括:
- interrupt-parent和interrupts:用于指定fusb302中断的GPIO引脚,以及中断类型。
- vbus-gpio、vconn-gpio、reset-gpio、irq-gpio和alert-gpio:用于指定fusb302的GPIO引脚,以及GPIO的电平状态。
3. 配置fusb302的驱动程序:
```
&i2c3 {
fusb302: fusb302@22 {
compatible = "fairchild,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio>;
interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
vbus-gpio = <&gpio GPIO_PD0 GPIO_ACTIVE_LOW>;
vconn-gpio = <&gpio GPIO_PD1 GPIO_ACTIVE_LOW>;
reset-gpio = <&gpio GPIO_PD2 GPIO_ACTIVE_LOW>;
irq-gpio = <&gpio GPIO_PD3 GPIO_ACTIVE_LOW>;
alert-gpio = <&gpio GPIO_PD4 GPIO_ACTIVE_LOW>;
status = "okay";
};
usb-role-switch {
compatible = "usb-role-switch";
#address-cells = <1>;
#size-cells = <0>;
usb_role_switch {
compatible = "gpio-usb-role-switch";
gpios = <&gpio GPIO_PE3 GPIO_ACTIVE_HIGH>;
vbus-supply = <&vcc_usb>;
debounce = <50>;
};
};
};
```
这里的驱动程序包括:
- status = "okay":用于启用fusb302设备。
- usb-role-switch和gpio-usb-role-switch:用于配置USB角色开关的GPIO引脚,以及vbus电源的供应。
reg_usb_h1_vbus: regulator@1 { compatible = "regulator-fixed"; reg = <1>; regulator-name = "usb_h1_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; gpio = <&gpio1 29 0>; enable-active-high; vin-supply = <&swbst_reg>; };
这段代码是一个设备树中的节点描述,描述了一个名为 "reg_usb_h1_vbus" 的固定电压调节器(regulator-fixed)。下面是对每个属性的解释:
- compatible = "regulator-fixed": 定义了该节点与 "regulator-fixed" 类型的固定电压调节器兼容。
- reg = <1>: 指定了该节点在设备树中的索引号。
- regulator-name = "usb_h1_vbus": 指定了电压调节器的名称为 "usb_h1_vbus"。
- regulator-min-microvolt = <5000000>: 指定了电压调节器的最小输出电压为 5V(5000000微伏)。
- regulator-max-microvolt = <5000000>: 指定了电压调节器的最大输出电压为 5V(5000000微伏)。
- gpio = <&gpio1 29 0>: 指定了用于控制电压调节器使能的 GPIO 引脚。具体来说,它使用了设备树中的 gpio1 控制器,并使用引脚号 29,引脚配置为默认模式(0)。
- enable-active-high: 指定了使能引脚的电平极性为高电平激活。
- vin-supply = <&swbst_reg>: 指定了该电压调节器的输入电源来自于名为 "swbst_reg" 的另一个调节器。
这段代码描述了一个固定输出电压为 5V 的电压调节器,并使用 GPIO 引脚来控制其使能。它还指定了输入电源来自于名为 "swbst_reg" 的另一个调节器。设备树中的其他节点可以引用该电压调节器以获取所需的电源。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)