Commit 817ef6e6 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'spi/topic/imx', 'spi/topic/loopback',...

Merge remote-tracking branches 'spi/topic/imx', 'spi/topic/loopback', 'spi/topic/omap', 'spi/topic/pic32' and 'spi/topic/pl022' into spi-next
...@@ -9,6 +9,7 @@ Required properties: ...@@ -9,6 +9,7 @@ Required properties:
- "fsl,imx31-cspi" for SPI compatible with the one integrated on i.MX31 - "fsl,imx31-cspi" for SPI compatible with the one integrated on i.MX31
- "fsl,imx35-cspi" for SPI compatible with the one integrated on i.MX35 - "fsl,imx35-cspi" for SPI compatible with the one integrated on i.MX35
- "fsl,imx51-ecspi" for SPI compatible with the one integrated on i.MX51 - "fsl,imx51-ecspi" for SPI compatible with the one integrated on i.MX51
- "fsl,imx53-ecspi" for SPI compatible with the one integrated on i.MX53 and later Soc
- reg : Offset and length of the register set for the device - reg : Offset and length of the register set for the device
- interrupts : Should contain CSPI/eCSPI interrupt - interrupts : Should contain CSPI/eCSPI interrupt
- cs-gpios : Specifies the gpio pins to be used for chipselects. - cs-gpios : Specifies the gpio pins to be used for chipselects.
......
This diff is collapsed.
...@@ -32,39 +32,50 @@ ...@@ -32,39 +32,50 @@
#include "spi-test.h" #include "spi-test.h"
/* flag to only simulate transfers */ /* flag to only simulate transfers */
int simulate_only; static int simulate_only;
module_param(simulate_only, int, 0); module_param(simulate_only, int, 0);
MODULE_PARM_DESC(simulate_only, "if not 0 do not execute the spi message"); MODULE_PARM_DESC(simulate_only, "if not 0 do not execute the spi message");
/* dump spi messages */ /* dump spi messages */
int dump_messages; static int dump_messages;
module_param(dump_messages, int, 0); module_param(dump_messages, int, 0);
MODULE_PARM_DESC(dump_messages, MODULE_PARM_DESC(dump_messages,
"=1 dump the basic spi_message_structure, " \ "=1 dump the basic spi_message_structure, " \
"=2 dump the spi_message_structure including data, " \ "=2 dump the spi_message_structure including data, " \
"=3 dump the spi_message structure before and after execution"); "=3 dump the spi_message structure before and after execution");
/* the device is jumpered for loopback - enabling some rx_buf tests */ /* the device is jumpered for loopback - enabling some rx_buf tests */
int loopback; static int loopback;
module_param(loopback, int, 0); module_param(loopback, int, 0);
MODULE_PARM_DESC(loopback, MODULE_PARM_DESC(loopback,
"if set enable loopback mode, where the rx_buf " \ "if set enable loopback mode, where the rx_buf " \
"is checked to match tx_buf after the spi_message " \ "is checked to match tx_buf after the spi_message " \
"is executed"); "is executed");
static int loop_req;
module_param(loop_req, int, 0);
MODULE_PARM_DESC(loop_req,
"if set controller will be asked to enable test loop mode. " \
"If controller supported it, MISO and MOSI will be connected");
static int no_cs;
module_param(no_cs, int, 0);
MODULE_PARM_DESC(no_cs,
"if set Chip Select (CS) will not be used");
/* run only a specific test */ /* run only a specific test */
int run_only_test = -1; static int run_only_test = -1;
module_param(run_only_test, int, 0); module_param(run_only_test, int, 0);
MODULE_PARM_DESC(run_only_test, MODULE_PARM_DESC(run_only_test,
"only run the test with this number (0-based !)"); "only run the test with this number (0-based !)");
/* use vmalloc'ed buffers */ /* use vmalloc'ed buffers */
int use_vmalloc; static int use_vmalloc;
module_param(use_vmalloc, int, 0644); module_param(use_vmalloc, int, 0644);
MODULE_PARM_DESC(use_vmalloc, MODULE_PARM_DESC(use_vmalloc,
"use vmalloc'ed buffers instead of kmalloc'ed"); "use vmalloc'ed buffers instead of kmalloc'ed");
/* check rx ranges */ /* check rx ranges */
int check_ranges = 1; static int check_ranges = 1;
module_param(check_ranges, int, 0644); module_param(check_ranges, int, 0644);
MODULE_PARM_DESC(check_ranges, MODULE_PARM_DESC(check_ranges,
"checks rx_buffer pattern are valid"); "checks rx_buffer pattern are valid");
...@@ -313,6 +324,17 @@ static int spi_loopback_test_probe(struct spi_device *spi) ...@@ -313,6 +324,17 @@ static int spi_loopback_test_probe(struct spi_device *spi)
{ {
int ret; int ret;
if (loop_req || no_cs) {
spi->mode |= loop_req ? SPI_LOOP : 0;
spi->mode |= no_cs ? SPI_NO_CS : 0;
ret = spi_setup(spi);
if (ret) {
dev_err(&spi->dev, "SPI setup with SPI_LOOP or SPI_NO_CS failed (%d)\n",
ret);
return ret;
}
}
dev_info(&spi->dev, "Executing spi-loopback-tests\n"); dev_info(&spi->dev, "Executing spi-loopback-tests\n");
ret = spi_test_run_tests(spi, spi_tests); ret = spi_test_run_tests(spi, spi_tests);
......
...@@ -1338,7 +1338,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev) ...@@ -1338,7 +1338,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
struct resource *r; struct resource *r;
int status = 0, i; int status = 0, i;
u32 regs_offset = 0; u32 regs_offset = 0;
static int bus_num = 1;
struct device_node *node = pdev->dev.of_node; struct device_node *node = pdev->dev.of_node;
const struct of_device_id *match; const struct of_device_id *match;
...@@ -1374,14 +1373,11 @@ static int omap2_mcspi_probe(struct platform_device *pdev) ...@@ -1374,14 +1373,11 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
of_property_read_u32(node, "ti,spi-num-cs", &num_cs); of_property_read_u32(node, "ti,spi-num-cs", &num_cs);
master->num_chipselect = num_cs; master->num_chipselect = num_cs;
master->bus_num = bus_num++;
if (of_get_property(node, "ti,pindir-d0-out-d1-in", NULL)) if (of_get_property(node, "ti,pindir-d0-out-d1-in", NULL))
mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN; mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN;
} else { } else {
pdata = dev_get_platdata(&pdev->dev); pdata = dev_get_platdata(&pdev->dev);
master->num_chipselect = pdata->num_cs; master->num_chipselect = pdata->num_cs;
if (pdev->id != -1)
master->bus_num = pdev->id;
mcspi->pin_dir = pdata->pin_dir; mcspi->pin_dir = pdata->pin_dir;
} }
regs_offset = pdata->regs_offset; regs_offset = pdata->regs_offset;
......
...@@ -52,14 +52,14 @@ struct pic32_spi_regs { ...@@ -52,14 +52,14 @@ struct pic32_spi_regs {
/* Bit fields of SPI Control Register */ /* Bit fields of SPI Control Register */
#define CTRL_RX_INT_SHIFT 0 /* Rx interrupt generation */ #define CTRL_RX_INT_SHIFT 0 /* Rx interrupt generation */
#define RX_FIFO_EMTPY 0 #define RX_FIFO_EMPTY 0
#define RX_FIFO_NOT_EMPTY 1 /* not empty */ #define RX_FIFO_NOT_EMPTY 1 /* not empty */
#define RX_FIFO_HALF_FULL 2 /* full by half or more */ #define RX_FIFO_HALF_FULL 2 /* full by half or more */
#define RX_FIFO_FULL 3 /* completely full */ #define RX_FIFO_FULL 3 /* completely full */
#define CTRL_TX_INT_SHIFT 2 /* TX interrupt generation */ #define CTRL_TX_INT_SHIFT 2 /* TX interrupt generation */
#define TX_FIFO_ALL_EMPTY 0 /* completely empty */ #define TX_FIFO_ALL_EMPTY 0 /* completely empty */
#define TX_FIFO_EMTPY 1 /* empty */ #define TX_FIFO_EMPTY 1 /* empty */
#define TX_FIFO_HALF_EMPTY 2 /* empty by half or more */ #define TX_FIFO_HALF_EMPTY 2 /* empty by half or more */
#define TX_FIFO_NOT_FULL 3 /* atleast one empty */ #define TX_FIFO_NOT_FULL 3 /* atleast one empty */
......
...@@ -2429,7 +2429,7 @@ static struct vendor_data vendor_lsi = { ...@@ -2429,7 +2429,7 @@ static struct vendor_data vendor_lsi = {
.internal_cs_ctrl = true, .internal_cs_ctrl = true,
}; };
static struct amba_id pl022_ids[] = { static const struct amba_id pl022_ids[] = {
{ {
/* /*
* ARM PL022 variant, this has a 16bit wide * ARM PL022 variant, this has a 16bit wide
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment