From 4f5169df5ff2b63a40d654ab133b8a3108b6a599 Mon Sep 17 00:00:00 2001 From: Thomas Heijligen Date: Tue, 4 May 2021 15:32:17 +0200 Subject: programmer_table: move each entry to the associated programmer source Change-Id: I3d02bd789f0299e936eb86819b3b15b5ea2bb921 Signed-off-by: Thomas Heijligen Reviewed-on: https://review.coreboot.org/c/flashrom/+/52946 Tested-by: build bot (Jenkins) Reviewed-by: Anastasia Klimchuk Reviewed-by: Nico Huber --- ch341a_spi.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'ch341a_spi.c') diff --git a/ch341a_spi.c b/ch341a_spi.c index f84add4e..185e5827 100644 --- a/ch341a_spi.c +++ b/ch341a_spi.c @@ -84,7 +84,7 @@ static unsigned int stored_delay_us = 0; static struct libusb_device_handle *handle = NULL; -const struct dev_entry devs_ch341a_spi[] = { +static const struct dev_entry devs_ch341a_spi[] = { {0x1A86, 0x5512, OK, "Winchiphead (WCH)", "CH341A"}, {0}, @@ -323,7 +323,7 @@ static void pluck_cs(uint8_t *ptr) *ptr++ = CH341A_CMD_UIO_STM_END; } -void ch341a_spi_delay(unsigned int usecs) +static void ch341a_spi_delay(unsigned int usecs) { /* There is space for 28 bytes instructions of 750 ns each in the CS packet (32 - 4 for the actual CS * instructions), thus max 21 us, but we avoid getting too near to this boundary and use @@ -419,7 +419,7 @@ static int ch341a_spi_shutdown(void *data) return 0; } -int ch341a_spi_init(void) +static int ch341a_spi_init(void) { if (handle != NULL) { msg_cerr("%s: handle already set! Please report a bug at flashrom@flashrom.org\n", __func__); @@ -526,3 +526,13 @@ close_handle: handle = NULL; return -1; } + +const struct programmer_entry programmer_ch341a_spi = { + .name = "ch341a_spi", + .type = USB, + .devs.dev = devs_ch341a_spi, + .init = ch341a_spi_init, + .map_flash_region = fallback_map, + .unmap_flash_region = fallback_unmap, + .delay = ch341a_spi_delay, +}; -- cgit v1.2.3