diff options
author | Mary Ruthven <mruthven@chromium.org> | 2020-07-16 08:20:16 +1000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-11 23:39:12 +0000 |
commit | fc131dd7b1b9fd5f2b0c3a48c08a014510577d11 (patch) | |
tree | a46bd0fde84545b14752459c158eaab9f8c34f3d | |
parent | d5d85a3e4e4ce44cce30a5c6cc26a131772605c1 (diff) | |
download | chrome-ec-fc131dd7b1b9fd5f2b0c3a48c08a014510577d11.tar.gz |
usb_spi: add spi_hash_ to new_device and new_gang_mode
new_device and new_gang_mode are both only used for spi_hash SPI
enable/disable. Rename them, so that's clear.
BUG=none
TEST=make buildall -j
Change-Id: I67a4f7865e8a5ff21c79b4462a0f2c1d0f85f76d
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2300698
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
(cherry picked from commit ccacb7fc9378c4c00a39b2fbf913128c87e00b7f)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311249
(cherry picked from commit 96e157cb7cdbe503b35b027ba2d7809537665ecf)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2350296
-rw-r--r-- | board/cr50/usb_spi.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/board/cr50/usb_spi.c b/board/cr50/usb_spi.c index a4b0872bb5..4f806c2043 100644 --- a/board/cr50/usb_spi.c +++ b/board/cr50/usb_spi.c @@ -62,8 +62,8 @@ static uint8_t use_npcx_gang_mode; * Device and gang mode selected by last spihash command, for use by * spi_hash_pp_done(). */ -static uint8_t new_device; -static uint8_t new_gang_mode; +static uint8_t spi_hash_new_device; +static uint8_t spi_hash_new_gang_mode; static void spi_hash_inactive_timeout(void); DECLARE_DEFERRED(spi_hash_inactive_timeout); @@ -418,8 +418,8 @@ static enum vendor_cmd_rc spi_hash_disable(void) /* Release the bus */ spi_hash_device = USB_SPI_DISABLE; - new_device = USB_SPI_DISABLE; - new_gang_mode = 0; + spi_hash_new_device = USB_SPI_DISABLE; + spi_hash_new_gang_mode = 0; set_spi_bus_user(SPI_BUS_USER_HASH, 0); /* Disable inactivity timer to turn hashing mode off */ @@ -453,7 +453,7 @@ static void spi_hash_pp_done(void) disable_ec_ap_spi(); /* Set up new device */ - if (new_device == USB_SPI_AP) { + if (spi_hash_new_device == USB_SPI_AP) { /* Stop the EC device, if it was previously active */ spi_hash_stop_ec_device(); @@ -469,7 +469,7 @@ static void spi_hash_pp_done(void) * to the EC's GP_SEL_ODL signal, which is what enables gang * programmer mode. */ - if (new_gang_mode) { + if (spi_hash_new_gang_mode) { usleep(200); deassert_ec_rst(); use_npcx_gang_mode = 1; @@ -477,7 +477,7 @@ static void spi_hash_pp_done(void) } enable_spi_pinmux(); - spi_hash_device = new_device; + spi_hash_device = spi_hash_new_device; /* Start inactivity timer to turn hashing mode off */ hook_call_deferred(&spi_hash_inactive_timeout_data, @@ -509,7 +509,7 @@ void enable_ap_spi_hash_shortcut(void) * when the operator entered the appropriate sequence on the device * keyboard, so physical presence is already established. */ - new_device = USB_SPI_AP; + spi_hash_new_device = USB_SPI_AP; spi_hash_pp_done(); } @@ -567,8 +567,8 @@ static enum vendor_cmd_rc spi_hash_set_device(int dev, int gang_mode, if (!(ccd_is_cap_enabled(CCD_CAP_FLASH_READ))) return VENDOR_RC_NOT_ALLOWED; - new_device = dev; - new_gang_mode = gang_mode; + spi_hash_new_device = dev; + spi_hash_new_gang_mode = gang_mode; /* Handle enabling */ if (spi_hash_device == USB_SPI_DISABLE && |