From 344e75eb2b5653ed350121b4a7beb292049c24c0 Mon Sep 17 00:00:00 2001 From: Christopher Hill Date: Mon, 25 May 2020 21:00:00 -0400 Subject: ath79: patch upstream Mikrotik rb4xx-spi driver to be device tree aware Backport upstream patches that make drivers/spi/spi-rb4xx.c device tree aware, plus a null pointer fix. Signed-off-by: Christopher Hill --- ...4xx-update-driver-to-be-device-tree-aware.patch | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 target/linux/generic/backport-5.4/826-v5.8-spi-rb4xx-update-driver-to-be-device-tree-aware.patch (limited to 'target/linux/generic/backport-5.4/826-v5.8-spi-rb4xx-update-driver-to-be-device-tree-aware.patch') diff --git a/target/linux/generic/backport-5.4/826-v5.8-spi-rb4xx-update-driver-to-be-device-tree-aware.patch b/target/linux/generic/backport-5.4/826-v5.8-spi-rb4xx-update-driver-to-be-device-tree-aware.patch new file mode 100644 index 0000000000..0340c934d8 --- /dev/null +++ b/target/linux/generic/backport-5.4/826-v5.8-spi-rb4xx-update-driver-to-be-device-tree-aware.patch @@ -0,0 +1,62 @@ +From: Christopher Hill +To: Mark Brown +Cc: Christopher Hill , linux-spi@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH 2/3] spi: rb4xx: update driver to be device tree aware +Date: Thu, 21 May 2020 14:36:30 -0400 +Message-Id: <20200521183631.37806-2-ch6574@gmail.com> +X-Mailer: git-send-email 2.25.1 +In-Reply-To: <20200521183631.37806-1-ch6574@gmail.com> +References: <20200521183631.37806-1-ch6574@gmail.com> +MIME-Version: 1.0 +Sender: linux-spi-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-spi@vger.kernel.org + +This patch updates the spi driver spi-rb4xx.c to be device tree aware + +Signed-off-by: Christopher Hill +--- + drivers/spi/spi-rb4xx.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c +index 17e1a77dc132..8aa51beb4ff3 100644 +--- a/drivers/spi/spi-rb4xx.c ++++ b/drivers/spi/spi-rb4xx.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + +@@ -150,6 +151,7 @@ static int rb4xx_spi_probe(struct platform_device *pdev) + if (IS_ERR(ahb_clk)) + return PTR_ERR(ahb_clk); + ++ master->dev.of_node = pdev->dev.of_node; + master->bus_num = 0; + master->num_chipselect = 3; + master->mode_bits = SPI_TX_DUAL; +@@ -188,11 +190,18 @@ static int rb4xx_spi_remove(struct platform_device *pdev) + return 0; + } + ++static const struct of_device_id rb4xx_spi_dt_match[] = { ++ { .compatible = "mikrotik,rb4xx-spi" }, ++ { }, ++}; ++MODULE_DEVICE_TABLE(of, rb4xx_spi_dt_match); ++ + static struct platform_driver rb4xx_spi_drv = { + .probe = rb4xx_spi_probe, + .remove = rb4xx_spi_remove, + .driver = { + .name = "rb4xx-spi", ++ .of_match_table = of_match_ptr(rb4xx_spi_dt_match), + }, + }; + -- cgit v1.2.3