diff options
author | Caveh Jalali <caveh@chromium.org> | 2021-06-01 23:12:38 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-03 04:21:54 +0000 |
commit | 27fab596a73e410cdc87c078273d9eabaa438bff (patch) | |
tree | 44b60547ea5b8bed1eb4d3016e93d9acc8eb844a /common | |
parent | 7b06daaf25d93cd7c9c98f6f14bedded35a44dca (diff) | |
download | chrome-ec-27fab596a73e410cdc87c078273d9eabaa438bff.tar.gz |
COIL: spi_nor: Rename spi_master to spi_controller
This renames the spi_master struct member of spi_nor_device_t to
spi_controller.
BRANCH=none
BUG=b:163885307
TEST=make buildall passes;
"compare_build.sh -b all" shows no difference
Change-Id: I446de6e60fa1e4dfa1266dca04d851fbfb6c250b
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932467
Reviewed-by: Harry Cutts <hcutts@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/spi_nor.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/common/spi_nor.c b/common/spi_nor.c index 4fda9f41e1..0a719d63b3 100644 --- a/common/spi_nor.c +++ b/common/spi_nor.c @@ -60,7 +60,7 @@ static int spi_nor_read_status(const struct spi_nor_device_t *spi_nor_device, { uint8_t cmd = SPI_NOR_OPCODE_READ_STATUS; - return spi_transaction(&spi_devices[spi_nor_device->spi_master], + return spi_transaction(&spi_devices[spi_nor_device->spi_controller], &cmd, 1, status_register_value, 1); } @@ -74,7 +74,7 @@ static int spi_nor_write_enable(const struct spi_nor_device_t *spi_nor_device) int rv = EC_SUCCESS; /* Set the write enable latch. */ - rv = spi_transaction(&spi_devices[spi_nor_device->spi_master], + rv = spi_transaction(&spi_devices[spi_nor_device->spi_controller], &cmd, 1, NULL, 0); if (rv) return rv; @@ -100,7 +100,7 @@ static int spi_nor_read_ear(const struct spi_nor_device_t *spi_nor_device, { uint8_t command = SPI_NOR_OPCODE_RDEAR; - return spi_transaction(&spi_devices[spi_nor_device->spi_master], + return spi_transaction(&spi_devices[spi_nor_device->spi_controller], &command, sizeof(command), value, 1); } @@ -122,7 +122,7 @@ int spi_nor_write_ear(const struct spi_nor_device_t *spi_nor_device, buf[0] = SPI_NOR_OPCODE_WREAR; buf[1] = value; - rv = spi_transaction(&spi_devices[spi_nor_device->spi_master], + rv = spi_transaction(&spi_devices[spi_nor_device->spi_controller], buf, sizeof(buf), NULL, 0); if (rv) { CPRINTS(spi_nor_device, "Failed to write EAR, rv=%d", rv); @@ -192,7 +192,7 @@ static int spi_nor_read_jedec_mfn_id( uint8_t cmd = SPI_NOR_OPCODE_JEDEC_ID; /* Read the standardized part of the JEDEC ID. */ - rv = spi_transaction(&spi_devices[spi_nor_device->spi_master], + rv = spi_transaction(&spi_devices[spi_nor_device->spi_controller], &cmd, 1, jedec_id, SPI_NOR_JEDEC_ID_BANKS); if (rv) return rv; @@ -229,7 +229,7 @@ static int spi_nor_read_sfdp_dword( sfdp_cmd[2] = (sfdp_offset & 0xFF00) >> 8; sfdp_cmd[3] = (sfdp_offset & 0xFF); sfdp_cmd[4] = 0; /* Required extra cycle. */ - return spi_transaction(&spi_devices[spi_nor_device->spi_master], + return spi_transaction(&spi_devices[spi_nor_device->spi_controller], sfdp_cmd, 5, (uint8_t *)out_dw, 4); } @@ -475,8 +475,9 @@ static int spi_nor_read_internal(const struct spi_nor_device_t *spi_nor_device, read_command_size = 4; } - rv = spi_transaction(&spi_devices[spi_nor_device->spi_master], - buf, read_command_size, data, read_size); + rv = spi_transaction( + &spi_devices[spi_nor_device->spi_controller], + buf, read_command_size, data, read_size); if (rv) return rv; @@ -566,9 +567,9 @@ int spi_nor_init(void) * * WARNING: * 1) In 3 Byte addressing mode only 16MiB of Serial NOR Flash is accessible. - * 2) If there's a second SPI master communicating with this Serial NOR Flash - * part on the board, the user is responsible for ensuring addressing mode - * compatibility and cooperation. + * 2) If there's a second SPI controller communicating with this Serial + * NOR Flash part on the board, the user is responsible for ensuring + * addressing mode compatibility and cooperation. * 3) The user must ensure that multiple users do not trample on each other * by having multiple parties changing the device's addressing mode. * @@ -594,7 +595,7 @@ int spi_nor_set_4b_mode(struct spi_nor_device_t *spi_nor_device, /* Claim the driver mutex to modify the device state. */ mutex_lock(&driver_mutex); - rv = spi_transaction(&spi_devices[spi_nor_device->spi_master], + rv = spi_transaction(&spi_devices[spi_nor_device->spi_controller], &cmd, 1, NULL, 0); if (rv == EC_SUCCESS) { spi_nor_device->in_4b_addressing_mode = @@ -627,7 +628,7 @@ int spi_nor_read_jedec_id(const struct spi_nor_device_t *spi_nor_device, /* Claim the driver mutex. */ mutex_lock(&driver_mutex); /* Read the JEDEC ID. */ - rv = spi_transaction(&spi_devices[spi_nor_device->spi_master], + rv = spi_transaction(&spi_devices[spi_nor_device->spi_controller], &cmd, 1, data, size); /* Release the driver mutex. */ mutex_unlock(&driver_mutex); @@ -774,7 +775,7 @@ int spi_nor_erase(const struct spi_nor_device_t *spi_nor_device, } rv = spi_transaction( - &spi_devices[spi_nor_device->spi_master], + &spi_devices[spi_nor_device->spi_controller], buf, erase_command_size, NULL, 0); if (rv) goto err_free; @@ -851,8 +852,9 @@ int spi_nor_write(const struct spi_nor_device_t *spi_nor_device, /* Copy data to write into the buffer after the prefix. */ memmove(buf + prefix_size, data, write_size); - rv = spi_transaction(&spi_devices[spi_nor_device->spi_master], - buf, prefix_size + write_size, NULL, 0); + rv = spi_transaction( + &spi_devices[spi_nor_device->spi_controller], + buf, prefix_size + write_size, NULL, 0); if (rv) goto err_free; @@ -904,8 +906,8 @@ static int command_spi_nor_info(int argc, char **argv) ccprintf("Serial NOR Flash Device %d:\n", spi_nor_device_index); ccprintf("\tName: %s\n", spi_nor_device->name); - ccprintf("\tSPI master index: %d\n", - spi_nor_device->spi_master); + ccprintf("\tSPI controller index: %d\n", + spi_nor_device->spi_controller); ccprintf("\tTimeout: %d uSec\n", spi_nor_device->timeout_usec); ccprintf("\tCapacity: %d KiB\n", |