Commit fab6a041 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'spi/topic/sh', 'spi/topic/sh-msiof' and...

Merge remote-tracking branches 'spi/topic/sh', 'spi/topic/sh-msiof' and 'spi/topic/topcliff-pch' into spi-next
...@@ -446,7 +446,7 @@ config SPI_SC18IS602 ...@@ -446,7 +446,7 @@ config SPI_SC18IS602
config SPI_SH_MSIOF config SPI_SH_MSIOF
tristate "SuperH MSIOF SPI controller" tristate "SuperH MSIOF SPI controller"
depends on HAVE_CLK depends on HAVE_CLK && HAS_DMA
depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
help help
SPI driver for SuperH and SH Mobile MSIOF blocks. SPI driver for SuperH and SH Mobile MSIOF blocks.
......
This diff is collapsed.
...@@ -432,7 +432,6 @@ static int spi_sh_remove(struct platform_device *pdev) ...@@ -432,7 +432,6 @@ static int spi_sh_remove(struct platform_device *pdev)
spi_unregister_master(ss->master); spi_unregister_master(ss->master);
destroy_workqueue(ss->workqueue); destroy_workqueue(ss->workqueue);
free_irq(ss->irq, ss); free_irq(ss->irq, ss);
iounmap(ss->addr);
return 0; return 0;
} }
...@@ -480,7 +479,7 @@ static int spi_sh_probe(struct platform_device *pdev) ...@@ -480,7 +479,7 @@ static int spi_sh_probe(struct platform_device *pdev)
} }
ss->irq = irq; ss->irq = irq;
ss->master = master; ss->master = master;
ss->addr = ioremap(res->start, resource_size(res)); ss->addr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (ss->addr == NULL) { if (ss->addr == NULL) {
dev_err(&pdev->dev, "ioremap error.\n"); dev_err(&pdev->dev, "ioremap error.\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -495,13 +494,13 @@ static int spi_sh_probe(struct platform_device *pdev) ...@@ -495,13 +494,13 @@ static int spi_sh_probe(struct platform_device *pdev)
if (ss->workqueue == NULL) { if (ss->workqueue == NULL) {
dev_err(&pdev->dev, "create workqueue error\n"); dev_err(&pdev->dev, "create workqueue error\n");
ret = -EBUSY; ret = -EBUSY;
goto error2; goto error1;
} }
ret = request_irq(irq, spi_sh_irq, 0, "spi_sh", ss); ret = request_irq(irq, spi_sh_irq, 0, "spi_sh", ss);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "request_irq error\n"); dev_err(&pdev->dev, "request_irq error\n");
goto error3; goto error2;
} }
master->num_chipselect = 2; master->num_chipselect = 2;
...@@ -513,17 +512,15 @@ static int spi_sh_probe(struct platform_device *pdev) ...@@ -513,17 +512,15 @@ static int spi_sh_probe(struct platform_device *pdev)
ret = spi_register_master(master); ret = spi_register_master(master);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "spi_register_master error.\n"); printk(KERN_ERR "spi_register_master error.\n");
goto error4; goto error3;
} }
return 0; return 0;
error4:
free_irq(irq, ss);
error3: error3:
destroy_workqueue(ss->workqueue); free_irq(irq, ss);
error2: error2:
iounmap(ss->addr); destroy_workqueue(ss->workqueue);
error1: error1:
spi_master_put(master); spi_master_put(master);
......
...@@ -874,8 +874,8 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw) ...@@ -874,8 +874,8 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw)
dma_cap_set(DMA_SLAVE, mask); dma_cap_set(DMA_SLAVE, mask);
/* Get DMA's dev information */ /* Get DMA's dev information */
dma_dev = pci_get_bus_and_slot(data->board_dat->pdev->bus->number, dma_dev = pci_get_slot(data->board_dat->pdev->bus,
PCI_DEVFN(12, 0)); PCI_DEVFN(PCI_SLOT(data->board_dat->pdev->devfn), 0));
/* Set Tx DMA */ /* Set Tx DMA */
param = &dma->param_tx; param = &dma->param_tx;
...@@ -1047,8 +1047,8 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw) ...@@ -1047,8 +1047,8 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
num, DMA_DEV_TO_MEM, num, DMA_DEV_TO_MEM,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK); DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc_rx) { if (!desc_rx) {
dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n", dev_err(&data->master->dev,
__func__); "%s:dmaengine_prep_slave_sg Failed\n", __func__);
return; return;
} }
dma_sync_sg_for_device(&data->master->dev, sg, num, DMA_FROM_DEVICE); dma_sync_sg_for_device(&data->master->dev, sg, num, DMA_FROM_DEVICE);
...@@ -1106,8 +1106,8 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw) ...@@ -1106,8 +1106,8 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
sg, num, DMA_MEM_TO_DEV, sg, num, DMA_MEM_TO_DEV,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK); DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc_tx) { if (!desc_tx) {
dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n", dev_err(&data->master->dev,
__func__); "%s:dmaengine_prep_slave_sg Failed\n", __func__);
return; return;
} }
dma_sync_sg_for_device(&data->master->dev, sg, num, DMA_TO_DEVICE); dma_sync_sg_for_device(&data->master->dev, sg, num, DMA_TO_DEVICE);
......
...@@ -5,6 +5,8 @@ struct sh_msiof_spi_info { ...@@ -5,6 +5,8 @@ struct sh_msiof_spi_info {
int tx_fifo_override; int tx_fifo_override;
int rx_fifo_override; int rx_fifo_override;
u16 num_chipselect; u16 num_chipselect;
unsigned int dma_tx_id;
unsigned int dma_rx_id;
}; };
#endif /* __SPI_SH_MSIOF_H__ */ #endif /* __SPI_SH_MSIOF_H__ */
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