why couldn't i access spi_read,spi_write in spidev.c??
Iam writing a driver for RF module(spi controller interface) with linux2.6.30 on my Embeded board.I modified spidev.c,add some test code (use spi_read,spi_write).then I have passed test with http://www.kernel.org/doc/Documentation/spi/spidev_test.c ,but I found that the spi_read,spi_write not work in my kernel,but ioctl(fd, SPI_IOC_MESSAGE(1), &tr) is OK in the userspace testing code.why couldn't i access spi_read,spi_write in spidev.c??
Note: probe has been called normally!!! test code in spidev_probe is following. Code:
static int spidev_probe(struct spi_device *spi) Note: bellow is doc about IO interface in http://www.kernel.org/doc/Documentation/spi/spidev Standard read() and write() operations are obviously only half-duplex, and the chipselect is deactivated between those operations. Full-duplex access,and composite operation without chipselect de-activation, is available using the SPI_IOC_MESSAGE(N) request. 传统的read write使用的是半双工模式,需要cs片选;而 SPI_IOC_MESSAGE(N) 方式使用全双工,无须片选。 - At this time there is no async I/O support; everything is purely synchronous.都是同步的? |
do you have compile time error or runtime error?
|
Quote:
NOTE:I connect MISO wire with MOSI, and run test file http://www.kernel.org/doc/Documentat.../spidev_test.c in kernel. The result run on the ARM9 board as bellow: Code:
[root@EmbedSky /test]# insmod lrf020.ko It seems strange:eek: Compiling Message: make -C /opt/linux/EmbedSky/linux-2.6.30.4 M=/opt/git-hub/linux_driver/lrf020-beta/lrf020-old modules -I /opt/linux/EmbedSky/linux-2.6.30.4/include make[1]: 进入目录“/opt/linux/EmbedSky/linux-2.6.30.4” CC [M] /opt/git-hub/linux_driver/lrf020-beta/lrf020-old/rf.o CC [M] /opt/git-hub/linux_driver/lrf020-beta/lrf020-old/uz2400d.o CC [M] /opt/git-hub/linux_driver/lrf020-beta/lrf020-old/spidev.o LD [M] /opt/git-hub/linux_driver/lrf020-beta/lrf020-old/lrf020.o Building modules, stage 2. MODPOST 1 modules CC /opt/git-hub/linux_driver/lrf020-beta/lrf020-old/lrf020.mod.o LD [M] /opt/git-hub/linux_driver/lrf020-beta/lrf020-old/lrf020.ko make[1]: 离开目录“/opt/linux/EmbedSky/linux-2.6.30.4” compiled ok! |
All times are GMT -5. The time now is 05:04 AM. |