Merge remote branch 'origin' into secretlab/next-spi
This commit is contained in:
@@ -197,10 +197,10 @@ config SPI_OMAP_UWIRE
|
||||
This hooks up to the MicroWire controller on OMAP1 chips.
|
||||
|
||||
config SPI_OMAP24XX
|
||||
tristate "McSPI driver for OMAP24xx/OMAP34xx"
|
||||
depends on ARCH_OMAP2 || ARCH_OMAP3
|
||||
tristate "McSPI driver for OMAP"
|
||||
depends on ARCH_OMAP2PLUS
|
||||
help
|
||||
SPI master controller for OMAP24xx/OMAP34xx Multichannel SPI
|
||||
SPI master controller for OMAP24XX and later Multichannel SPI
|
||||
(McSPI) modules.
|
||||
|
||||
config SPI_OMAP_100K
|
||||
|
@@ -472,18 +472,18 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op,
|
||||
s16 id = -1;
|
||||
int rc;
|
||||
|
||||
regaddr_p = of_get_address(op->node, 0, &size64, NULL);
|
||||
regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL);
|
||||
if (!regaddr_p) {
|
||||
dev_err(&op->dev, "Invalid PSC address\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
regaddr64 = of_translate_address(op->node, regaddr_p);
|
||||
regaddr64 = of_translate_address(op->dev.of_node, regaddr_p);
|
||||
|
||||
/* get PSC id (1..6, used by port_config) */
|
||||
if (op->dev.platform_data == NULL) {
|
||||
const u32 *psc_nump;
|
||||
|
||||
psc_nump = of_get_property(op->node, "cell-index", NULL);
|
||||
psc_nump = of_get_property(op->dev.of_node, "cell-index", NULL);
|
||||
if (!psc_nump || *psc_nump > 5) {
|
||||
dev_err(&op->dev, "Invalid cell-index property\n");
|
||||
return -EINVAL;
|
||||
@@ -492,9 +492,10 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op,
|
||||
}
|
||||
|
||||
rc = mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64,
|
||||
irq_of_parse_and_map(op->node, 0), id);
|
||||
irq_of_parse_and_map(op->dev.of_node, 0), id);
|
||||
if (rc == 0)
|
||||
of_register_spi_devices(dev_get_drvdata(&op->dev), op->node);
|
||||
of_register_spi_devices(dev_get_drvdata(&op->dev),
|
||||
op->dev.of_node);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -513,14 +514,12 @@ static const struct of_device_id mpc52xx_psc_spi_of_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
|
||||
|
||||
static struct of_platform_driver mpc52xx_psc_spi_of_driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "mpc52xx-psc-spi",
|
||||
.match_table = mpc52xx_psc_spi_of_match,
|
||||
.probe = mpc52xx_psc_spi_of_probe,
|
||||
.remove = __exit_p(mpc52xx_psc_spi_of_remove),
|
||||
.driver = {
|
||||
.name = "mpc52xx-psc-spi",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mpc52xx_psc_spi_of_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -403,7 +403,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
|
||||
|
||||
/* MMIO registers */
|
||||
dev_dbg(&op->dev, "probing mpc5200 SPI device\n");
|
||||
regs = of_iomap(op->node, 0);
|
||||
regs = of_iomap(op->dev.of_node, 0);
|
||||
if (!regs)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -445,11 +445,11 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
|
||||
ms = spi_master_get_devdata(master);
|
||||
ms->master = master;
|
||||
ms->regs = regs;
|
||||
ms->irq0 = irq_of_parse_and_map(op->node, 0);
|
||||
ms->irq1 = irq_of_parse_and_map(op->node, 1);
|
||||
ms->irq0 = irq_of_parse_and_map(op->dev.of_node, 0);
|
||||
ms->irq1 = irq_of_parse_and_map(op->dev.of_node, 1);
|
||||
ms->state = mpc52xx_spi_fsmstate_idle;
|
||||
ms->ipb_freq = mpc5xxx_get_bus_frequency(op->node);
|
||||
ms->gpio_cs_count = of_gpio_count(op->node);
|
||||
ms->ipb_freq = mpc5xxx_get_bus_frequency(op->dev.of_node);
|
||||
ms->gpio_cs_count = of_gpio_count(op->dev.of_node);
|
||||
if (ms->gpio_cs_count > 0) {
|
||||
master->num_chipselect = ms->gpio_cs_count;
|
||||
ms->gpio_cs = kmalloc(ms->gpio_cs_count * sizeof(unsigned int),
|
||||
@@ -460,7 +460,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
|
||||
}
|
||||
|
||||
for (i = 0; i < ms->gpio_cs_count; i++) {
|
||||
gpio_cs = of_get_gpio(op->node, i);
|
||||
gpio_cs = of_get_gpio(op->dev.of_node, i);
|
||||
if (gpio_cs < 0) {
|
||||
dev_err(&op->dev,
|
||||
"could not parse the gpio field "
|
||||
@@ -512,7 +512,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
|
||||
if (rc)
|
||||
goto err_register;
|
||||
|
||||
of_register_spi_devices(master, op->node);
|
||||
of_register_spi_devices(master, op->dev.of_node);
|
||||
dev_info(&ms->master->dev, "registered MPC5200 SPI bus\n");
|
||||
|
||||
return rc;
|
||||
@@ -558,9 +558,11 @@ static const struct of_device_id mpc52xx_spi_match[] __devinitconst = {
|
||||
MODULE_DEVICE_TABLE(of, mpc52xx_spi_match);
|
||||
|
||||
static struct of_platform_driver mpc52xx_spi_of_driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "mpc52xx-spi",
|
||||
.match_table = mpc52xx_spi_match,
|
||||
.driver = {
|
||||
.name = "mpc52xx-spi",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mpc52xx_spi_match,
|
||||
},
|
||||
.probe = mpc52xx_spi_probe,
|
||||
.remove = __exit_p(mpc52xx_spi_remove),
|
||||
};
|
||||
|
@@ -36,8 +36,7 @@
|
||||
#include <asm/delay.h>
|
||||
|
||||
#include <mach/dma.h>
|
||||
#include <mach/regs-ssp.h>
|
||||
#include <mach/ssp.h>
|
||||
#include <plat/ssp.h>
|
||||
#include <mach/pxa2xx_spi.h>
|
||||
|
||||
MODULE_AUTHOR("Stephen Street");
|
||||
@@ -1318,14 +1317,14 @@ static int setup(struct spi_device *spi)
|
||||
/* NOTE: PXA25x_SSP _could_ use external clocking ... */
|
||||
if (drv_data->ssp_type != PXA25x_SSP)
|
||||
dev_dbg(&spi->dev, "%ld Hz actual, %s\n",
|
||||
clk_get_rate(ssp->clk)
|
||||
/ (1 + ((chip->cr0 & SSCR0_SCR) >> 8)),
|
||||
chip->enable_dma ? "DMA" : "PIO");
|
||||
clk_get_rate(ssp->clk)
|
||||
/ (1 + ((chip->cr0 & SSCR0_SCR(0xfff)) >> 8)),
|
||||
chip->enable_dma ? "DMA" : "PIO");
|
||||
else
|
||||
dev_dbg(&spi->dev, "%ld Hz actual, %s\n",
|
||||
clk_get_rate(ssp->clk) / 2
|
||||
/ (1 + ((chip->cr0 & SSCR0_SCR) >> 8)),
|
||||
chip->enable_dma ? "DMA" : "PIO");
|
||||
clk_get_rate(ssp->clk) / 2
|
||||
/ (1 + ((chip->cr0 & SSCR0_SCR(0x0ff)) >> 8)),
|
||||
chip->enable_dma ? "DMA" : "PIO");
|
||||
|
||||
if (spi->bits_per_word <= 8) {
|
||||
chip->n_bytes = 1;
|
||||
@@ -1466,7 +1465,7 @@ static int __init pxa2xx_spi_probe(struct platform_device *pdev)
|
||||
|
||||
platform_info = dev->platform_data;
|
||||
|
||||
ssp = ssp_request(pdev->id, pdev->name);
|
||||
ssp = pxa_ssp_request(pdev->id, pdev->name);
|
||||
if (ssp == NULL) {
|
||||
dev_err(&pdev->dev, "failed to request SSP%d\n", pdev->id);
|
||||
return -ENODEV;
|
||||
@@ -1476,7 +1475,7 @@ static int __init pxa2xx_spi_probe(struct platform_device *pdev)
|
||||
master = spi_alloc_master(dev, sizeof(struct driver_data) + 16);
|
||||
if (!master) {
|
||||
dev_err(&pdev->dev, "cannot alloc spi_master\n");
|
||||
ssp_free(ssp);
|
||||
pxa_ssp_free(ssp);
|
||||
return -ENOMEM;
|
||||
}
|
||||
drv_data = spi_master_get_devdata(master);
|
||||
@@ -1558,7 +1557,7 @@ static int __init pxa2xx_spi_probe(struct platform_device *pdev)
|
||||
write_SSCR1(SSCR1_RxTresh(RX_THRESH_DFLT) |
|
||||
SSCR1_TxTresh(TX_THRESH_DFLT),
|
||||
drv_data->ioaddr);
|
||||
write_SSCR0(SSCR0_SerClkDiv(2)
|
||||
write_SSCR0(SSCR0_SCR(2)
|
||||
| SSCR0_Motorola
|
||||
| SSCR0_DataSize(8),
|
||||
drv_data->ioaddr);
|
||||
@@ -1605,7 +1604,7 @@ out_error_irq_alloc:
|
||||
|
||||
out_error_master_alloc:
|
||||
spi_master_put(master);
|
||||
ssp_free(ssp);
|
||||
pxa_ssp_free(ssp);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1649,7 +1648,7 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
|
||||
free_irq(ssp->irq, drv_data);
|
||||
|
||||
/* Release SSP */
|
||||
ssp_free(ssp);
|
||||
pxa_ssp_free(ssp);
|
||||
|
||||
/* Disconnect from the SPI framework */
|
||||
spi_unregister_master(drv_data->master);
|
||||
|
@@ -678,7 +678,7 @@ static int mpc8xxx_spi_setup(struct spi_device *spi)
|
||||
}
|
||||
mpc8xxx_spi = spi_master_get_devdata(spi->master);
|
||||
|
||||
hw_mode = cs->hw_mode; /* Save orginal settings */
|
||||
hw_mode = cs->hw_mode; /* Save original settings */
|
||||
cs->hw_mode = mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->mode);
|
||||
/* mask out bits we are going to set */
|
||||
cs->hw_mode &= ~(SPMODE_CP_BEGIN_EDGECLK | SPMODE_CI_INACTIVEHIGH
|
||||
@@ -835,7 +835,7 @@ static void mpc8xxx_spi_free_dummy_rx(void)
|
||||
static unsigned long mpc8xxx_spi_cpm_get_pram(struct mpc8xxx_spi *mspi)
|
||||
{
|
||||
struct device *dev = mspi->dev;
|
||||
struct device_node *np = dev_archdata_get_node(&dev->archdata);
|
||||
struct device_node *np = dev->of_node;
|
||||
const u32 *iprop;
|
||||
int size;
|
||||
unsigned long spi_base_ofs;
|
||||
@@ -889,7 +889,7 @@ static unsigned long mpc8xxx_spi_cpm_get_pram(struct mpc8xxx_spi *mspi)
|
||||
static int mpc8xxx_spi_cpm_init(struct mpc8xxx_spi *mspi)
|
||||
{
|
||||
struct device *dev = mspi->dev;
|
||||
struct device_node *np = dev_archdata_get_node(&dev->archdata);
|
||||
struct device_node *np = dev->of_node;
|
||||
const u32 *iprop;
|
||||
int size;
|
||||
unsigned long pram_ofs;
|
||||
@@ -1161,7 +1161,7 @@ static void mpc8xxx_spi_cs_control(struct spi_device *spi, bool on)
|
||||
|
||||
static int of_mpc8xxx_spi_get_chipselects(struct device *dev)
|
||||
{
|
||||
struct device_node *np = dev_archdata_get_node(&dev->archdata);
|
||||
struct device_node *np = dev->of_node;
|
||||
struct fsl_spi_platform_data *pdata = dev->platform_data;
|
||||
struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
|
||||
unsigned int ngpios;
|
||||
@@ -1262,7 +1262,7 @@ static int __devinit of_mpc8xxx_spi_probe(struct of_device *ofdev,
|
||||
const struct of_device_id *ofid)
|
||||
{
|
||||
struct device *dev = &ofdev->dev;
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct mpc8xxx_spi_probe_info *pinfo;
|
||||
struct fsl_spi_platform_data *pdata;
|
||||
struct spi_master *master;
|
||||
@@ -1350,8 +1350,11 @@ static const struct of_device_id of_mpc8xxx_spi_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, of_mpc8xxx_spi_match);
|
||||
|
||||
static struct of_platform_driver of_mpc8xxx_spi_driver = {
|
||||
.name = "mpc8xxx_spi",
|
||||
.match_table = of_mpc8xxx_spi_match,
|
||||
.driver = {
|
||||
.name = "mpc8xxx_spi",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_mpc8xxx_spi_match,
|
||||
},
|
||||
.probe = of_mpc8xxx_spi_probe,
|
||||
.remove = __devexit_p(of_mpc8xxx_spi_remove),
|
||||
};
|
||||
|
@@ -587,12 +587,12 @@ static const struct of_device_id spi_ppc4xx_of_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match);
|
||||
|
||||
static struct of_platform_driver spi_ppc4xx_of_driver = {
|
||||
.match_table = spi_ppc4xx_of_match,
|
||||
.probe = spi_ppc4xx_of_probe,
|
||||
.remove = __exit_p(spi_ppc4xx_of_remove),
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = spi_ppc4xx_of_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -109,12 +109,12 @@ static const struct of_device_id xilinx_spi_of_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, xilinx_spi_of_match);
|
||||
|
||||
static struct of_platform_driver xilinx_spi_of_driver = {
|
||||
.match_table = xilinx_spi_of_match,
|
||||
.probe = xilinx_spi_of_probe,
|
||||
.remove = __exit_p(xilinx_spi_of_remove),
|
||||
.driver = {
|
||||
.name = "xilinx-xps-spi",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = xilinx_spi_of_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user