[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Adding SPI Driver causes Kernel to Hang



Thanks Nicolas,

I see that is from spi.h.  Can I use the structure from xspi in some way instead?  Thanks.

Matt

On Mon, Feb 23, 2009 at 01:34, Nicolas Schier <schier@xxxxxx> wrote:
På Mon, Feb 23, 2009 at 12:46:38AM -0800 skrev Matt Staniszewski:
> From: Matt Staniszewski <matt.staniszewski@xxxxxxxxx>
> Date: Mon, 23 Feb 2009 00:46:38 -0800
> Subject: Re: [microblaze-uclinux] Adding SPI Driver causes Kernel to Hang
>
> I found the functions listed in xspi_ioctl.h.  I tried to write a sample
> script similar to a gpio test script my friend wrote.  However, there's no
> /dev/spi to open a file descriptor for.  I have the xilinx_spi device
> recognized in the boot up, how do I map it to /dev/spi?  Thanks.

Perhaps this code snips might help you:

       static struct spi_driver spi_driver = {
               .driver = {
                       .name = "xilinx_spi",
                       .owner  = THIS_MODULE,
               },
               .probe  = spi_probe,
               .remove = __devexit_p(spi_remove),
       };

       /* ... */

       ret = spi_register_driver(&spi_driver);

       /* ... */

       static int __devinit
       spi_probe (struct spi_device *spi_device)
       {
               spi->mode = SPI_MODE_0 | SPI_LOOP;

               return 0;
       }

       static int __devexit
       spi_remove (struct spi_device *spi_device)
       {
               return 0;
       }

Nicolas

--
gpg public key: ID 0xACBC3B35, jabber: nicolas@xxxxxxxxx
 -- frykten for herren er opphav til kunnskap --