mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
Merge remote-tracking branches 'spi/topic/sirf', 'spi/topic/spidev' and 'spi/topic/zynq' into spi-next
This commit is contained in:
commit
fda052b0a5
7 changed files with 1806 additions and 262 deletions
|
|
@ -610,6 +610,12 @@ config SPI_XTENSA_XTFPGA
|
|||
16 bit words in SPI mode 0, automatically asserting CS on transfer
|
||||
start and deasserting on end.
|
||||
|
||||
config SPI_ZYNQMP_GQSPI
|
||||
tristate "Xilinx ZynqMP GQSPI controller"
|
||||
depends on SPI_MASTER
|
||||
help
|
||||
Enables Xilinx GQSPI controller driver for Zynq UltraScale+ MPSoC.
|
||||
|
||||
config SPI_NUC900
|
||||
tristate "Nuvoton NUC900 series SPI"
|
||||
depends on ARCH_W90X900
|
||||
|
|
|
|||
|
|
@ -89,3 +89,4 @@ obj-$(CONFIG_SPI_TXX9) += spi-txx9.o
|
|||
obj-$(CONFIG_SPI_XCOMM) += spi-xcomm.o
|
||||
obj-$(CONFIG_SPI_XILINX) += spi-xilinx.o
|
||||
obj-$(CONFIG_SPI_XTENSA_XTFPGA) += spi-xtensa-xtfpga.o
|
||||
obj-$(CONFIG_SPI_ZYNQMP_GQSPI) += spi-zynqmp-gqspi.o
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
1122
drivers/spi/spi-zynqmp-gqspi.c
Normal file
1122
drivers/spi/spi-zynqmp-gqspi.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -95,37 +95,25 @@ MODULE_PARM_DESC(bufsiz, "data bytes in biggest supported SPI message");
|
|||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* We can't use the standard synchronous wrappers for file I/O; we
|
||||
* need to protect against async removal of the underlying spi_device.
|
||||
*/
|
||||
static void spidev_complete(void *arg)
|
||||
{
|
||||
complete(arg);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
spidev_sync(struct spidev_data *spidev, struct spi_message *message)
|
||||
{
|
||||
DECLARE_COMPLETION_ONSTACK(done);
|
||||
int status;
|
||||
|
||||
message->complete = spidev_complete;
|
||||
message->context = &done;
|
||||
struct spi_device *spi;
|
||||
|
||||
spin_lock_irq(&spidev->spi_lock);
|
||||
if (spidev->spi == NULL)
|
||||
status = -ESHUTDOWN;
|
||||
else
|
||||
status = spi_async(spidev->spi, message);
|
||||
spi = spidev->spi;
|
||||
spin_unlock_irq(&spidev->spi_lock);
|
||||
|
||||
if (status == 0) {
|
||||
wait_for_completion(&done);
|
||||
status = message->status;
|
||||
if (status == 0)
|
||||
status = message->actual_length;
|
||||
}
|
||||
if (spi == NULL)
|
||||
status = -ESHUTDOWN;
|
||||
else
|
||||
status = spi_sync(spi, message);
|
||||
|
||||
if (status == 0)
|
||||
status = message->actual_length;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -647,7 +635,6 @@ err_find_dev:
|
|||
static int spidev_release(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct spidev_data *spidev;
|
||||
int status = 0;
|
||||
|
||||
mutex_lock(&device_list_lock);
|
||||
spidev = filp->private_data;
|
||||
|
|
@ -676,7 +663,7 @@ static int spidev_release(struct inode *inode, struct file *filp)
|
|||
}
|
||||
mutex_unlock(&device_list_lock);
|
||||
|
||||
return status;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct file_operations spidev_fops = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue