From 964af12beece465c8e32e7e548f940ee957c50b7 Mon Sep 17 00:00:00 2001 From: Alexander Goncharov Date: Mon, 11 Jul 2022 01:50:20 +0300 Subject: 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 Ticket: https://ticket.coreboot.org/issues/391 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65747 Tested-by: build bot (Jenkins) Reviewed-by: Anastasia Klimchuk Reviewed-by: Thomas Heijligen Reviewed-by: Felix Singer --- mediatek_i2c_spi.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'mediatek_i2c_spi.c') 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; -- cgit v1.2.1