How to revise the SPI dts file to transmit 24 bits data

Hi~
My device is Nvidia AGX Xavier. I want to use the SPI to transmit some data to DAC module, which need 24 bits SDIN each time. However, I don’t know how to revise the SPI dts file to transmit 24 bits data.
The following is dts file:
spi@3210000 {
compatible = “nvidia,tegra186-spi”;
reg = <0x0 0x3210000 0x0 0x10000>;
interrupts = <0x0 0x24 0x4>;
#address-cells = <0x1>;
#size-cells = <0x0>;
iommus = <0x2 0x20>;
dma-coherent;
dmas = <0x22 0xf 0x22 0xf>;
dma-names = “rx”, “tx”;
spi-max-frequency = <0x3dfd240>;
nvidia,clk-parents = “pll_p”, “clk_m”;
clocks = <0x4 0x87 0x4 0x66 0x4 0xe>;
clock-names = “spi”, “pll_p”, “clk_m”;
resets = <0x5 0x5b>;
reset-names = “spi”;
status = “okay”;
linux,phandle = <0x16f>;
phandle = <0x16f>;

            spi@0 {
                    compatible = "tegra-spidev";
                    reg = <0x0>;
                    spi-max-frequency = <0x1f78a40>;

                    controller-data {
                            nvidia,enable-hw-based-cs;
                            nvidia,rx-clk-tap-delay = <0x11>;
                    };
            };

            spi@1 {
                    compatible = "tegra-spidev";
                    reg = <0x1>;
                    spi-max-frequency = <0x1f78a40>;

                    controller-data {
                            nvidia,enable-hw-based-cs;
                            nvidia,rx-clk-tap-delay = <0x11>;
                    };
            };
    };

Thanks~

In addition, that is the 24 bits data transmitting

Hi,
Linux does not support 24 bits. It supports only 16, 32 bits.

Thanks,
But I found SPI official manual which said SPI can transmit size 4.8.16.or 32 bits for packed or 4~32 bits for unpacked Tx/Rx. So how to revise dtc file to set transmitting data size like 8 bits? Maybe I just need to transmit 3 times to reach 24 bits data.

Thanks,
Do you know about how to set 16 bits transmitting of SPI dts file?

Have a reference to spidev_test for “-b --bpw bits per word”

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.