1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

Add the chip select glue.

This commit is contained in:
Warner Losh 2012-08-01 01:18:36 +00:00
parent edd4c16f78
commit cc90639873
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238965
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));
}