I have add some code for spi_board_info just as:
spi_board_info dm355_spi_board_info[] ={
//add by duke 2009.6.18
{
.modalias = "spidev",
.platform_data = NULL,//&davinci_8k_spi_eeprom_info,
.mode = SPI_MODE_0,
.irq = 0,
.max_speed_hz = 2 * 1000 * 1000 /* max sample rate at 3V */ ,
.bus_num = 65535,
.chip_select = 0,
},
.....................
and the spidev.c code:
static struct spi_driver spidev_spi = {
.driver = {
.name = "spidev",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
},
.probe = spidev_probe,
.remove = __devexit_p(spidev_remove),
/* NOTE: suspend/resume methods are not necessary here.
* We don't do anything except pass the requests to/from
* the underlying controller. The refrigerator handles
* most issues; the controller driver handles the rest.
*/
};
I want to know is it spi0 or spi1 about the dm355_spi_board_info[] settings ?
2009-06-23
zuowenping
发件人: zuowenping
发送时间: 2009-06-23 16:08:09
收件人: Philby John
抄送: davinci-linux-open-source
主题: Re: Re: how can i use spi in dm355?
thanks Philby very much!
I have done according to your words,I cann't see the device node in /dev
yet,and i mknod and create node /dev/spidev0, and now i can run my
spidev_test.c,
# insmod spidev.ko
# mknod /dev/spi0 c 153 0
# ./spi_test &
# spi mode: 3
bits peBUG: scheduling while atomic: spi_test/0x00000001/1062
r word: 8
max scaller is schedule+0xec/0x12c
peed: 500000 Hz (500 KHz)
it seem some errors occur!
2009-06-23
zuowenping
发件人: Philby John
发送时间: 2009-06-23 14:51:50
收件人: zuowenping
抄送: davinci-linux-open-source
主题: Re: how can i use spi in dm355?
zuowenping,
You need to modify the arch/arm/mach-davinci/davinci_spi_platform.c
struct spi_board_info dm6467_spi_board_info[], .modalias =
DAVINCI_SPI_EEPROM_NAME, to .modalias = "spidev". Also you must enable
CONFIG_SPI_SPIDEV. After that the kernel will detect the device as
"spidev0" and that should get spidev_probe() to work. I think :)
Regards,
Philby
On Tue, 2009-06-23 at 10:00 +0800, zuowenping wrote:
> I have read the source code ,davinci_spi_board_init() must support
> board info for the spidev driver ,just like the spi_eeprom example,but
> i don't know how can i support the board info? i have insmod the
> module spidev.ko,but i cann't prouduce the device
> inode /dev/spi*.* ,so it must the spidev_probe() function cann't been
> callback!
>
>
> 2009-06-23
>
> ______________________________________________________________________
> zuowenping
>
> ______________________________________________________________________
> 发件人: zuowenping
> 发送时间: 2009-06-22 16:34:45
> 收件人: davinci-linux-open-source
> 抄送: chris-meng
> 主题: how can i use spi in dm355?
>
> dear all:
> I am using mv_pro_4.0.1 in dm355 platform,now i want to use
> spi0 and spi1 to communication with other devices which is like using
> i2c open() , read() ,and write() to various device by sub address in
> userspace. My linux kernel is 2.6.10,I have find the spidev.c and
> spidev_test.c in linux2.6.30,So i have transplanted the spidev.c as a
> module in linux kernel 2.6.10,but when i insmod the module,i cann't
> find the needful device in /dev/ path,so i cann't run spidev_test.c to
> test spi,I think there may be some errors in dm355 device driver,but i
> don't know how to modify it? Any help will be appreciated!
>
> 2009-06-22
>
> ______________________________________________________________________
> zuowenping
> _______________________________________________
> Davinci-linux-open-source mailing list
> [email protected]
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source