summaryrefslogtreecommitdiff
path: root/mediatek_i2c_spi.c
diff options
context:
space:
mode:
authorAlexander Goncharov <chat@joursoir.net>2022-07-11 01:50:20 +0300
committerAnastasia Klimchuk <aklm@chromium.org>2022-07-15 00:53:01 +0000
commit964af12beece465c8e32e7e548f940ee957c50b7 (patch)
treed0003faaff2bef2ada2848288f4650bd854e5cdc /mediatek_i2c_spi.c
parentc614173d85cc94fc7dfaee08615d13b18c6825ee (diff)
downloadflashrom-git-964af12beece465c8e32e7e548f940ee957c50b7.tar.gz
mediatek_i2c_spi: Move shutdown function above spi_master struct
This patch prepares the programmer to use new API which allows to register shutdown function in spi_master struct. TEST=builds Comparing flashrom binary before and after the patch, make clean && make CONFIG_EVERYTHING=yes VERSION=none binary is the same Change-Id: I56d7273edfc8d323792b110aed1736f94043acb4 Signed-off-by: Alexander Goncharov <chat@joursoir.net> Ticket: https://ticket.coreboot.org/issues/391 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65747 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'mediatek_i2c_spi.c')
-rw-r--r--mediatek_i2c_spi.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/mediatek_i2c_spi.c b/mediatek_i2c_spi.c
index c59f3c85..e8c77ffb 100644
--- a/mediatek_i2c_spi.c
+++ b/mediatek_i2c_spi.c
@@ -439,18 +439,6 @@ static int mediatek_send_command(const struct flashctx *flash,
return 0;
}
-static const struct spi_master spi_master_i2c_mediatek = {
- .max_data_read = I2C_SMBUS_BLOCK_MAX,
- // Leave room for 1-byte command and up to a 4-byte address.
- .max_data_write = I2C_SMBUS_BLOCK_MAX - 5,
- .command = mediatek_send_command,
- .multicommand = default_spi_send_multicommand,
- .read = default_spi_read,
- .write_256 = default_spi_write_256,
- .write_aai = default_spi_write_aai,
- .probe_opcode = default_spi_probe_opcode,
-};
-
static int mediatek_shutdown(void *data)
{
int ret = 0;
@@ -463,6 +451,18 @@ static int mediatek_shutdown(void *data)
return ret;
}
+static const struct spi_master spi_master_i2c_mediatek = {
+ .max_data_read = I2C_SMBUS_BLOCK_MAX,
+ // Leave room for 1-byte command and up to a 4-byte address.
+ .max_data_write = I2C_SMBUS_BLOCK_MAX - 5,
+ .command = mediatek_send_command,
+ .multicommand = default_spi_send_multicommand,
+ .read = default_spi_read,
+ .write_256 = default_spi_write_256,
+ .write_aai = default_spi_write_aai,
+ .probe_opcode = default_spi_probe_opcode,
+};
+
static int mediatek_init(void)
{
int ret;