bcm53xx: backport upstream bcm53xx spi driver changes
authorRafał Miłecki <rafal@milecki.pl>
Wed, 11 Jan 2017 14:21:13 +0000 (15:21 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Wed, 11 Jan 2017 14:33:47 +0000 (15:33 +0100)
One replaces our local patch and another is just for keeping driver in
sync (license change).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
target/linux/bcm53xx/patches-4.4/084-0001-spi-bcm53xx-set-of_node-to-let-DT-specify-device-s.patch [new file with mode: 0644]
target/linux/bcm53xx/patches-4.4/084-0002-spi-bcm53xx-re-license-code-to-the-GPL-v2.patch [new file with mode: 0644]
target/linux/bcm53xx/patches-4.4/820-spi-bcm53xx-let-DT-specify-SPI-device-s-instead-hard.patch [deleted file]

diff --git a/target/linux/bcm53xx/patches-4.4/084-0001-spi-bcm53xx-set-of_node-to-let-DT-specify-device-s.patch b/target/linux/bcm53xx/patches-4.4/084-0001-spi-bcm53xx-set-of_node-to-let-DT-specify-device-s.patch
new file mode 100644 (file)
index 0000000..39ebf72
--- /dev/null
@@ -0,0 +1,52 @@
+From 78d759daceaf0a7058f37c4142bdca9948b6d987 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Thu, 29 Dec 2016 17:27:55 +0100
+Subject: [PATCH] spi: bcm53xx: set of_node to let DT specify device(s)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Setting of_node of master's dev seems to be a common way of letting it
+work nicely with DT. This allows specifying device there instead of
+hardcoding one in the driver code.
+
+This was successfully tested with commit 1b47b98acce2 ("ARM: BCM5301X:
+Add DT entry for SPI controller and NOR flash")
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+---
+ drivers/spi/spi-bcm53xx.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+--- a/drivers/spi/spi-bcm53xx.c
++++ b/drivers/spi/spi-bcm53xx.c
+@@ -275,10 +275,6 @@ static int bcm53xxspi_flash_read(struct
+  * BCMA
+  **************************************************/
+-static struct spi_board_info bcm53xx_info = {
+-      .modalias       = "bcm53xxspiflash",
+-};
+-
+ static const struct bcma_device_id bcm53xxspi_bcma_tbl[] = {
+       BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_QSPI, BCMA_ANY_REV, BCMA_ANY_CLASS),
+       {},
+@@ -311,6 +307,7 @@ static int bcm53xxspi_bcma_probe(struct
+       b53spi->bspi = true;
+       bcm53xxspi_disable_bspi(b53spi);
++      master->dev.of_node = dev->of_node;
+       master->transfer_one = bcm53xxspi_transfer_one;
+       if (b53spi->mmio_base)
+               master->spi_flash_read = bcm53xxspi_flash_read;
+@@ -324,9 +321,6 @@ static int bcm53xxspi_bcma_probe(struct
+               return err;
+       }
+-      /* Broadcom SoCs (at least with the CC rev 42) use SPI for flash only */
+-      spi_new_device(master, &bcm53xx_info);
+-
+       return 0;
+ }
diff --git a/target/linux/bcm53xx/patches-4.4/084-0002-spi-bcm53xx-re-license-code-to-the-GPL-v2.patch b/target/linux/bcm53xx/patches-4.4/084-0002-spi-bcm53xx-re-license-code-to-the-GPL-v2.patch
new file mode 100644 (file)
index 0000000..37fb6df
--- /dev/null
@@ -0,0 +1,50 @@
+From e360e72e715f228e426edf0fc99ffa34027ab0ad Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Thu, 29 Dec 2016 20:13:13 +0100
+Subject: [PATCH] spi: bcm53xx: (re)license code to the GPL v2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+My intention was to release this code under GPL v2 license. For some
+reason my initial commit 0fc6a323e191 ("spi: bcm53xx: driver for SPI
+controller on Broadcom bcma SoC") totally missed licensing info.
+MODULE_LICENSE was later added by Axel specifying "GNU Public License
+v2 or later".
+
+This patch clarifies situation by adding a proper header (with Copyright
+line) and adjusting MODULE_LICENSE. It should be acked by every driver
+contributor.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Acked-by: Nicholas Mc Guire <hofrat@osadl.org>
+Reviewed-by: Jingoo Han <jingoohan1@gmail.com>
+Acked-by: Jingoo Han <jingoohan1@gmail.com>
+Acked-by: Joe Perches <joe@perches.com>
+Acked-by: Axel Lin <axel.lin@ingics.com>
+Acked-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+---
+ drivers/spi/spi-bcm53xx.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/drivers/spi/spi-bcm53xx.c
++++ b/drivers/spi/spi-bcm53xx.c
+@@ -1,3 +1,11 @@
++/*
++ * Copyright (C) 2014-2016 Rafał Miłecki <rafal@milecki.pl>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
+ #define pr_fmt(fmt)           KBUILD_MODNAME ": " fmt
+ #include <linux/kernel.h>
+@@ -355,4 +363,4 @@ module_exit(bcm53xxspi_module_exit);
+ MODULE_DESCRIPTION("Broadcom BCM53xx SPI Controller driver");
+ MODULE_AUTHOR("Rafał Miłecki <zajec5@gmail.com>");
+-MODULE_LICENSE("GPL");
++MODULE_LICENSE("GPL v2");
diff --git a/target/linux/bcm53xx/patches-4.4/820-spi-bcm53xx-let-DT-specify-SPI-device-s-instead-hard.patch b/target/linux/bcm53xx/patches-4.4/820-spi-bcm53xx-let-DT-specify-SPI-device-s-instead-hard.patch
deleted file mode 100644 (file)
index c60eb19..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
-Subject: [PATCH] spi: bcm53xx: let DT specify SPI device(s) instead hardcoding
- them
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
----
-
---- a/drivers/spi/spi-bcm53xx.c
-+++ b/drivers/spi/spi-bcm53xx.c
-@@ -275,10 +275,6 @@ static int bcm53xxspi_flash_read(struct
-  * BCMA
-  **************************************************/
--static struct spi_board_info bcm53xx_info = {
--      .modalias       = "bcm53xxspiflash",
--};
--
- static const struct bcma_device_id bcm53xxspi_bcma_tbl[] = {
-       BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_QSPI, BCMA_ANY_REV, BCMA_ANY_CLASS),
-       {},
-@@ -300,6 +296,7 @@ static int bcm53xxspi_bcma_probe(struct
-       master = spi_alloc_master(dev, sizeof(*b53spi));
-       if (!master)
-               return -ENOMEM;
-+      master->dev.of_node = dev->of_node;
-       b53spi = spi_master_get_devdata(master);
-       b53spi->master = master;
-@@ -324,9 +321,6 @@ static int bcm53xxspi_bcma_probe(struct
-               return err;
-       }
--      /* Broadcom SoCs (at least with the CC rev 42) use SPI for flash only */
--      spi_new_device(master, &bcm53xx_info);
--
-       return 0;
- }