summaryrefslogtreecommitdiffstats
path: root/pony_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 /pony_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 'pony_spi.c')
-rw-r--r--pony_spi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/pony_spi.c b/pony_spi.c
index 9e00b0307..940cae1ce 100644
--- a/pony_spi.c
+++ b/pony_spi.c
@@ -56,7 +56,7 @@ static int pony_negate_mosi = 0;
/* Pins for slave->master direction */
static int pony_negate_miso = 0;
-static void pony_bitbang_set_cs(int val)
+static void pony_bitbang_set_cs(int val, void *spi_data)
{
if (pony_negate_cs)
val ^= 1;
@@ -64,7 +64,7 @@ static void pony_bitbang_set_cs(int val)
sp_set_pin(PIN_TXD, val);
}
-static void pony_bitbang_set_sck(int val)
+static void pony_bitbang_set_sck(int val, void *spi_data)
{
if (pony_negate_sck)
val ^= 1;
@@ -72,7 +72,7 @@ static void pony_bitbang_set_sck(int val)
sp_set_pin(PIN_RTS, val);
}
-static void pony_bitbang_set_mosi(int val)
+static void pony_bitbang_set_mosi(int val, void *spi_data)
{
if (pony_negate_mosi)
val ^= 1;
@@ -80,7 +80,7 @@ static void pony_bitbang_set_mosi(int val)
sp_set_pin(PIN_DTR, val);
}
-static int pony_bitbang_get_miso(void)
+static int pony_bitbang_get_miso(void *spi_data)
{
int tmp = sp_get_pin(PIN_CTS);
@@ -192,9 +192,9 @@ int pony_spi_init(void)
/*
* Detect if there is a compatible hardware programmer connected.
*/
- pony_bitbang_set_cs(1);
- pony_bitbang_set_sck(1);
- pony_bitbang_set_mosi(1);
+ pony_bitbang_set_cs(1, NULL);
+ pony_bitbang_set_sck(1, NULL);
+ pony_bitbang_set_mosi(1, NULL);
switch (type) {
case TYPE_AJAWE: