Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8c603485
Commit
8c603485
authored
Nov 04, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/doc' into spi-next
parents
f0a2a049
97d56dc6
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
23 deletions
+117
-23
drivers/spi/spi.c
drivers/spi/spi.c
+93
-9
include/linux/spi/spi.h
include/linux/spi/spi.h
+24
-14
No files found.
drivers/spi/spi.c
View file @
8c603485
This diff is collapsed.
Click to expand it.
include/linux/spi/spi.h
View file @
8c603485
...
...
@@ -51,6 +51,8 @@ extern struct bus_type spi_bus_type;
* @bytes_tx: number of bytes sent to device
* @bytes_rx: number of bytes received from device
*
* @transfer_bytes_histo:
* transfer bytes histogramm
*/
struct
spi_statistics
{
spinlock_t
lock
;
/* lock for the whole structure */
...
...
@@ -68,6 +70,8 @@ struct spi_statistics {
unsigned
long
long
bytes_rx
;
unsigned
long
long
bytes_tx
;
#define SPI_STATISTICS_HISTO_SIZE 17
unsigned
long
transfer_bytes_histo
[
SPI_STATISTICS_HISTO_SIZE
];
};
void
spi_statistics_add_transfer_stats
(
struct
spi_statistics
*
stats
,
...
...
@@ -843,8 +847,10 @@ extern int spi_bus_unlock(struct spi_master *master);
* @len: data buffer size
* Context: can sleep
*
* This
writes the buffer and returns zero or a negative error code
.
* This
function writes the buffer @buf
.
* Callable only from contexts that can sleep.
*
* Return: zero on success, else a negative error code.
*/
static
inline
int
spi_write
(
struct
spi_device
*
spi
,
const
void
*
buf
,
size_t
len
)
...
...
@@ -867,8 +873,10 @@ spi_write(struct spi_device *spi, const void *buf, size_t len)
* @len: data buffer size
* Context: can sleep
*
* This
reads the buffer and returns zero or a negative error code
.
* This
function reads the buffer @buf
.
* Callable only from contexts that can sleep.
*
* Return: zero on success, else a negative error code.
*/
static
inline
int
spi_read
(
struct
spi_device
*
spi
,
void
*
buf
,
size_t
len
)
...
...
@@ -895,7 +903,7 @@ spi_read(struct spi_device *spi, void *buf, size_t len)
*
* For more specific semantics see spi_sync().
*
*
It returns
zero on success, else a negative error code.
*
Return: Return:
zero on success, else a negative error code.
*/
static
inline
int
spi_sync_transfer
(
struct
spi_device
*
spi
,
struct
spi_transfer
*
xfers
,
...
...
@@ -919,9 +927,10 @@ extern int spi_write_then_read(struct spi_device *spi,
* @cmd: command to be written before data is read back
* Context: can sleep
*
* This returns the (unsigned) eight bit number returned by the
* device, or else a negative error code. Callable only from
* contexts that can sleep.
* Callable only from contexts that can sleep.
*
* Return: the (unsigned) eight bit number returned by the
* device, or else a negative error code.
*/
static
inline
ssize_t
spi_w8r8
(
struct
spi_device
*
spi
,
u8
cmd
)
{
...
...
@@ -940,12 +949,13 @@ static inline ssize_t spi_w8r8(struct spi_device *spi, u8 cmd)
* @cmd: command to be written before data is read back
* Context: can sleep
*
* This returns the (unsigned) sixteen bit number returned by the
* device, or else a negative error code. Callable only from
* contexts that can sleep.
*
* The number is returned in wire-order, which is at least sometimes
* big-endian.
*
* Callable only from contexts that can sleep.
*
* Return: the (unsigned) sixteen bit number returned by the
* device, or else a negative error code.
*/
static
inline
ssize_t
spi_w8r16
(
struct
spi_device
*
spi
,
u8
cmd
)
{
...
...
@@ -964,13 +974,13 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd)
* @cmd: command to be written before data is read back
* Context: can sleep
*
* This returns the (unsigned) sixteen bit number returned by the device in cpu
* endianness, or else a negative error code. Callable only from contexts that
* can sleep.
*
* This function is similar to spi_w8r16, with the exception that it will
* convert the read 16 bit data word from big-endian to native endianness.
*
* Callable only from contexts that can sleep.
*
* Return: the (unsigned) sixteen bit number returned by the device in cpu
* endianness, or else a negative error code.
*/
static
inline
ssize_t
spi_w8r16be
(
struct
spi_device
*
spi
,
u8
cmd
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment