<div class="lia-message-body lia-component-body">
<div class="lia-message-body-content">
<p>Hi all,</p><p> </p><p>I am new to linux device driver
development. I have to develop a SPI driver for MPC8377 processor based
board. Right now I don't have a that board ready(but I have the
MPC837xERDB with me), so I was thinking of developing and testing it on
the RDB. But in MPC837xERDB, I don't have an SPI slave device, the SPI
pins on the board is connected to the SD card slot. Is it possible to
use SD card slot as SPI device? Also I have written a sample SPI driver,
but its probe function is not getting called?</p><p> </p><pre>#include <linux/module.h><br>#include <linux/spi/spi.h><br><br>static int __devinit spi_probe(struct spi_device *spi)<br>{<br> printk(KERN_DEBUG "spi_probe...");<br>
return 0;<br>}<br><br>static int __devexit spi_remove(struct spi_device *spi)<br>{<br> printk(KERN_DEBUG "spi_remove\n");<br> return 0;<br>}<br><br>static struct spi_driver sample_spi_driver = {<br>
.driver = {<br> .name = "sample-spi",<br> .bus = &spi_bus_type,<br> .owner = THIS_MODULE,<br> },<br> .probe = spi_probe,<br> .remove = spi_remove,<br>
};<br><br><br>static __init int spi_module_init(void)<br>{<br> printk(KERN_INFO "SPI Driver Version 0.1\n");<br> return spi_register_driver(&sample_spi_driver);<br>}<br><br>static __exit void spi_module_exit(void)<br>
{<br> /* unregister SPI device */<br> spi_unregister_driver(&sample_spi_driver);<br>}<br><br>MODULE_LICENSE("GPL");<br><br>module_init(spi_module_init);<br>module_exit(spi_module_exit);</pre><p> </p><p>Any help would be greatly appreciated.<br>
Thanks in advance,<br>Ravi</p>
</div>
</div>