Add the chip select glue.

This commit is contained in:
Warner Losh 2012-08-01 01:18:36 +00:00
parent edd4c16f78
commit cc90639873
2 changed files with 6 additions and 0 deletions

View file

@ -1,6 +1,7 @@
/* $FreeBSD$ */
struct spi_command {
int cs;
void *tx_cmd;
uint32_t tx_cmd_sz;
void *rx_cmd;
@ -10,3 +11,5 @@ struct spi_command {
void *rx_data;
uint32_t rx_data_sz;
};
#define SPI_CHIP_SELECT_HIGH 0x1 /* Chip select high (else low) */

View file

@ -158,6 +158,9 @@ spibus_hinted_child(device_t bus, const char *dname, int dunit)
static int
spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd)
{
/* Maybe set flags too? spi mode? */
spibus_get_cs(dev, &cmd->cs);
return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd));
}