pistachio: add kernel 4.14 support
[openwrt/openwrt.git] / target / linux / pistachio / patches-4.14 / 103-spi-img-spfi-set-device-select-bits-for-SPFI-port-st.patch
1 From 145f5369510b86cd55c659388a26a0cc267f8874 Mon Sep 17 00:00:00 2001
2 From: Ionela Voinescu <ionela.voinescu@imgtec.com>
3 Date: Mon, 1 Feb 2016 10:58:08 +0000
4 Subject: spi: img-spfi: set device select bits for SPFI port state
5
6 Even if the chip select line is not controlled by the SPFI
7 hardware, the device select bits need to be set to specify
8 the chip select line in use for the hardware to know what
9 parameters to use for the current transfer.
10
11 Signed-off-by: Ionela Voinescu <ionela.voinescu@imgtec.com>
12 ---
13 drivers/spi/spi-img-spfi.c | 3 +++
14 1 file changed, 3 insertions(+)
15
16 --- a/drivers/spi/spi-img-spfi.c
17 +++ b/drivers/spi/spi-img-spfi.c
18 @@ -438,6 +438,9 @@ static int img_spfi_prepare(struct spi_m
19 u32 val;
20
21 val = spfi_readl(spfi, SPFI_PORT_STATE);
22 + val &= ~(SPFI_PORT_STATE_DEV_SEL_MASK <<
23 + SPFI_PORT_STATE_DEV_SEL_SHIFT);
24 + val |= msg->spi->chip_select << SPFI_PORT_STATE_DEV_SEL_SHIFT;
25 if (msg->spi->mode & SPI_CPHA)
26 val |= SPFI_PORT_STATE_CK_PHASE(msg->spi->chip_select);
27 else