Skip to content

Commit 85cac43

Browse files
committed
Merge remote-tracking branch 'spi/topic/qspi' into spi-next
2 parents 793b3cb + b646036 commit 85cac43

16 files changed

Lines changed: 757 additions & 136 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
TI QSPI controller.
2+
3+
Required properties:
4+
- compatible : should be "ti,dra7xxx-qspi" or "ti,am4372-qspi".
5+
- reg: Should contain QSPI registers location and length.
6+
- #address-cells, #size-cells : Must be present if the device has sub-nodes
7+
- ti,hwmods: Name of the hwmod associated to the QSPI
8+
9+
Recommended properties:
10+
- spi-max-frequency: Definition as per
11+
Documentation/devicetree/bindings/spi/spi-bus.txt
12+
13+
Example:
14+
15+
qspi: qspi@4b300000 {
16+
compatible = "ti,dra7xxx-qspi";
17+
reg = <0x4b300000 0x100>;
18+
#address-cells = <1>;
19+
#size-cells = <0>;
20+
spi-max-frequency = <25000000>;
21+
ti,hwmods = "qspi";
22+
};

‎drivers/spi/Kconfig‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ config SPI_OMAP24XX
306306
SPI master controller for OMAP24XX and later Multichannel SPI
307307
(McSPI) modules.
308308

309+
config SPI_TI_QSPI
310+
tristate "DRA7xxx QSPI controller support"
311+
depends on ARCH_OMAP2PLUS || COMPILE_TEST
312+
help
313+
QSPI master controller for DRA7xxx used for flash devices.
314+
This device supports single, dual and quad read support, while
315+
it only supports single write mode.
316+
309317
config SPI_OMAP_100K
310318
tristate "OMAP SPI 100K"
311319
depends on ARCH_OMAP850 || ARCH_OMAP730 || COMPILE_TEST

‎drivers/spi/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ obj-$(CONFIG_SPI_OCTEON) += spi-octeon.o
4949
obj-$(CONFIG_SPI_OMAP_UWIRE) += spi-omap-uwire.o
5050
obj-$(CONFIG_SPI_OMAP_100K) += spi-omap-100k.o
5151
obj-$(CONFIG_SPI_OMAP24XX) += spi-omap2-mcspi.o
52+
obj-$(CONFIG_SPI_TI_QSPI) += spi-ti-qspi.o
5253
obj-$(CONFIG_SPI_ORION) += spi-orion.o
5354
obj-$(CONFIG_SPI_PL022) += spi-pl022.o
5455
obj-$(CONFIG_SPI_PPC4xx) += spi-ppc4xx.o

‎drivers/spi/spi-bcm63xx.c‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -231,24 +231,6 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,
231231
return 0;
232232
}
233233

234-
static int bcm63xx_spi_prepare_transfer(struct spi_master *master)
235-
{
236-
struct bcm63xx_spi *bs = spi_master_get_devdata(master);
237-
238-
pm_runtime_get_sync(&bs->pdev->dev);
239-
240-
return 0;
241-
}
242-
243-
static int bcm63xx_spi_unprepare_transfer(struct spi_master *master)
244-
{
245-
struct bcm63xx_spi *bs = spi_master_get_devdata(master);
246-
247-
pm_runtime_put(&bs->pdev->dev);
248-
249-
return 0;
250-
}
251-
252234
static int bcm63xx_spi_transfer_one(struct spi_master *master,
253235
struct spi_message *m)
254236
{
@@ -406,11 +388,10 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
406388

407389
master->bus_num = pdata->bus_num;
408390
master->num_chipselect = pdata->num_chipselect;
409-
master->prepare_transfer_hardware = bcm63xx_spi_prepare_transfer;
410-
master->unprepare_transfer_hardware = bcm63xx_spi_unprepare_transfer;
411391
master->transfer_one_message = bcm63xx_spi_transfer_one;
412392
master->mode_bits = MODEBITS;
413393
master->bits_per_word_mask = SPI_BPW_MASK(8);
394+
master->auto_runtime_pm = true;
414395
bs->msg_type_shift = pdata->msg_type_shift;
415396
bs->msg_ctl_width = pdata->msg_ctl_width;
416397
bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA));

‎drivers/spi/spi-coldfire-qspi.c‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -354,24 +354,6 @@ static int mcfqspi_transfer_one_message(struct spi_master *master,
354354

355355
}
356356

357-
static int mcfqspi_prepare_transfer_hw(struct spi_master *master)
358-
{
359-
struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
360-
361-
pm_runtime_get_sync(mcfqspi->dev);
362-
363-
return 0;
364-
}
365-
366-
static int mcfqspi_unprepare_transfer_hw(struct spi_master *master)
367-
{
368-
struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
369-
370-
pm_runtime_put_sync(mcfqspi->dev);
371-
372-
return 0;
373-
}
374-
375357
static int mcfqspi_setup(struct spi_device *spi)
376358
{
377359
if (spi->chip_select >= spi->master->num_chipselect) {
@@ -473,8 +455,7 @@ static int mcfqspi_probe(struct platform_device *pdev)
473455
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 16);
474456
master->setup = mcfqspi_setup;
475457
master->transfer_one_message = mcfqspi_transfer_one_message;
476-
master->prepare_transfer_hardware = mcfqspi_prepare_transfer_hw;
477-
master->unprepare_transfer_hardware = mcfqspi_unprepare_transfer_hw;
458+
master->auto_runtime_pm = true;
478459

479460
platform_set_drvdata(pdev, master);
480461

‎drivers/spi/spi-omap2-mcspi.c‎

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -335,23 +335,6 @@ static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
335335
__raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);
336336
}
337337

338-
static int omap2_prepare_transfer(struct spi_master *master)
339-
{
340-
struct omap2_mcspi *mcspi = spi_master_get_devdata(master);
341-
342-
pm_runtime_get_sync(mcspi->dev);
343-
return 0;
344-
}
345-
346-
static int omap2_unprepare_transfer(struct spi_master *master)
347-
{
348-
struct omap2_mcspi *mcspi = spi_master_get_devdata(master);
349-
350-
pm_runtime_mark_last_busy(mcspi->dev);
351-
pm_runtime_put_autosuspend(mcspi->dev);
352-
return 0;
353-
}
354-
355338
static int mcspi_wait_for_reg_bit(void __iomem *reg, unsigned long bit)
356339
{
357340
unsigned long timeout;
@@ -1318,8 +1301,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
13181301
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
13191302
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
13201303
master->setup = omap2_mcspi_setup;
1321-
master->prepare_transfer_hardware = omap2_prepare_transfer;
1322-
master->unprepare_transfer_hardware = omap2_unprepare_transfer;
1304+
master->auto_runtime_pm = true;
13231305
master->transfer_one_message = omap2_mcspi_transfer_one_message;
13241306
master->cleanup = omap2_mcspi_cleanup;
13251307
master->dev.of_node = node;

‎drivers/spi/spi-pl022.c‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,18 +1555,6 @@ static int pl022_transfer_one_message(struct spi_master *master,
15551555
return 0;
15561556
}
15571557

1558-
static int pl022_prepare_transfer_hardware(struct spi_master *master)
1559-
{
1560-
struct pl022 *pl022 = spi_master_get_devdata(master);
1561-
1562-
/*
1563-
* Just make sure we have all we need to run the transfer by syncing
1564-
* with the runtime PM framework.
1565-
*/
1566-
pm_runtime_get_sync(&pl022->adev->dev);
1567-
return 0;
1568-
}
1569-
15701558
static int pl022_unprepare_transfer_hardware(struct spi_master *master)
15711559
{
15721560
struct pl022 *pl022 = spi_master_get_devdata(master);
@@ -1575,13 +1563,6 @@ static int pl022_unprepare_transfer_hardware(struct spi_master *master)
15751563
writew((readw(SSP_CR1(pl022->virtbase)) &
15761564
(~SSP_CR1_MASK_SSE)), SSP_CR1(pl022->virtbase));
15771565

1578-
if (pl022->master_info->autosuspend_delay > 0) {
1579-
pm_runtime_mark_last_busy(&pl022->adev->dev);
1580-
pm_runtime_put_autosuspend(&pl022->adev->dev);
1581-
} else {
1582-
pm_runtime_put(&pl022->adev->dev);
1583-
}
1584-
15851566
return 0;
15861567
}
15871568

@@ -2140,7 +2121,7 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id)
21402121
master->num_chipselect = num_cs;
21412122
master->cleanup = pl022_cleanup;
21422123
master->setup = pl022_setup;
2143-
master->prepare_transfer_hardware = pl022_prepare_transfer_hardware;
2124+
master->auto_runtime_pm = true;
21442125
master->transfer_one_message = pl022_transfer_one_message;
21452126
master->unprepare_transfer_hardware = pl022_unprepare_transfer_hardware;
21462127
master->rt = platform_info->rt;

‎drivers/spi/spi-pxa2xx.c‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -811,14 +811,6 @@ static int pxa2xx_spi_transfer_one_message(struct spi_master *master,
811811
return 0;
812812
}
813813

814-
static int pxa2xx_spi_prepare_transfer(struct spi_master *master)
815-
{
816-
struct driver_data *drv_data = spi_master_get_devdata(master);
817-
818-
pm_runtime_get_sync(&drv_data->pdev->dev);
819-
return 0;
820-
}
821-
822814
static int pxa2xx_spi_unprepare_transfer(struct spi_master *master)
823815
{
824816
struct driver_data *drv_data = spi_master_get_devdata(master);
@@ -827,8 +819,6 @@ static int pxa2xx_spi_unprepare_transfer(struct spi_master *master)
827819
write_SSCR0(read_SSCR0(drv_data->ioaddr) & ~SSCR0_SSE,
828820
drv_data->ioaddr);
829821

830-
pm_runtime_mark_last_busy(&drv_data->pdev->dev);
831-
pm_runtime_put_autosuspend(&drv_data->pdev->dev);
832822
return 0;
833823
}
834824

@@ -1141,8 +1131,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
11411131
master->cleanup = cleanup;
11421132
master->setup = setup;
11431133
master->transfer_one_message = pxa2xx_spi_transfer_one_message;
1144-
master->prepare_transfer_hardware = pxa2xx_spi_prepare_transfer;
11451134
master->unprepare_transfer_hardware = pxa2xx_spi_unprepare_transfer;
1135+
master->auto_runtime_pm = true;
11461136

11471137
drv_data->ssp_type = ssp->type;
11481138
drv_data->null_dma_buf = (u32 *)PTR_ALIGN(&drv_data[1], DMA_ALIGNMENT);

‎drivers/spi/spi-s3c64xx.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,6 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
356356
while (!is_polling(sdd) && !acquire_dma(sdd))
357357
usleep_range(10000, 11000);
358358

359-
pm_runtime_get_sync(&sdd->pdev->dev);
360-
361359
return 0;
362360
}
363361

@@ -372,7 +370,6 @@ static int s3c64xx_spi_unprepare_transfer(struct spi_master *spi)
372370
sdd->ops->release((enum dma_ch)sdd->tx_dma.ch,
373371
&s3c64xx_spi_dma_client);
374372
}
375-
pm_runtime_put(&sdd->pdev->dev);
376373

377374
return 0;
378375
}
@@ -1395,6 +1392,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
13951392
SPI_BPW_MASK(8);
13961393
/* the spi->mode bits understood by this driver: */
13971394
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
1395+
master->auto_runtime_pm = true;
13981396

13991397
sdd->regs = devm_ioremap_resource(&pdev->dev, mem_res);
14001398
if (IS_ERR(sdd->regs)) {

‎drivers/spi/spi-sh-hspi.c‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,6 @@ static int hspi_status_check_timeout(struct hspi_priv *hspi, u32 mask, u32 val)
9999
/*
100100
* spi master function
101101
*/
102-
static int hspi_prepare_transfer(struct spi_master *master)
103-
{
104-
struct hspi_priv *hspi = spi_master_get_devdata(master);
105-
106-
pm_runtime_get_sync(hspi->dev);
107-
return 0;
108-
}
109-
110-
static int hspi_unprepare_transfer(struct spi_master *master)
111-
{
112-
struct hspi_priv *hspi = spi_master_get_devdata(master);
113-
114-
pm_runtime_put_sync(hspi->dev);
115-
return 0;
116-
}
117102

118103
#define hspi_hw_cs_enable(hspi) hspi_hw_cs_ctrl(hspi, 0)
119104
#define hspi_hw_cs_disable(hspi) hspi_hw_cs_ctrl(hspi, 1)
@@ -316,9 +301,8 @@ static int hspi_probe(struct platform_device *pdev)
316301
master->setup = hspi_setup;
317302
master->cleanup = hspi_cleanup;
318303
master->mode_bits = SPI_CPOL | SPI_CPHA;
319-
master->prepare_transfer_hardware = hspi_prepare_transfer;
304+
master->auto_runtime_pm = true;
320305
master->transfer_one_message = hspi_transfer_one_message;
321-
master->unprepare_transfer_hardware = hspi_unprepare_transfer;
322306
ret = spi_register_master(master);
323307
if (ret < 0) {
324308
dev_err(&pdev->dev, "spi_register_master error.\n");

0 commit comments

Comments
 (0)