打印

SPI0总线多设备问题

[复制链接]
1403|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
gdaniu|  楼主 | 2012-10-16 17:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
比如我有两个SPI设备要用到SPI0总线
1、
Platform_device

struct platform_device s3c_device_spi0 = {

.name

= "s3c2410-spi",


.id

= 0,


.num_resources

= ARRAY_SIZE(s3c_spi0_resource),


.resource

= s3c_spi0_resource,


.dev
= {


.dma_mask = &s3c_device_spi0_dmamask,


.coherent_dma_mask = 0xffffffffUL


}

};
2、
Platform_driver

static struct platform_driver s3c24xx_spi_driver = {

.remove
= __exit_p(s3c24xx_spi_remove),


.driver
= {


.name
= "s3c2410-spi",


.owner
= THIS_MODULE,


.pm
= S3C24XX_SPI_PMOPS,


},

};

3、
spi_device

static struct spi_board_info s3c2410_spi0_board[] = {

[0] =


{


.modalias
= " spitest1",


.bus_num
= 0,


.chip_select
= 0,


.irq

= IRQ_EINT9,


.max_speed_hz
= 500*1000,


},


[1] =


{


.modalias
= "spitest2",


.bus_num
= 0,


.chip_select
= 0,


.irq
= IRQ_EINT9,


.max_speed_hz
= 500*1000,



},

};

4、
两个spi_driver

1static struct spi_driver tle62x0_driver = {

.driver = {


.name
= "spitest1",


.owner
= THIS_MODULE,


},


.probe
= tle62x0_probe,


.remove
= __devexit_p(tle62x0_remove),

};
2static struct spi_driver tle62x0_driver = {

.driver = {


.name
= "spitest2",


.owner
= THIS_MODULE,


},


.probe
= tle62x0_probe,


.remove
= __devexit_p(tle62x0_remove),

};

5、
问题:始终只有名叫“spitest1”的spi_driver才能probe成功,“spitest1”正是spi_device

6、
static struct spi_board_info s3c2410_spi0_board[]
中的第一组元素,意味着spi_device

static struct spi_board_info s3c2410_spi0_board[]第二个以上的元素无法匹配,这是为何?
该如何才能匹配?
请大拿指点!衷心谢谢!

相关帖子

沙发
阿南| | 2012-10-18 09:45 | 只看该作者

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

4

帖子

0

粉丝