diff options
author | Mark Brown <broonie@kernel.org> | 2021-11-18 20:15:19 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-11-18 20:15:19 +0100 |
commit | 5ccd191cdd1d304fecc0d8ad6161b1e279f31aae (patch) | |
tree | 00ce2d492b0bf7f408019c65ab5c2f602545f01d | |
parent | spi: qcom: geni: remove unused defines (diff) | |
parent | spi: spi-rspi: Drop redeclaring ret variable in qspi_transfer_in() (diff) | |
download | linux-5ccd191cdd1d304fecc0d8ad6161b1e279f31aae.tar.xz linux-5ccd191cdd1d304fecc0d8ad6161b1e279f31aae.zip |
RSPI driver support for RZ/G2L
Merge series from Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>:
This patch series adds RSPI driver and dt binding support to RZ/G2L SoC.
-rw-r--r-- | Documentation/devicetree/bindings/spi/renesas,rspi.yaml | 4 | ||||
-rw-r--r-- | drivers/spi/spi-rspi.c | 27 |
2 files changed, 29 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/spi/renesas,rspi.yaml b/Documentation/devicetree/bindings/spi/renesas,rspi.yaml index 8397f60d80a2..76e6d9e52fc7 100644 --- a/Documentation/devicetree/bindings/spi/renesas,rspi.yaml +++ b/Documentation/devicetree/bindings/spi/renesas,rspi.yaml @@ -21,7 +21,8 @@ properties: - enum: - renesas,rspi-r7s72100 # RZ/A1H - renesas,rspi-r7s9210 # RZ/A2 - - const: renesas,rspi-rz # RZ/A + - renesas,r9a07g044-rspi # RZ/G2{L,LC} + - const: renesas,rspi-rz # RZ/A and RZ/G2{L,LC} - items: - enum: @@ -122,6 +123,7 @@ allOf: contains: enum: - renesas,qspi + - renesas,r9a07g044-rspi then: required: - resets diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 41761f0d892a..bd5708d7e5a1 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -21,6 +21,7 @@ #include <linux/dma-mapping.h> #include <linux/of_device.h> #include <linux/pm_runtime.h> +#include <linux/reset.h> #include <linux/sh_dma.h> #include <linux/spi/spi.h> #include <linux/spi/rspi.h> @@ -834,7 +835,7 @@ static int qspi_transfer_in(struct rspi_data *rspi, struct spi_transfer *xfer) int ret; if (rspi->ctlr->can_dma && __rspi_can_dma(rspi, xfer)) { - int ret = rspi_dma_transfer(rspi, NULL, &xfer->rx_sg); + ret = rspi_dma_transfer(rspi, NULL, &xfer->rx_sg); if (ret != -EAGAIN) return ret; } @@ -1225,8 +1226,14 @@ static const struct of_device_id rspi_of_match[] = { MODULE_DEVICE_TABLE(of, rspi_of_match); +static void rspi_reset_control_assert(void *data) +{ + reset_control_assert(data); +} + static int rspi_parse_dt(struct device *dev, struct spi_controller *ctlr) { + struct reset_control *rstc; u32 num_cs; int error; @@ -1238,6 +1245,24 @@ static int rspi_parse_dt(struct device *dev, struct spi_controller *ctlr) } ctlr->num_chipselect = num_cs; + + rstc = devm_reset_control_get_optional_exclusive(dev, NULL); + if (IS_ERR(rstc)) + return dev_err_probe(dev, PTR_ERR(rstc), + "failed to get reset ctrl\n"); + + error = reset_control_deassert(rstc); + if (error) { + dev_err(dev, "failed to deassert reset %d\n", error); + return error; + } + + error = devm_add_action_or_reset(dev, rspi_reset_control_assert, rstc); + if (error) { + dev_err(dev, "failed to register assert devm action, %d\n", error); + return error; + } + return 0; } #else |