UPSTREAM: drivers/spi/spiconsole: Fix broken spiconsole driver
Use spi_setup_slave to fill up the spi_slave structure with
pointer to spi_ctrlr structure which can then be used to perform all
spi operations.
BUG=none
BRANCH=none
TEST=none
Change-Id: I5b6a8bdfdb2340abdebe17cfcc52346f7fcb7f9f
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 9e49b0a2c5
Original-Change-Id: I2804ed1e85402426a654352e1ceaf0993546cd8b
Original-Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/19385
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/486755
This commit is contained in:
parent
c19decc23c
commit
8c830461bb
1 changed files with 4 additions and 3 deletions
|
|
@ -17,8 +17,11 @@
|
|||
#include <spi_flash.h>
|
||||
#include <console/spi.h>
|
||||
|
||||
static struct spi_slave slave;
|
||||
|
||||
void spiconsole_init(void) {
|
||||
spi_init();
|
||||
spi_setup_slave(0, 0, &slave);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -54,9 +57,7 @@ void spiconsole_tx_byte(unsigned char c) {
|
|||
if (c == '\n' || (sizeof(struct em100_msg_header) +
|
||||
msg.header.msg_length == spi_crop_chunk(0,
|
||||
MAX_MSG_LENGTH))) {
|
||||
struct spi_slave spi = { };
|
||||
|
||||
spi_xfer(&spi, &msg, sizeof(struct em100_msg_header) +
|
||||
spi_xfer(&slave, &msg, sizeof(struct em100_msg_header) +
|
||||
msg.header.msg_length, NULL, 0);
|
||||
|
||||
msg.header.msg_length = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue