aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spidev.c
Commit message (Collapse)AuthorAgeFilesLines
* spidev warning fixDavid Brownell2007-08-111-1/+3
| | | | | | | | | | Git rid of "warning: passing arg 2 of `access_ok' makes pointer from integer without a cast" reported on SH ... most architectures use macros in that test, SH uses inlined functions. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* spidev supports more communications modesAnton Vorontsov2007-07-311-3/+10
| | | | | | | | | | | | | | The spidev driver doesn't currently expose all SPI communications modes to userspace. This passes them all through to the driver. Two of them are potentially troublesome, in the sense that they could cause hardware conflicts on shared busses. It might be appropriate to add some privilege checks for for those modes. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* spidev compiler warning goneDavid Brownell2007-07-171-2/+4
| | | | | | | | | | | | | | | Get rid of annoying GCC warning on 32-bit platforms. drivers/spi/spidev.c: In function 'spidev_message': drivers/spi/spidev.c:184: warning: cast to pointer from integer of different size drivers/spi/spidev.c:216: warning: cast to pointer from integer of different size The trick is to add an extra cast using "ptrdiff_t" to convert the u64 to the correct size integer, and only then casting it into a "void *" pointer. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* spi: potential memleak in spidev_ioctlFlorin Malita2007-05-231-0/+1
| | | | | | | | | | 'ioc' should be deallocated if __copy_from_user fails (found by Coverity - CID 1644). Signed-off-by: Florin Malita <fmalita@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* spi/spidev: check message size before copyingDomen Puncer2007-05-231-6/+6
| | | | | | | | | | Message size needs to be checked before copying, or bad things could happen. Signed-off-by: Domen Puncer <domen.puncer@telargo.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* spi: fix spidev for >sizeof(long)/32 devicesDomen Puncer2007-05-161-1/+1
| | | | | | | | | find_first_zero_bit accepts number of bits, not longs. Signed-off-by: Domen Puncer <domen.puncer@telargo.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* /dev/spidevB.C interfaceAndrea Paterniani2007-05-081-0/+584
Add a filesystem API for <linux/spi/spi.h> stack. The initial version of this interface is purely synchronous. dbrownell@users.sourceforge.net: Cleaned up, bugfixed; much simplified; added preliminary documentation. Works with mdev given CONFIG_SYSFS_DEPRECATED; and presumably udev. Updated SPI_IOC_MESSAGE ioctl to full spi_message semantics, supporting groups of one or more transfers (each of which may be full duplex if desired). This is marked as EXPERIMENTAL with an explicit disclaimer that the API (notably the ioctls) is subject to change. Signed-off-by: Andrea Paterniani <a.paterniani@swapp-eng.it> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>