summaryrefslogtreecommitdiffstats
path: root/developerbox_spi.c
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2021-05-26 09:54:08 +1000
committerEdward O'Callaghan <quasisec@chromium.org>2021-06-03 05:19:37 +0000
commit5f5eaeb7fa9b8443ff3656dd55041fd59582edf4 (patch)
tree33073db96a5fc583d3f8811e7351546ec99c58ff /developerbox_spi.c
parent30815fc3706194117c633393d1ed65941a5afafd (diff)
downloadflashrom-5f5eaeb7fa9b8443ff3656dd55041fd59582edf4.tar.gz
flashrom-5f5eaeb7fa9b8443ff3656dd55041fd59582edf4.tar.bz2
flashrom-5f5eaeb7fa9b8443ff3656dd55041fd59582edf4.zip
bitbang: Extend bitbang_spi_master functions to accept spi data
This way every bitbang spi master has access to its own spi data, and can use this data in all its functions. This patch only changes the signatures of functions. BUG=b:185191942 TEST=builds Change-Id: Id5722a43ce20feeed62630ad80e14df7744f9c02 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/54991 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'developerbox_spi.c')
-rw-r--r--developerbox_spi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/developerbox_spi.c b/developerbox_spi.c
index 4ccfaaaf2..e74189045 100644
--- a/developerbox_spi.c
+++ b/developerbox_spi.c
@@ -94,27 +94,27 @@ static void cp210x_gpio_set(uint8_t val, uint8_t mask)
msg_perr("Failed to read GPIO pins (%s)\n", libusb_error_name(res));
}
-static void cp210x_bitbang_set_cs(int val)
+static void cp210x_bitbang_set_cs(int val, void *spi_data)
{
cp210x_gpio_set(val << DEVELOPERBOX_SPI_CS, 1 << DEVELOPERBOX_SPI_CS);
}
-static void cp210x_bitbang_set_sck(int val)
+static void cp210x_bitbang_set_sck(int val, void *spi_data)
{
cp210x_gpio_set(val << DEVELOPERBOX_SPI_SCK, 1 << DEVELOPERBOX_SPI_SCK);
}
-static void cp210x_bitbang_set_mosi(int val)
+static void cp210x_bitbang_set_mosi(int val, void *spi_data)
{
cp210x_gpio_set(val << DEVELOPERBOX_SPI_MOSI, 1 << DEVELOPERBOX_SPI_MOSI);
}
-static int cp210x_bitbang_get_miso(void)
+static int cp210x_bitbang_get_miso(void *spi_data)
{
return !!(cp210x_gpio_get() & (1 << DEVELOPERBOX_SPI_MISO));
}
-static void cp210x_bitbang_set_sck_set_mosi(int sck, int mosi)
+static void cp210x_bitbang_set_sck_set_mosi(int sck, int mosi, void *spi_data)
{
cp210x_gpio_set(sck << DEVELOPERBOX_SPI_SCK | mosi << DEVELOPERBOX_SPI_MOSI,
1 << DEVELOPERBOX_SPI_SCK | 1 << DEVELOPERBOX_SPI_MOSI);