Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
- Loading branch information
1 parent
3596145
commit cef1661
Showing
9 changed files
with
106 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
patches/beaglebone/dts/0007-spi-omap2-mcspi-ti-pio-mode.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
From a31d64985220133547cfe124441dc995954b16df Mon Sep 17 00:00:00 2001 | ||
From: Robert Nelson <robertcnelson@gmail.com> | ||
Date: Thu, 5 Nov 2015 09:30:35 -0600 | ||
Subject: [PATCH 7/7] spi-omap2-mcspi: ti,pio-mode | ||
|
||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
--- | ||
Documentation/devicetree/bindings/spi/omap-spi.txt | 1 + | ||
drivers/spi/spi-omap2-mcspi.c | 8 ++++++++ | ||
include/linux/platform_data/spi-omap2-mcspi.h | 2 ++ | ||
3 files changed, 11 insertions(+) | ||
|
||
diff --git a/Documentation/devicetree/bindings/spi/omap-spi.txt b/Documentation/devicetree/bindings/spi/omap-spi.txt | ||
index 2ba5f9c..5bec29a 100644 | ||
--- a/Documentation/devicetree/bindings/spi/omap-spi.txt | ||
+++ b/Documentation/devicetree/bindings/spi/omap-spi.txt | ||
@@ -18,6 +18,7 @@ Optional properties: | ||
1:1 with the DMA specifiers listed in dmas. The string naming | ||
is to be "rxN" and "txN" for RX and TX requests, | ||
respectively, where N equals the chip select number. | ||
+- ti,pio-mode: disable dma | ||
|
||
Examples: | ||
|
||
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c | ||
index 3d09e0b..10018a5 100644 | ||
--- a/drivers/spi/spi-omap2-mcspi.c | ||
+++ b/drivers/spi/spi-omap2-mcspi.c | ||
@@ -139,6 +139,7 @@ struct omap2_mcspi { | ||
struct omap2_mcspi_regs ctx; | ||
int fifo_depth; | ||
unsigned int pin_dir:1; | ||
+ unsigned int pio_mode:1; | ||
}; | ||
|
||
struct omap2_mcspi_cs { | ||
@@ -976,6 +977,9 @@ static int omap2_mcspi_request_dma(struct spi_device *spi) | ||
dma_cap_set(DMA_SLAVE, mask); | ||
sig = mcspi_dma->dma_rx_sync_dev; | ||
|
||
+ if (mcspi->pio_mode == MCSPI_PIO_MODE) | ||
+ goto no_dma; | ||
+ | ||
mcspi_dma->dma_rx = | ||
dma_request_slave_channel_compat(mask, omap_dma_filter_fn, | ||
&sig, &master->dev, | ||
@@ -1356,6 +1360,8 @@ static int omap2_mcspi_probe(struct platform_device *pdev) | ||
mcspi = spi_master_get_devdata(master); | ||
mcspi->master = master; | ||
|
||
+ mcspi->pio_mode = 0; | ||
+ | ||
match = of_match_device(omap_mcspi_of_match, &pdev->dev); | ||
if (match) { | ||
u32 num_cs = 1; /* default number of chipselect */ | ||
@@ -1366,6 +1372,8 @@ static int omap2_mcspi_probe(struct platform_device *pdev) | ||
master->bus_num = bus_num++; | ||
if (of_get_property(node, "ti,pindir-d0-out-d1-in", NULL)) | ||
mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN; | ||
+ if (of_get_property(node, "ti,pio-mode", NULL)) | ||
+ mcspi->pio_mode = MCSPI_PIO_MODE; | ||
} else { | ||
pdata = dev_get_platdata(&pdev->dev); | ||
master->num_chipselect = pdata->num_cs; | ||
diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h | ||
index c100456..898db7e 100644 | ||
--- a/include/linux/platform_data/spi-omap2-mcspi.h | ||
+++ b/include/linux/platform_data/spi-omap2-mcspi.h | ||
@@ -9,11 +9,13 @@ | ||
|
||
#define MCSPI_PINDIR_D0_IN_D1_OUT 0 | ||
#define MCSPI_PINDIR_D0_OUT_D1_IN 1 | ||
+#define MCSPI_PIO_MODE 1 | ||
|
||
struct omap2_mcspi_platform_config { | ||
unsigned short num_cs; | ||
unsigned int regs_offset; | ||
unsigned int pin_dir:1; | ||
+ unsigned int pio_mode:1; | ||
}; | ||
|
||
struct omap2_mcspi_dev_attr { | ||
-- | ||
2.6.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters