Lines Matching refs:device
57 static int spi_wait ( struct spi_device *device ) { in spi_wait() argument
58 struct spi_bus *bus = device->bus; in spi_wait()
65 if ( ( rc = bus->rw ( bus, device, SPI_RDSR, -1, NULL, in spi_wait()
71 DBG ( "SPI %p timed out\n", device ); in spi_wait()
86 struct spi_device *device = nvs_to_spi ( nvs ); in spi_read() local
87 struct spi_bus *bus = device->bus; in spi_read()
89 device->munge_address ); in spi_read()
92 DBG ( "SPI %p reading %zd bytes from %#04x\n", device, len, address ); in spi_read()
93 if ( ( rc = bus->rw ( bus, device, command, address, in spi_read()
95 DBG ( "SPI %p failed to read data from device\n", device ); in spi_read()
113 struct spi_device *device = nvs_to_spi ( nvs ); in spi_write() local
114 struct spi_bus *bus = device->bus; in spi_write()
116 device->munge_address ); in spi_write()
119 DBG ( "SPI %p writing %zd bytes to %#04x\n", device, len, address ); in spi_write()
121 if ( ( rc = bus->rw ( bus, device, SPI_WREN, -1, in spi_write()
123 DBG ( "SPI %p failed to write-enable device\n", device ); in spi_write()
127 if ( ( rc = bus->rw ( bus, device, command, address, in spi_write()
129 DBG ( "SPI %p failed to write data to device\n", device ); in spi_write()
133 if ( ( rc = spi_wait ( device ) ) != 0 ) { in spi_write()
134 DBG ( "SPI %p failed to complete write operation\n", device ); in spi_write()