首页 > 解决方案 > Linux 调节器用户空间消耗驱动程序:sysfs 下的缺失状态

问题描述

我正在尝试使用reg-userspace-consumer驱动程序来打开/关闭 USB 总线电源。看起来驱动程序被反向移植到4.4.143。我所要做的就是用驱动程序编译内核:

CONFIG_REGULATOR_USERSPACE_CONSUMER=y

并通过设备树将其与目标调节器链接:

    vcc_otg_vbus: otg-vbus-regulator {
        compatible = "regulator-fixed";
        enable-active-high;
        gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&otg_vbus_drv>;
        regulator-name = "vcc_otg_vbus";
    };

    vcc_otg_vbus_switch {
        status = "okay";
        compatible = "reg-userspace-consumer";
        regulator-name = "vcc-otg-vbus-consumer";
        #regulator-boot-on;
        regulator-supplies = "vbus";
        vbus-supply = <&vcc_otg_vbus>;
        comment = "USB OTG power switch";
    };

sysfs 挂钩确实出现了,但它缺少状态文件:

root# ls /sys/devices/platform/vcc_otg_vbus_switch/
driver_override  modalias         of_node          power            subsystem        uevent

据我所见,驱动程序并没有从用户空间提供对调节器的更多控制,而不是调节器固定。我错过了什么吗?谢谢。

标签: linuxlinux-device-driverdevicedevice-tree

解决方案



推荐阅读