I'm using BeagleBone Black platform which is basded on AM335x processor. And I know that I can use /dev/spidev1.0 to read/write spi device. And spidev is configured by device tree source(.dts file) as follow:
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
/* identification */
part-number = "spi0pinmux";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
spi0_pins_s0: spi0_pins_s0 {
pinctrl-single,pins = <
0x150 0x30 /* spi0_sclk, INPUT_PULLUP | MODE0 */
0x154 0x10 /* spi0_d0, OUTPUT_PULLUP | MODE0 */
0x158 0x30 /* spi0_d1, INPUT_PULLUP | MODE0 */
0x15c 0x10 /* spi0_cs0, OUTPUT_PULLUP | MODE0 */
>;
};
};
};
fragment@1 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins_s0>;
ti,pindir-d0-out-d1-in = <1>;
spidev@0 {
spi-max-frequency = <24000000>;
reg = <0>;
compatible = "linux,spidev";
};
};
};
};
And now I want to use my own driver, instead of spidev. So, I removed the following from the above .dts file, in order to remove spidev.
spidev@0 {
spi-max-frequency = <24000000>;
reg = <0>;
compatible = "linux,spidev";
};
And then, I can register my spi device driver with SPI1 and CS0.
But I cannot read/write registers of spi device anymore. I checked the timing. It seems that CS is always in low level when my board powers up without any reading/writing operation. Is it a problem? I suspect that the SPI1 with CS0 is not configured correctly.
Could you please give some suggestions? Or tell me how to configure SPI1 CS0 without spidev installed?
Thanks a lot.
Mian Tang