Hello All,
我尝试如下设置设备树,但CS信号仅在默认硬件引脚上
&spi1 {
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins_a>;
status = "okay";
num_chipselect = <2>;
cs_gpios = <&pio 3 2 GPIO_ACTIVE_LOW>,
<&pio 3 14 GPIO_ACTIVE_LOW>,
gpio1: gpio@0x00 {
compatible = "fairchild,74hc595";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
registers-number = <2>;
spi-max-frequency = <1000000>;
};
gpio2: gpio@0x01 {
compatible = "ti,sn65hvs882", "pisosr-gpio";
gpio-controller;
#gpio-cells = <1>;
reg = <1>;
spi-max-frequency = <1000000>;
};
};
我注意到spi设备驱动程序未从设备树中读取任何现成的解决方案来支持多个CS?
离线
非常感谢您提供宝贵的信息,
但这对我的情况不起作用。
&spi1 {
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins_a &spi1_pins_cs>;
status = "okay";
num_chipselect = <4>;
cs_gpios = <&pio 3 2 GPIO_ACTIVE_LOW>, /*PD2 main lcd*/
<&pio 3 14 GPIO_ACTIVE_LOW>, /*PD14 SR Latch*/
<&pio 3 21 GPIO_ACTIVE_LOW>, /*PD21 rtc*/
<0>; /*lcd2*/
gpio1: gpio@0x01 {
compatible = "fairchild,74hc595";
reg = <1>;
gpio-controller;
#gpio-cells = <2>;
registers-number = <1>;
spi-max-frequency = <1000000>;
};
};
spi1_pins_a: spi1-pins-pc {
pins = "PA0", "PA1", "PA2", "A3";
function = "spi1";
};
spi1_pins_cs: spi1_pins_cs {
pins = "PD2", "D14", "PD21";
function = "gpio_out";
};
CS信号仍在默认端口PA0上
我检查了驱动程序代码,未找到此行devm_gpio_request
离线
非常感谢,它对我有用
主要更改是cs_gpios更改为cs-gpios
离线
现在可以了吗?
Yes, Now it's working
离线