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
Kirill Smelkov
linux
Commits
19f15f0e
Commit
19f15f0e
authored
Nov 09, 2012
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'spi-core' and 'spi-tegra' into spi-next
parents
fad8f9c0
caae070c
24bc8971
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
drivers/spi/spi-tegra20-slink.c
drivers/spi/spi-tegra20-slink.c
+2
-3
drivers/spi/spi.c
drivers/spi/spi.c
+13
-3
No files found.
drivers/spi/spi-tegra20-slink.c
View file @
19f15f0e
...
...
@@ -727,8 +727,7 @@ static int tegra_slink_start_transfer_one(struct spi_device *spi,
unsigned
long
command
;
unsigned
long
command2
;
bits_per_word
=
t
->
bits_per_word
?
t
->
bits_per_word
:
spi
->
bits_per_word
;
bits_per_word
=
t
->
bits_per_word
;
speed
=
t
->
speed_hz
?
t
->
speed_hz
:
spi
->
max_speed_hz
;
if
(
!
speed
)
speed
=
tspi
->
spi_max_frequency
;
...
...
@@ -1110,8 +1109,8 @@ const struct tegra_slink_chip_data tegra20_spi_cdata = {
};
static
struct
of_device_id
tegra_slink_of_match
[]
__devinitconst
=
{
{
.
compatible
=
"nvidia,tegra20-slink"
,
.
data
=
&
tegra20_spi_cdata
,
},
{
.
compatible
=
"nvidia,tegra30-slink"
,
.
data
=
&
tegra30_spi_cdata
,
},
{
.
compatible
=
"nvidia,tegra20-slink"
,
.
data
=
&
tegra20_spi_cdata
,
},
{}
};
MODULE_DEVICE_TABLE
(
of
,
tegra_slink_of_match
);
...
...
drivers/spi/spi.c
View file @
19f15f0e
...
...
@@ -1156,7 +1156,7 @@ EXPORT_SYMBOL_GPL(spi_busnum_to_master);
int
spi_setup
(
struct
spi_device
*
spi
)
{
unsigned
bad_bits
;
int
status
;
int
status
=
0
;
/* help drivers fail *cleanly* when they need options
* that aren't supported with their current master
...
...
@@ -1171,7 +1171,8 @@ int spi_setup(struct spi_device *spi)
if
(
!
spi
->
bits_per_word
)
spi
->
bits_per_word
=
8
;
status
=
spi
->
master
->
setup
(
spi
);
if
(
spi
->
master
->
setup
)
status
=
spi
->
master
->
setup
(
spi
);
dev_dbg
(
&
spi
->
dev
,
"setup mode %d, %s%s%s%s"
"%u bits/w, %u Hz max --> %d
\n
"
,
...
...
@@ -1190,6 +1191,7 @@ EXPORT_SYMBOL_GPL(spi_setup);
static
int
__spi_async
(
struct
spi_device
*
spi
,
struct
spi_message
*
message
)
{
struct
spi_master
*
master
=
spi
->
master
;
struct
spi_transfer
*
xfer
;
/* Half-duplex links include original MicroWire, and ones with
* only one data pin like SPI_3WIRE (switches direction) or where
...
...
@@ -1198,7 +1200,6 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
*/
if
((
master
->
flags
&
SPI_MASTER_HALF_DUPLEX
)
||
(
spi
->
mode
&
SPI_3WIRE
))
{
struct
spi_transfer
*
xfer
;
unsigned
flags
=
master
->
flags
;
list_for_each_entry
(
xfer
,
&
message
->
transfers
,
transfer_list
)
{
...
...
@@ -1211,6 +1212,15 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
}
}
/**
* Set transfer bits_per_word as spi device default if it is not
* set for this transfer.
*/
list_for_each_entry
(
xfer
,
&
message
->
transfers
,
transfer_list
)
{
if
(
!
xfer
->
bits_per_word
)
xfer
->
bits_per_word
=
spi
->
bits_per_word
;
}
message
->
spi
=
spi
;
message
->
status
=
-
EINPROGRESS
;
return
master
->
transfer
(
spi
,
message
);
...
...
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