På Mon, Feb 23, 2009 at 09:58:06PM -0800 skrev Matt Staniszewski:
> From: Matt Staniszewski <matt.staniszewski@xxxxxxxxx>
> To: microblaze-uclinux@xxxxxxxxxxxxxx
> Date: Mon, 23 Feb 2009 21:58:06 -0800
> Subject: Re: [microblaze-uclinux] Adding SPI Driver causes Kernel to Hang
>
> Thanks Nicolas,
>
> I see that is from spi.h.
Might be. Actually I have used it in a kernel driver to register it as
a spi driver to be able to handle spi stuff (spi_write).
> Can I use the structure from xspi in some way
> instead? Thanks.
I don't know where your question points to.
Nicolas
>
> 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>
> > > To: microblaze-uclinux@xxxxxxxxxxxxxx
> > > 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 --
> >
>
--
gpg public key: ID 0xACBC3B35, jabber: nicolas@xxxxxxxxx
-- frykten for herren er opphav til kunnskap --
Attachment:
pgpQhxRNsINP2.pgp
Description: PGP signature