Name

spi_lock_bus — lock SPI bus for exclusive access

Synopsis

int spi_lock_bus (struct spi_device *  spi);

Arguments

spi

device which want to lock the bus

Context

any

Description

Once the caller owns exclusive access to the SPI bus, only messages for this device will be transferred. Messages for other devices are queued but not transferred until the bus owner unlock the bus.

The caller may call spi_lock_bus before spi_sync or spi_async. So this call may be used in irq and other contexts which can't sleep, as well as from task contexts which can sleep.

It returns zero on success, else a negative error code: -ENOSYS: spi master driver does not implement this function -ENOLCK: cannot lock the bus