SPI片选设置
您好,我想在SPI2上接4片芯片,需要4个片选脚。但设备树上我只找到一路CS0,我可以像GPIO口一样增加片选吗?还请帮忙看看这样行吗?还需要改哪些地方?spi2_clk: spi2-clk {
rockchip,pins =
<2 11 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_cs0: spi2-cs0 {
rockchip,pins =
<2 12 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_cs1: spi1-cs1 {
rockchip,pins =
<2 2 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_cs2: spi1-cs2 {
rockchip,pins =
<2 5 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_cs3: spi1-cs3 {
rockchip,pins =
<2 3 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_rx: spi2-rx {
rockchip,pins =
<2 9 RK_FUNC_1 &pcfg_pull_up>;
};
spi2_tx: spi2-tx {
rockchip,pins =
<2 10 RK_FUNC_1 &pcfg_pull_up>;
};
};
&spi2 {
status = "okay";
pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0 &spi1_cs1 &spi1_cs2 &spi1_cs3>;
#if 0
spidev@0 {
compatible = "spidev", "rohm,dh2228fv";
reg = <0>;
spi-max-frequency = <25000000>;
};
#endif
spi_tmc@0 {
compatible = "vistel,spi_tmc_CS0";
reg = <0>; //chip select0:cs01:cs1
id = <0>;
spi-max-frequency = <2000000>; //spi output clock
};
spi_tmc@1 {
compatible = "vistel,spi_tmc_CS1";
reg = <1>; //chip select0:cs01:cs1
id = <1>;
spi-max-frequency = <2000000>; //spi output clock
};
spi_tmc@2 {
compatible = "vistel,spi_tmc_CS2";
reg = <2>; //chip select0:cs01:cs1
id = <2>;
spi-max-frequency = <2000000>; //spi output clock
};
spi_tmc@3 {
compatible = "vistel,spi_tmc_CS3";
reg = <3>; //chip select0:cs01:cs1
id = <3>;
spi-max-frequency = <2000000>; //spi output clock
};
};
无人回答呀??? 您可以看一下源码目录下\docs\Common\SPI\Rockchip_Developer_Guide_Linux_SPI_CN目录下的文档查看,您目前的需求应该是不可以的,Rockchip SPI 功能特点中描述每个 SPI 控制器支持一个到两个片选。您现在想在一个SPI控制器下接入四个片选引脚不可行。
页:
[1]