我有一个基于rk3288 (rockchip)的电路板,我正在为它修复/编写设备树。在该文件中,目前有以下三个独立监管机构的定义:
dovdd_1v8: dovdd-1v8-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&dvp_pwr>;
regulator-name = "dovdd_1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
vin-supply = <&vcc_io>;
};
vcc28_dvp: vcc28-dvp-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&dvp_pwr>;
regulator-name = "vcc28_dvp";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
vin-supply = <&vcc_io>;
};
af_28: af_28-regulator {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&dvp_pwr>;
regulator-name = "af_28";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
vin-supply = <&vcc_io>;
};问题是内核抱怨它不能为这3个调节器分配相同的GPIO引脚。在电路板的原理图中,调节器由相同的GPIO引脚控制。
这样做的正确方法是什么?
谢谢!B
编辑:以下是我在串行控制台上看到的错误消息:
[ 0.270507] rockchip-pinctrl pinctrl: pin gpio0-11 already requested
by dovdd-1v8-regulator; cannot claim for vcc28-dvp-regulator
[ 0.270570] rockchip-pinctrl pinctrl: pin-11 (vcc28-dvp-regulator) status -22
[ 0.270611] rockchip-pinctrl pinctrl: could not request pin 11 (gpio0-11) from group dvp-pwr on device rockchip-pinctrl
[ 0.270663] reg-fixed-voltage vcc28-dvp-regulator: Error applying setting, reverse things back

发布于 2016-10-15 05:32:52
调节器子系统允许单个GPIO启用多个调节器。
我在fixed.c或core.c中找不到可以阻止多个监管者共享一个启用GPIO的代码。
现在您已经添加了显著的错误消息,问题就更清楚了。
您得到的错误消息不是来自GPIO资源管理,而是来自pinctrl子系统。
可能的原因是每个调节器的pinctrl组声明不正确。(您尚未张贴设备树的该部分。)
因此,您会得到一个pinctrl分配错误,这与GPIO分配错误不同。
( pinctrl子系统处于比GPIO管理更低的级别,可以为外围功能分配管脚,也可以为GPIO分配管脚复用。)
我不确定DT中的正确修复应该是什么。
假设只有一个为启用GPIO声明的pinctrl组,您可以尝试在一个调节器节点中仅使用它一次。IOW删除其他两个调节器中的pinctrl属性。
https://stackoverflow.com/questions/40037988
复制相似问题