Hi,
This issue has been reported in multiple threads here when discussing SPI and I feel it deserves a seperate discussion. I am trying to make spidev working on L4T21.4 or on the grinch kernel. In both of it I observe the same error in dmesg. In grinch 19.3 this issue does not exist. CS0 is exposed in the expender I/O header.
dmesg | grep spi
[ 0.596092] avdd-spi: 3300 mV at 150 mA
[ 4.194125] spi-tegra114 spi-tegra114.0: registered master spi0
[ 4.194245] spi spi0.0: setup 8 bpw, ~cpol, ~cpha, 12000000Hz
[ 4.194303] spi spi0.0: setup mode 0, 8 bits/w, 12000000 Hz max --> 0
[ 4.194613] spi-tegra114 spi-tegra114.0: registered child spi0.0
[ 4.195009] spi-tegra114 spi-tegra114.0: chipselect 0 already in use
[ 4.195017] spi_master spi0: spi_device register error /spi@7000d400/spi0_0
[ 4.195422] spi-tegra114 spi-tegra114.3: registered master spi3
[ 9.039218] avdd-spi: incomplete constraints, leaving on
I am sure the device tree files are correct.
spi0_0 {
#address-cells = <0x1>;
#size-cells = <0x0>;
compatible = "spidev";
reg = <0x0>;
spi-max-frequency = <0x17d7840>;
spi-cpha;
nvidia,enable-hw-based-cs;
nvidia,cs-setup-clk-count = <0x1e>;
nvidia,cs-hold-clk-count = <0x1e>;
nvidia,rx-clk-tap-delay = <0x1f>;
nvidia,tx-clk-tap-delay = <0x0>;
};
Is there a possibility that there is a spi device somewhere that is grabbing CS0 and initializing it before it reaches the SPIdev? I tried searching for it with no luck. How do I find out who is using CS0? Also which dtb file gets used? /boot and /boot/dtb, which one is used.
Thanks,
Benzun