Home | History | Annotate | Download | only in nvs

Lines Matching defs:device

33  * Munge SPI device address into command
37 * @v munge_address Device requires address munging
52 * Wait for SPI device to complete operation
54 * @v device SPI device
57 static int spi_wait ( struct spi_device *device ) {
58 struct spi_bus *bus = device->bus;
65 if ( ( rc = bus->rw ( bus, device, SPI_RDSR, -1, NULL,
71 DBG ( "SPI %p timed out\n", device );
76 * Read data from SPI device
78 * @v nvs NVS device
86 struct spi_device *device = nvs_to_spi ( nvs );
87 struct spi_bus *bus = device->bus;
89 device->munge_address );
92 DBG ( "SPI %p reading %zd bytes from %#04x\n", device, len, address );
93 if ( ( rc = bus->rw ( bus, device, command, address,
95 DBG ( "SPI %p failed to read data from device\n", device );
103 * Write data to SPI device
105 * @v nvs NVS device
113 struct spi_device *device = nvs_to_spi ( nvs );
114 struct spi_bus *bus = device->bus;
116 device->munge_address );
119 DBG ( "SPI %p writing %zd bytes to %#04x\n", device, len, address );
121 if ( ( rc = bus->rw ( bus, device, SPI_WREN, -1,
123 DBG ( "SPI %p failed to write-enable device\n", device );
127 if ( ( rc = bus->rw ( bus, device, command, address,
129 DBG ( "SPI %p failed to write data to device\n", device );
133 if ( ( rc = spi_wait ( device ) ) != 0 ) {
134 DBG ( "SPI %p failed to complete write operation\n", device );