Skip to content

Commit

Permalink
Merge remote-tracking branches 'spi/topic/loopback', 'spi/topic/meson…
Browse files Browse the repository at this point in the history
…-spicc', 'spi/topic/mtk' and 'spi/topic/omap2-mcspi' into spi-next
  • Loading branch information
broonie committed Jul 3, 2017
5 parents 63a8927 + 704c309 + 454fa27 + b6b1f2d + ad74499 commit 15f8c9a
Show file tree
Hide file tree
Showing 9 changed files with 725 additions and 15 deletions.
31 changes: 31 additions & 0 deletions Documentation/devicetree/bindings/spi/spi-meson.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,34 @@ Required properties:
#address-cells = <1>;
#size-cells = <0>;
};

* SPICC (SPI Communication Controller)

The Meson SPICC is generic SPI controller for general purpose Full-Duplex
communications with dedicated 16 words RX/TX PIO FIFOs.

Required properties:
- compatible: should be "amlogic,meson-gx-spicc" on Amlogic GX SoCs.
- reg: physical base address and length of the controller registers
- interrupts: The interrupt specifier
- clock-names: Must contain "core"
- clocks: phandle of the input clock for the baud rate generator
- #address-cells: should be 1
- #size-cells: should be 0

Optional properties:
- resets: phandle of the internal reset line

See ../spi/spi-bus.txt for more details on SPI bus master and slave devices
required and optional properties.

Example :
spi@c1108d80 {
compatible = "amlogic,meson-gx-spicc";
reg = <0xc1108d80 0x80>;
interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
clock-names = "core";
clocks = <&clk81>;
#address-cells = <1>;
#size-cells = <0>;
};
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/spi/spi-mt65xx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Binding for MTK SPI controller
Required properties:
- compatible: should be one of the following.
- mediatek,mt2701-spi: for mt2701 platforms
- mediatek,mt2712-spi: for mt2712 platforms
- mediatek,mt6589-spi: for mt6589 platforms
- mediatek,mt7622-spi: for mt7622 platforms
- mediatek,mt8135-spi: for mt8135 platforms
- mediatek,mt8173-spi: for mt8173 platforms

Expand Down
7 changes: 7 additions & 0 deletions drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,13 @@ config SPI_FSL_ESPI
From MPC8536, 85xx platform uses the controller, and all P10xx,
P20xx, P30xx,P40xx, P50xx uses this controller.

config SPI_MESON_SPICC
tristate "Amlogic Meson SPICC controller"
depends on ARCH_MESON || COMPILE_TEST
help
This enables master mode support for the SPICC (SPI communication
controller) available in Amlogic Meson SoCs.

config SPI_MESON_SPIFC
tristate "Amlogic Meson SPIFC controller"
depends on ARCH_MESON || COMPILE_TEST
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ obj-$(CONFIG_SPI_LANTIQ_SSC) += spi-lantiq-ssc.o
obj-$(CONFIG_SPI_JCORE) += spi-jcore.o
obj-$(CONFIG_SPI_LM70_LLP) += spi-lm70llp.o
obj-$(CONFIG_SPI_LP8841_RTC) += spi-lp8841-rtc.o
obj-$(CONFIG_SPI_MESON_SPICC) += spi-meson-spicc.o
obj-$(CONFIG_SPI_MESON_SPIFC) += spi-meson-spifc.o
obj-$(CONFIG_SPI_MPC512x_PSC) += spi-mpc512x-psc.o
obj-$(CONFIG_SPI_MPC52xx_PSC) += spi-mpc52xx-psc.o
Expand Down
14 changes: 7 additions & 7 deletions drivers/spi/spi-loopback-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ int spi_test_execute_msg(struct spi_device *spi, struct spi_test *test,
test->elapsed_time = ktime_to_ns(ktime_sub(ktime_get(), start));
if (ret == -ETIMEDOUT) {
dev_info(&spi->dev,
"spi-message timed out - reruning...\n");
"spi-message timed out - rerunning...\n");
/* rerun after a few explicit schedules */
for (i = 0; i < 16; i++)
schedule();
Expand Down Expand Up @@ -1021,18 +1021,17 @@ int spi_test_run_tests(struct spi_device *spi,
rx = vmalloc(SPI_TEST_MAX_SIZE_PLUS);
else
rx = kzalloc(SPI_TEST_MAX_SIZE_PLUS, GFP_KERNEL);
if (!rx) {
ret = -ENOMEM;
goto out;
}
if (!rx)
return -ENOMEM;


if (use_vmalloc)
tx = vmalloc(SPI_TEST_MAX_SIZE_PLUS);
else
tx = kzalloc(SPI_TEST_MAX_SIZE_PLUS, GFP_KERNEL);
if (!tx) {
ret = -ENOMEM;
goto out;
goto err_tx;
}

/* now run the individual tests in the table */
Expand All @@ -1057,8 +1056,9 @@ int spi_test_run_tests(struct spi_device *spi,
}

out:
kvfree(rx);
kvfree(tx);
err_tx:
kvfree(rx);
return ret;
}
EXPORT_SYMBOL_GPL(spi_test_run_tests);
Loading

0 comments on commit 15f8c9a

Please sign in to comment.