vbus调节器设备树

时间:2018-05-16 20:02:51

标签: linux device-tree

有人可以解释设备树设置吗?他们将在i.MX6处理器上做什么?

谢谢!

vbus1_regulator: regulator@1 {
    compatible = "regulator-fixed";
    regulator-name = "vbus1_regulator";
    regulator-min-microvolt = <5000000>;
    regulator-max-microvolt = <5000000>;
    gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>;
    enable-active-high;
};


&usbotg {
    vbus-supply = <&vbus1_regulator>;
    dr_mode = "host";
    status = "okay";
};

1 个答案:

答案 0 :(得分:0)

USB协议定义了两个角色-主机和客户端。借助USB OTG(移动),设备可以同时具有主机和客户端功能。参见:

http://www.usb.org/developers/onthego/ https://www.maximintegrated.com/en/app-notes/index.mvp/id/1822

为使该设备作为主机工作,它需要根据USB标准要求为其连接的客户端设备供电。

话虽这么说,&usbotg 节点是:

  1. 使用_vbus1_regulator_作为USB电源。
  2. 通过将 dr_mode 属性设置为 host ,强制USB OTG端口作为主机。
  3. 通过将状态设置为 ok 启用节点。

请参阅Linux内核设备树绑定文档以获取更多详细信息: https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/fsl-usb.txt

vbus1_regulator 节点为:

  1. 使用兼容 regulator-fixed 的内核驱动程序:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/regulator/fixed.c?h=v4.19-rc1#n196
  2. 将调节器的名称设置为 vbus1_regulator
  3. 将最小和最大电压定义为与5伏相同的5000000微伏。由于固定电压调节器的特性,两者都是相同的-您只有一个固定的输出电压值。
  4. 使用GPIO引脚(在其他地方声明)来控制调节器(打开/关闭)。
  5. 定义GPIO电平必须为高才能激活稳压器。如果省略此属性,则假定调节器在逻辑低电平上处于活动状态。

有关更多详细信息,请参见Linux内核设备树绑定文档。 https://www.kernel.org/doc/Documentation/devicetree/bindings/regulator/fixed-regulator.txt

相关问题