pistachio: add 4.9 kernel support
[openwrt/openwrt.git] / target / linux / pistachio / patches-4.9 / 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 diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
17 index c845a50..0d73d31 100644
18 --- a/drivers/spi/spi-img-spfi.c
19 +++ b/drivers/spi/spi-img-spfi.c
20 @@ -438,6 +438,9 @@ static int img_spfi_prepare(struct spi_master *master, struct spi_message *msg)
21 u32 val;
22
23 val = spfi_readl(spfi, SPFI_PORT_STATE);
24 + val &= ~(SPFI_PORT_STATE_DEV_SEL_MASK <<
25 + SPFI_PORT_STATE_DEV_SEL_SHIFT);
26 + val |= msg->spi->chip_select << SPFI_PORT_STATE_DEV_SEL_SHIFT;
27 if (msg->spi->mode & SPI_CPHA)
28 val |= SPFI_PORT_STATE_CK_PHASE(msg->spi->chip_select);
29 else
30 --
31 2.7.4
32