1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

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>
This commit is contained in:
Alexander Goncharov 2022-07-11 01:50:20 +03:00 committed by Anastasia Klimchuk
parent c614173d85
commit 964af12bee

View File

@ -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;