[bitbash] Add optional open() and close() methods for bit-bashing interfaces

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-08-24 17:26:10 +01:00
parent 5676abead2
commit d1949f2737
3 changed files with 48 additions and 1 deletions
+6
View File
@@ -163,6 +163,9 @@ static int spi_bit_rw ( struct spi_bus *bus, struct spi_device *device,
uint32_t tmp_address;
uint32_t tmp_address_detect;
/* Open bit-bashing interface */
open_bit ( &spibit->basher );
/* Deassert chip select to reset specified slave */
spi_bit_set_slave_select ( spibit, device->slave, DESELECT_SLAVE );
@@ -214,6 +217,9 @@ static int spi_bit_rw ( struct spi_bus *bus, struct spi_device *device,
/* Deassert chip select on specified slave */
spi_bit_set_slave_select ( spibit, device->slave, DESELECT_SLAVE );
/* Close bit-bashing interface */
close_bit ( &spibit->basher );
return 0;
}