Commit a057d737 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'spi/fix/bcm63xx', 'spi/fix/doc',...

Merge remote-tracking branches 'spi/fix/bcm63xx', 'spi/fix/doc', 'spi/fix/mediatek' and 'spi/fix/pl022' into spi-linus
...@@ -562,8 +562,8 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) ...@@ -562,8 +562,8 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
goto out_clk_disable; goto out_clk_disable;
} }
dev_info(dev, "at 0x%08x (irq %d, FIFOs size %d)\n", dev_info(dev, "at %pr (irq %d, FIFOs size %d)\n",
r->start, irq, bs->fifo_size); r, irq, bs->fifo_size);
return 0; return 0;
......
...@@ -410,7 +410,7 @@ static int mtk_spi_setup(struct spi_device *spi) ...@@ -410,7 +410,7 @@ static int mtk_spi_setup(struct spi_device *spi)
if (!spi->controller_data) if (!spi->controller_data)
spi->controller_data = (void *)&mtk_default_chip_info; spi->controller_data = (void *)&mtk_default_chip_info;
if (mdata->dev_comp->need_pad_sel) if (mdata->dev_comp->need_pad_sel && gpio_is_valid(spi->cs_gpio))
gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
return 0; return 0;
...@@ -632,8 +632,17 @@ static int mtk_spi_probe(struct platform_device *pdev) ...@@ -632,8 +632,17 @@ static int mtk_spi_probe(struct platform_device *pdev)
goto err_put_master; goto err_put_master;
} }
if (!master->cs_gpios && master->num_chipselect > 1) {
dev_err(&pdev->dev,
"cs_gpios not specified and num_chipselect > 1\n");
ret = -EINVAL;
goto err_put_master;
}
if (master->cs_gpios) {
for (i = 0; i < master->num_chipselect; i++) { for (i = 0; i < master->num_chipselect; i++) {
ret = devm_gpio_request(&pdev->dev, master->cs_gpios[i], ret = devm_gpio_request(&pdev->dev,
master->cs_gpios[i],
dev_name(&pdev->dev)); dev_name(&pdev->dev));
if (ret) { if (ret) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
...@@ -642,6 +651,7 @@ static int mtk_spi_probe(struct platform_device *pdev) ...@@ -642,6 +651,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
} }
} }
} }
}
return 0; return 0;
......
...@@ -1171,19 +1171,31 @@ static int pl022_dma_probe(struct pl022 *pl022) ...@@ -1171,19 +1171,31 @@ static int pl022_dma_probe(struct pl022 *pl022)
static int pl022_dma_autoprobe(struct pl022 *pl022) static int pl022_dma_autoprobe(struct pl022 *pl022)
{ {
struct device *dev = &pl022->adev->dev; struct device *dev = &pl022->adev->dev;
struct dma_chan *chan;
int err;
/* automatically configure DMA channels from platform, normally using DT */ /* automatically configure DMA channels from platform, normally using DT */
pl022->dma_rx_channel = dma_request_slave_channel(dev, "rx"); chan = dma_request_slave_channel_reason(dev, "rx");
if (!pl022->dma_rx_channel) if (IS_ERR(chan)) {
err = PTR_ERR(chan);
goto err_no_rxchan; goto err_no_rxchan;
}
pl022->dma_rx_channel = chan;
pl022->dma_tx_channel = dma_request_slave_channel(dev, "tx"); chan = dma_request_slave_channel_reason(dev, "tx");
if (!pl022->dma_tx_channel) if (IS_ERR(chan)) {
err = PTR_ERR(chan);
goto err_no_txchan; goto err_no_txchan;
}
pl022->dma_tx_channel = chan;
pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL); pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!pl022->dummypage) if (!pl022->dummypage) {
err = -ENOMEM;
goto err_no_dummypage; goto err_no_dummypage;
}
return 0; return 0;
...@@ -1194,7 +1206,7 @@ static int pl022_dma_autoprobe(struct pl022 *pl022) ...@@ -1194,7 +1206,7 @@ static int pl022_dma_autoprobe(struct pl022 *pl022)
dma_release_channel(pl022->dma_rx_channel); dma_release_channel(pl022->dma_rx_channel);
pl022->dma_rx_channel = NULL; pl022->dma_rx_channel = NULL;
err_no_rxchan: err_no_rxchan:
return -ENODEV; return err;
} }
static void terminate_dma(struct pl022 *pl022) static void terminate_dma(struct pl022 *pl022)
...@@ -2236,6 +2248,10 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -2236,6 +2248,10 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id)
/* Get DMA channels, try autoconfiguration first */ /* Get DMA channels, try autoconfiguration first */
status = pl022_dma_autoprobe(pl022); status = pl022_dma_autoprobe(pl022);
if (status == -EPROBE_DEFER) {
dev_dbg(dev, "deferring probe to get DMA channel\n");
goto err_no_irq;
}
/* If that failed, use channels from platform_info */ /* If that failed, use channels from platform_info */
if (status == 0) if (status == 0)
......
...@@ -376,6 +376,7 @@ static void spi_drv_shutdown(struct device *dev) ...@@ -376,6 +376,7 @@ static void spi_drv_shutdown(struct device *dev)
/** /**
* __spi_register_driver - register a SPI driver * __spi_register_driver - register a SPI driver
* @owner: owner module of the driver to register
* @sdrv: the driver to register * @sdrv: the driver to register
* Context: can sleep * Context: can sleep
* *
......
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