From ccacb7fc9378c4c00a39b2fbf913128c87e00b7f Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Thu, 16 Jul 2020 08:20:16 +1000 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2300698 Reviewed-by: Vadim Bendebury --- board/cr50/usb_spi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/board/cr50/usb_spi.c b/board/cr50/usb_spi.c index 316cb19409..050ea63aac 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); @@ -416,8 +416,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 */ @@ -451,7 +451,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(); @@ -467,7 +467,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; @@ -475,7 +475,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, @@ -507,7 +507,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(); } @@ -565,8 +565,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 && -- cgit v1.2.1