X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=target%2Flinux%2Framips%2Fpatches-4.14%2F0043-spi-add-mt7621-support.patch;h=d9bc48d69b0977b1db6e7c1eaec6f0e839ced560;hb=e2aa0c3f8b49f62fc83ec90f0bc5a67560fffa73;hp=5f939e3e40d1d706813e0455b1e736166ce0ac25;hpb=bcf4a5f474d1899af65f0974914f737bf9a8d9dd;p=oweals%2Fopenwrt.git diff --git a/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch b/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch index 5f939e3e40..d9bc48d69b 100644 --- a/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch +++ b/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch @@ -38,7 +38,7 @@ Signed-off-by: John Crispin obj-$(CONFIG_SPI_OC_TINY) += spi-oc-tiny.o --- /dev/null +++ b/drivers/spi/spi-mt7621.c -@@ -0,0 +1,491 @@ +@@ -0,0 +1,494 @@ +/* + * spi-mt7621.c -- MediaTek MT7621 SPI controller driver + * @@ -106,7 +106,6 @@ Signed-off-by: John Crispin + unsigned int sys_freq; + unsigned int speed; + struct clk *clk; -+ spinlock_t lock; + + struct mt7621_spi_ops *ops; +}; @@ -132,9 +131,11 @@ Signed-off-by: John Crispin + + master |= 7 << 29; + master |= 1 << 2; ++#ifdef CONFIG_SOC_MT7620 + if (duplex) + master |= 1 << 10; + else ++#endif + master &= ~(1 << 10); + + mt7621_spi_write(rs, MT7621_SPI_MASTER, master); @@ -309,6 +310,7 @@ Signed-off-by: John Crispin + return 0; +} + ++#ifdef CONFIG_SOC_MT7620 +static int mt7621_spi_transfer_full_duplex(struct spi_master *master, + struct spi_message *m) +{ @@ -393,15 +395,18 @@ Signed-off-by: John Crispin + + return 0; +} ++#endif + +static int mt7621_spi_transfer_one_message(struct spi_master *master, + struct spi_message *m) +{ + struct spi_device *spi = m->spi; ++#ifdef CONFIG_SOC_MT7620 + int cs = spi->chip_select; + + if (cs) + return mt7621_spi_transfer_full_duplex(master, m); ++#endif + return mt7621_spi_transfer_half_duplex(master, m); +} + @@ -438,7 +443,6 @@ Signed-off-by: John Crispin + const struct of_device_id *match; + struct spi_master *master; + struct mt7621_spi *rs; -+ unsigned long flags; + void __iomem *base; + struct resource *r; + int status = 0; @@ -490,7 +494,6 @@ Signed-off-by: John Crispin + rs->sys_freq = clk_get_rate(rs->clk); + rs->ops = ops; + dev_info(&pdev->dev, "sys_freq: %u\n", rs->sys_freq); -+ spin_lock_irqsave(&rs->lock, flags); + + device_reset(&pdev->dev); +