1. config增加
CONFIG_REGULATOR_DEBUG=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
CONFIG_REGULATOR_USERSPACE_CONSUMER=y
CONFIG_REGULATOR_GPIO=y
2. dts增加
// lcd_3v3
lcd_3v3: lcd_3v3 {
compatible = "regulator-fixed";
regulator-name = "lcd_3v3";
status = "okay";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&gpio_chip6 5 0>;
enable-active-high;
regulator-boot-on;
regulator-always-on;
};
lcd_3v3_consumer: lcd_3v3-consumer {
compatible = "reg-userspace-consumer";
regulator-name = "lcd_3v3-consumer";
status = "okay";
regulator-supplies = "lcd_3v3";
lcd_3v3-supply = <&lcd_3v3>;
regulator-boot-on;
};
相关的GPIO需要在uboot或者Linux开始阶段对引脚复用功能,方向等进行配置。内核源码需要根据需求更改。