I'm busy adding support for slave deviced behind mpc52xx-psc-spi.<br>One complication I have is that my SPI slave device has an interrupt output to the CPU.<br>My idea is to add it as a gpios property in the slave device's configuration:<br>
<br><div style="margin-left: 40px;"> spi@2400 { // PSC3 (SPI IF to the IO-controller )<br> device_type = "spi";<br> #address-cells = <1>;<br> #size-cells = <0>;<br>
compatible = "fsl,mpc5200-psc-spi","fsl,mpc5200b-psc-spi";<br> cell-index = <2>;<br> reg = <0x2400 0x100>;<br> interrupts = <2 3 0>;<br> interrupt-parent = <&mpc5200_pic>;<br>
gpios = <&gpt4 0 0>;<br><br> io-controller@0 {<br> compatible = "microkey,smc4000io";<br> spi-max-frequency = <1000000>;<br> reg = <0>;<br>
// gpios: first is IRQ to cpu<br> gpios = <&gpt6 0 0>;<br> };<br> };<br></div><br><br>Are there better/easier ways to do this?<br><br>How should I then register my spi slave driver? My smc4000io_probe function gets called correctly by of_spi support but when I register as follows:<br>
<br><div style="margin-left: 80px;">static struct spi_driver smc4000io_driver = {<br> .driver = {<br> .name = "smc4000io",<br> .bus = &spi_bus_type,<br> .owner = THIS_MODULE,<br>
},<br> .probe = smc4000io_probe,<br> .remove = __devexit_p(smc4000io_remove),<br>};<br><br>static int __init smc4000io_init(void)<br>{<br> return spi_register_driver(&smc4000io_driver);<br>}<br>
<br>static void __exit smc4000io_exit(void)<br>{<br> spi_unregister_driver(&smc4000io_driver);<br>}<br><br>module_init(smc4000io_init);<br></div><br>But when I do:<br><br><div style="margin-left: 80px;">static struct of_platform_driver smc4000_spi_of_driver = {<br>
.name = "smc4000io",<br> .match_table = smc4000io_of_match,<br> .probe = smc4000io_of_probe,<br> .remove = __devexit_p(smc4000io_of_remove),<br>};<br><br>static int __init smc4000io_init(void)<br>
{<br> return of_register_platform_driver(&smc4000_spi_of_driver);<br>}<br>module_init(smc4000io_init);<br></div><br>Then my smc4000io_of_probe function never gets called.<br><br>Thanks in advance,<br><br>Henk.<br><br>
<br><br><br><br><br><div class="gmail_quote">On Wed, Oct 29, 2008 at 3:45 PM, Grant Likely <span dir="ltr"><<a href="mailto:grant.likely@secretlab.ca">grant.likely@secretlab.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Wed, Oct 29, 2008 at 7:43 AM, Henk Stegeman <<a href="mailto:henk.stegeman@gmail.com">henk.stegeman@gmail.com</a>> wrote:<br>
> ..<br>
> ..<br>
> In my dts<br>
><br>
> I have my chipselect defined as follows:<br>
><br>
> gpt4: timer@640 { // General Purpose Timer GPT4 in GPIO mode for<br>
> SMC4000IO chip select.<br>
> compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";<br>
> cell-index = <4>;<br>
> reg = <0x640 0x10>;<br>
> interrupts = <1 13 0>;<br>
> interrupt-parent = <&mpc5200_pic>;<br>
> gpio-controller;<br>
> #gpio-cells = <2>;<br>
> };<br>
><br>
> I found the gpio in<br>
> # cat /sys/class/gpio/gpiochip215/label<br>
> /soc5200@f0000000/timer@640<br>
><br>
> The spi controller is defined like this:<br>
><br>
> spi@2400 {<br>
> device_type = "spi";<br>
> #address-cells = <1>;<br>
> #size-cells = <0>;<br>
> compatible = "fsl,mpc5200-psc-spi","fsl,mpc5200b-psc-spi";<br>
> cell-index = <2>;<br>
> reg = <2400 100>;<br>
> interrupts = <2 3 0>;<br>
> interrupt-parent = <&mpc5200_pic>;<br>
> gpios = <&gpt4 0 0>;<br>
><br>
> io-controller@0 {<br>
> compatible = "microkey,smc4000io";<br>
> spi-max-frequency = <1000000>;<br>
> reg = <0>;<br>
> };<br>
> };<br>
><br>
> At bootup linux (2.6.27) reports:<br>
><br>
> mpc52xx-psc-spi f0000960.spi: probe called without platform data, no<br>
> (de)activate_cs function will be called.<br>
><br>
> Is my assumption wrong that the gpios property is the way to map chipselects<br>
> to the spi driver?<br>
<br>
</div></div>Yes, that is the way you should work specify the chip selects, but the<br>
driver hasn't been updated to support it yet.<br>
<br>
g.<br>
<font color="#888888"><br>
--<br>
Grant Likely, B.Sc., P.Eng.<br>
Secret Lab Technologies Ltd.<br>
</font></blockquote></div><br>