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
ccef8441
Commit
ccef8441
authored
May 10, 2021
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge existing fixes from spi/for-5.13
parents
6efb943b
6d5ff8e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
drivers/spi/Kconfig
drivers/spi/Kconfig
+1
-1
drivers/spi/spi-zynq-qspi.c
drivers/spi/spi-zynq-qspi.c
+4
-5
drivers/spi/spi.c
drivers/spi/spi.c
+12
-6
No files found.
drivers/spi/Kconfig
View file @
ccef8441
...
@@ -65,7 +65,7 @@ config SPI_ALTERA
...
@@ -65,7 +65,7 @@ config SPI_ALTERA
This is the driver for the Altera SPI Controller.
This is the driver for the Altera SPI Controller.
config SPI_ALTERA_CORE
config SPI_ALTERA_CORE
tristate "Altera SPI Controller core code"
tristate "Altera SPI Controller core code"
if COMPILE_TEST
select REGMAP
select REGMAP
help
help
"The core code for the Altera SPI Controller"
"The core code for the Altera SPI Controller"
...
...
drivers/spi/spi-zynq-qspi.c
View file @
ccef8441
...
@@ -367,7 +367,7 @@ static int zynq_qspi_config_op(struct zynq_qspi *xqspi, struct spi_device *spi)
...
@@ -367,7 +367,7 @@ static int zynq_qspi_config_op(struct zynq_qspi *xqspi, struct spi_device *spi)
}
}
/**
/**
* zynq_qspi_setup - Configure the QSPI controller
* zynq_qspi_setup
_op
- Configure the QSPI controller
* @spi: Pointer to the spi_device structure
* @spi: Pointer to the spi_device structure
*
*
* Sets the operational mode of QSPI controller for the next QSPI transfer, baud
* Sets the operational mode of QSPI controller for the next QSPI transfer, baud
...
@@ -528,18 +528,17 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem,
...
@@ -528,18 +528,17 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem,
struct
zynq_qspi
*
xqspi
=
spi_controller_get_devdata
(
mem
->
spi
->
master
);
struct
zynq_qspi
*
xqspi
=
spi_controller_get_devdata
(
mem
->
spi
->
master
);
int
err
=
0
,
i
;
int
err
=
0
,
i
;
u8
*
tmpbuf
;
u8
*
tmpbuf
;
u8
opcode
=
op
->
cmd
.
opcode
;
dev_dbg
(
xqspi
->
dev
,
"cmd:%#x mode:%d.%d.%d.%d
\n
"
,
dev_dbg
(
xqspi
->
dev
,
"cmd:%#x mode:%d.%d.%d.%d
\n
"
,
opcode
,
op
->
cmd
.
buswidth
,
op
->
addr
.
buswidth
,
op
->
cmd
.
op
code
,
op
->
cmd
.
buswidth
,
op
->
addr
.
buswidth
,
op
->
dummy
.
buswidth
,
op
->
data
.
buswidth
);
op
->
dummy
.
buswidth
,
op
->
data
.
buswidth
);
zynq_qspi_chipselect
(
mem
->
spi
,
true
);
zynq_qspi_chipselect
(
mem
->
spi
,
true
);
zynq_qspi_config_op
(
xqspi
,
mem
->
spi
);
zynq_qspi_config_op
(
xqspi
,
mem
->
spi
);
if
(
op
->
cmd
.
nbytes
)
{
if
(
op
->
cmd
.
opcode
)
{
reinit_completion
(
&
xqspi
->
data_completion
);
reinit_completion
(
&
xqspi
->
data_completion
);
xqspi
->
txbuf
=
&
opcode
;
xqspi
->
txbuf
=
(
u8
*
)
&
op
->
cmd
.
opcode
;
xqspi
->
rxbuf
=
NULL
;
xqspi
->
rxbuf
=
NULL
;
xqspi
->
tx_bytes
=
op
->
cmd
.
nbytes
;
xqspi
->
tx_bytes
=
op
->
cmd
.
nbytes
;
xqspi
->
rx_bytes
=
op
->
cmd
.
nbytes
;
xqspi
->
rx_bytes
=
op
->
cmd
.
nbytes
;
...
...
drivers/spi/spi.c
View file @
ccef8441
...
@@ -47,10 +47,6 @@ static void spidev_release(struct device *dev)
...
@@ -47,10 +47,6 @@ static void spidev_release(struct device *dev)
{
{
struct
spi_device
*
spi
=
to_spi_device
(
dev
);
struct
spi_device
*
spi
=
to_spi_device
(
dev
);
/* spi controllers may cleanup for released devices */
if
(
spi
->
controller
->
cleanup
)
spi
->
controller
->
cleanup
(
spi
);
spi_controller_put
(
spi
->
controller
);
spi_controller_put
(
spi
->
controller
);
kfree
(
spi
->
driver_override
);
kfree
(
spi
->
driver_override
);
kfree
(
spi
);
kfree
(
spi
);
...
@@ -558,6 +554,12 @@ static int spi_dev_check(struct device *dev, void *data)
...
@@ -558,6 +554,12 @@ static int spi_dev_check(struct device *dev, void *data)
return
0
;
return
0
;
}
}
static
void
spi_cleanup
(
struct
spi_device
*
spi
)
{
if
(
spi
->
controller
->
cleanup
)
spi
->
controller
->
cleanup
(
spi
);
}
/**
/**
* spi_add_device - Add spi_device allocated with spi_alloc_device
* spi_add_device - Add spi_device allocated with spi_alloc_device
* @spi: spi_device to register
* @spi: spi_device to register
...
@@ -622,11 +624,13 @@ int spi_add_device(struct spi_device *spi)
...
@@ -622,11 +624,13 @@ int spi_add_device(struct spi_device *spi)
/* Device may be bound to an active driver when this returns */
/* Device may be bound to an active driver when this returns */
status
=
device_add
(
&
spi
->
dev
);
status
=
device_add
(
&
spi
->
dev
);
if
(
status
<
0
)
if
(
status
<
0
)
{
dev_err
(
dev
,
"can't add %s, status %d
\n
"
,
dev_err
(
dev
,
"can't add %s, status %d
\n
"
,
dev_name
(
&
spi
->
dev
),
status
);
dev_name
(
&
spi
->
dev
),
status
);
else
spi_cleanup
(
spi
);
}
else
{
dev_dbg
(
dev
,
"registered child %s
\n
"
,
dev_name
(
&
spi
->
dev
));
dev_dbg
(
dev
,
"registered child %s
\n
"
,
dev_name
(
&
spi
->
dev
));
}
done:
done:
mutex_unlock
(
&
spi_add_lock
);
mutex_unlock
(
&
spi_add_lock
);
...
@@ -710,6 +714,8 @@ void spi_unregister_device(struct spi_device *spi)
...
@@ -710,6 +714,8 @@ void spi_unregister_device(struct spi_device *spi)
if
(
!
spi
)
if
(
!
spi
)
return
;
return
;
spi_cleanup
(
spi
);
if
(
spi
->
dev
.
of_node
)
{
if
(
spi
->
dev
.
of_node
)
{
of_node_clear_flag
(
spi
->
dev
.
of_node
,
OF_POPULATED
);
of_node_clear_flag
(
spi
->
dev
.
of_node
,
OF_POPULATED
);
of_node_put
(
spi
->
dev
.
of_node
);
of_node_put
(
spi
->
dev
.
of_node
);
...
...
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