mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
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>
This commit is contained in:

committed by
Edward O'Callaghan

parent
30815fc370
commit
5f5eaeb7fa
@ -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)
|
||||
|
Reference in New Issue
Block a user