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
3e7018de
Commit
3e7018de
authored
Nov 04, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/core' into spi-next
parents
5ba838c9
243f07be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
drivers/spi/spi.c
drivers/spi/spi.c
+15
-8
No files found.
drivers/spi/spi.c
View file @
3e7018de
...
...
@@ -270,15 +270,24 @@ EXPORT_SYMBOL_GPL(spi_bus_type);
static
int
spi_drv_probe
(
struct
device
*
dev
)
{
const
struct
spi_driver
*
sdrv
=
to_spi_driver
(
dev
->
driver
);
struct
spi_device
*
spi
=
to_spi_device
(
dev
);
int
ret
;
ret
=
of_clk_set_defaults
(
dev
->
of_node
,
false
);
if
(
ret
)
return
ret
;
if
(
dev
->
of_node
)
{
spi
->
irq
=
of_irq_get
(
dev
->
of_node
,
0
);
if
(
spi
->
irq
==
-
EPROBE_DEFER
)
return
-
EPROBE_DEFER
;
if
(
spi
->
irq
<
0
)
spi
->
irq
=
0
;
}
ret
=
dev_pm_domain_attach
(
dev
,
true
);
if
(
ret
!=
-
EPROBE_DEFER
)
{
ret
=
sdrv
->
probe
(
to_spi_device
(
dev
)
);
ret
=
sdrv
->
probe
(
spi
);
if
(
ret
)
dev_pm_domain_detach
(
dev
,
true
);
}
...
...
@@ -597,7 +606,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable)
if
(
spi
->
mode
&
SPI_CS_HIGH
)
enable
=
!
enable
;
if
(
spi
->
cs_gpio
>=
0
)
if
(
gpio_is_valid
(
spi
->
cs_gpio
)
)
gpio_set_value
(
spi
->
cs_gpio
,
!
enable
);
else
if
(
spi
->
master
->
set_cs
)
spi
->
master
->
set_cs
(
spi
,
!
enable
);
...
...
@@ -1433,9 +1442,6 @@ of_register_spi_device(struct spi_master *master, struct device_node *nc)
}
spi
->
max_speed_hz
=
value
;
/* IRQ */
spi
->
irq
=
irq_of_parse_and_map
(
nc
,
0
);
/* Store a pointer to the node in the device structure */
of_node_get
(
nc
);
spi
->
dev
.
of_node
=
nc
;
...
...
@@ -1949,7 +1955,7 @@ static int __spi_validate_bits_per_word(struct spi_master *master, u8 bits_per_w
int
spi_setup
(
struct
spi_device
*
spi
)
{
unsigned
bad_bits
,
ugly_bits
;
int
status
=
0
;
int
status
;
/* check mode to prevent that DUAL and QUAD set at the same time
*/
...
...
@@ -1986,8 +1992,9 @@ int spi_setup(struct spi_device *spi)
if
(
!
spi
->
bits_per_word
)
spi
->
bits_per_word
=
8
;
if
(
__spi_validate_bits_per_word
(
spi
->
master
,
spi
->
bits_per_word
))
return
-
EINVAL
;
status
=
__spi_validate_bits_per_word
(
spi
->
master
,
spi
->
bits_per_word
);
if
(
status
)
return
status
;
if
(
!
spi
->
max_speed_hz
)
spi
->
max_speed_hz
=
spi
->
master
->
max_speed_hz
;
...
...
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