LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 10-06-2015, 03:19 AM   #1
win.tech2
LQ Newbie
 
Registered: Oct 2015
Posts: 1

Rep: Reputation: Disabled
SPI-SLAVE driver for linux


Belows are in described in include/linux/spi/spi.h.

* A @spi_device is used to interchange data between an SPI slave
* (usually a discrete chip) and CPU memory.

Why are there no drivers for SPI-SLAVE?
Most of other serial drivers are provided and updated recently.
But SPI-SLAVE drivers are not included still now.
 
Old 10-06-2015, 03:34 AM   #2
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
Quote:
Originally Posted by win.tech2 View Post
Why are there no drivers for SPI-SLAVE?
From Linux Documentation/spi/spi-summary:
This document (and Linux) currently only supports the master side of SPI interactions.
IOW nobody has come up with an acceptable framework for SPI slaves that's similar to what's available for USB gadgets.
Also consider that the typical SPI slave is likely to use a microcontroller incapable of running Linux (although that could change in a few more years).

Regards

Last edited by blue_z; 10-06-2015 at 03:46 AM.
 
Old 10-06-2015, 06:47 PM   #3
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
Quote:
Originally Posted by win.tech2 View Post
But SPI-SLAVE drivers are not included still now.
On the Linux host side of the SPI bus, the device driver for the SPI Master controller is a platform driver that performs the actual I/O on the SPI bus.
There are no device drivers for the SPI slaves, but rather SPI protocol drivers.

There should be a protocol driver for each SPI slave on that bus.
The protocol driver prepares and receives the data for/from its SPI slave, and uses the kernel SPI framework to perform the I/O through the SPI master.
It is the protocol driver that interfaces with userspace, and handles the requests for the device node in /dev.

Source code for SPI protocol drivers are not located in drivers/spi, but rather located by the functionality of the slave device.
An SPI slave that performs A-to-D conversion is in drivers/iio/adc. An SPI slave that is an RS-232 communications link is in drivers/tty/serial. An SPI slave that is a realtime clock is in drivers/rtc.

A list of SPI protocol drivers in the Linux kernel can be generated by searching for a salient framework procedure such as spi_set_drvdata().

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slave Support for SPI in kernel NishaK Linux - Newbie 0 04-26-2013 01:44 PM
Problems with dynamic registration of SPI protocol slave devices Brahmsian Linux - Embedded & Single-board computer 1 04-18-2012 01:20 AM
About use FIQ for SPI slave in device driver. jason222333 Linux - Kernel 4 10-25-2010 02:37 PM
About How to SPI slave keep up master jason222333 Linux - Kernel 0 10-11-2010 08:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration