summaryrefslogtreecommitdiffstats
path: root/bitbang_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 /bitbang_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 'bitbang_spi.c')
-rw-r--r--bitbang_spi.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/bitbang_spi.c b/bitbang_spi.c
index e595b16f9..601b7a6fc 100644
--- a/bitbang_spi.c
+++ b/bitbang_spi.c
@@ -24,44 +24,44 @@
/* Note that CS# is active low, so val=0 means the chip is active. */
static void bitbang_spi_set_cs(const struct bitbang_spi_master * const master, int val)
{
- master->set_cs(val);
+ master->set_cs(val, NULL);
}
static void bitbang_spi_set_sck(const struct bitbang_spi_master * const master, int val)
{
- master->set_sck(val);
+ master->set_sck(val, NULL);
}
static void bitbang_spi_request_bus(const struct bitbang_spi_master * const master)
{
if (master->request_bus)
- master->request_bus();
+ master->request_bus(NULL);
}
static void bitbang_spi_release_bus(const struct bitbang_spi_master * const master)
{
if (master->release_bus)
- master->release_bus();
+ master->release_bus(NULL);
}
static void bitbang_spi_set_sck_set_mosi(const struct bitbang_spi_master * const master, int sck, int mosi)
{
if (master->set_sck_set_mosi) {
- master->set_sck_set_mosi(sck, mosi);
+ master->set_sck_set_mosi(sck, mosi, NULL);
return;
}
- master->set_sck(sck);
- master->set_mosi(mosi);
+ master->set_sck(sck, NULL);
+ master->set_mosi(mosi, NULL);
}
static int bitbang_spi_set_sck_get_miso(const struct bitbang_spi_master * const master, int sck)
{
if (master->set_sck_get_miso)
- return master->set_sck_get_miso(sck);
+ return master->set_sck_get_miso(sck, NULL);
- master->set_sck(sck);
- return master->get_miso();
+ master->set_sck(sck, NULL);
+ return master->get_miso(NULL);
}
static uint8_t bitbang_spi_read_byte(const struct bitbang_spi_master *master)