cns3xxx: update patches for 4.14
[openwrt/staging/wigyori.git] / target / linux / cns3xxx / patches-4.14 / 075-spi_support.patch
1 --- a/drivers/spi/Kconfig
2 +++ b/drivers/spi/Kconfig
3 @@ -206,6 +206,13 @@ config SPI_CLPS711X
4 This enables dedicated general purpose SPI/Microwire1-compatible
5 master mode interface (SSI1) for CLPS711X-based CPUs.
6
7 +config SPI_CNS3XXX
8 + tristate "CNS3XXX SPI controller"
9 + depends on ARCH_CNS3XXX && SPI_MASTER
10 + select SPI_BITBANG
11 + help
12 + This enables using the CNS3XXX SPI controller in master mode.
13 +
14 config SPI_COLDFIRE_QSPI
15 tristate "Freescale Coldfire QSPI controller"
16 depends on (M520x || M523x || M5249 || M525x || M527x || M528x || M532x)
17 --- a/drivers/spi/Makefile
18 +++ b/drivers/spi/Makefile
19 @@ -31,6 +31,7 @@ obj-$(CONFIG_SPI_BITBANG) += spi-bitban
20 obj-$(CONFIG_SPI_BUTTERFLY) += spi-butterfly.o
21 obj-$(CONFIG_SPI_CADENCE) += spi-cadence.o
22 obj-$(CONFIG_SPI_CLPS711X) += spi-clps711x.o
23 +obj-$(CONFIG_SPI_CNS3XXX) += spi-cns3xxx.o
24 obj-$(CONFIG_SPI_COLDFIRE_QSPI) += spi-coldfire-qspi.o
25 obj-$(CONFIG_SPI_DAVINCI) += spi-davinci.o
26 obj-$(CONFIG_SPI_DLN2) += spi-dln2.o
27 --- a/include/linux/spi/spi.h
28 +++ b/include/linux/spi/spi.h
29 @@ -799,6 +799,10 @@ struct spi_transfer {
30 u32 speed_hz;
31
32 struct list_head transfer_list;
33 +
34 +#ifdef CONFIG_ARCH_CNS3XXX
35 + unsigned last_in_message_list;
36 +#endif
37 };
38
39 /**
40 --- a/drivers/spi/spi.c
41 +++ b/drivers/spi/spi.c
42 @@ -1021,6 +1021,9 @@ static int spi_transfer_one_message(stru
43 list_for_each_entry(xfer, &msg->transfers, transfer_list) {
44 trace_spi_transfer_start(msg, xfer);
45
46 + xfer->last_in_message_list =
47 + list_is_last(&xfer->transfer_list, &msg->transfers);
48 +
49 spi_statistics_add_transfer_stats(statm, xfer, ctlr);
50 spi_statistics_add_transfer_stats(stats, xfer, ctlr);
51