Skip to content

Commit 2fbef66

Browse files
committed
Merge remote-tracking branches 'spi/fix/dt', 'spi/fix/fsl-dspi' and 'spi/fix/fsl-espi' into spi-linus
4 parents 07d9a38 + e0af98a + 5ee67b5 + 5c0ba57 commit 2fbef66

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

drivers/spi/spi-fsl-dspi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#define SPI_SR 0x2c
7171
#define SPI_SR_EOQF 0x10000000
7272
#define SPI_SR_TCFQF 0x80000000
73+
#define SPI_SR_CLEAR 0xdaad0000
7374

7475
#define SPI_RSER 0x30
7576
#define SPI_RSER_EOQFE 0x10000000
@@ -646,6 +647,11 @@ static const struct regmap_config dspi_regmap_config = {
646647
.max_register = 0x88,
647648
};
648649

650+
static void dspi_init(struct fsl_dspi *dspi)
651+
{
652+
regmap_write(dspi->regmap, SPI_SR, SPI_SR_CLEAR);
653+
}
654+
649655
static int dspi_probe(struct platform_device *pdev)
650656
{
651657
struct device_node *np = pdev->dev.of_node;
@@ -709,6 +715,7 @@ static int dspi_probe(struct platform_device *pdev)
709715
return PTR_ERR(dspi->regmap);
710716
}
711717

718+
dspi_init(dspi);
712719
dspi->irq = platform_get_irq(pdev, 0);
713720
if (dspi->irq < 0) {
714721
dev_err(&pdev->dev, "can't get platform irq\n");

drivers/spi/spi-fsl-espi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ static void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
458458

459459
mspi->len -= rx_nr_bytes;
460460

461-
if (mspi->rx)
461+
if (rx_nr_bytes && mspi->rx)
462462
mspi->get_rx(rx_data, mspi);
463463
}
464464

drivers/spi/spi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,9 +1618,11 @@ static void of_register_spi_devices(struct spi_master *master)
16181618
if (of_node_test_and_set_flag(nc, OF_POPULATED))
16191619
continue;
16201620
spi = of_register_spi_device(master, nc);
1621-
if (IS_ERR(spi))
1621+
if (IS_ERR(spi)) {
16221622
dev_warn(&master->dev, "Failed to create SPI device for %s\n",
16231623
nc->full_name);
1624+
of_node_clear_flag(nc, OF_POPULATED);
1625+
}
16241626
}
16251627
}
16261628
#else
@@ -3131,6 +3133,7 @@ static int of_spi_notify(struct notifier_block *nb, unsigned long action,
31313133
if (IS_ERR(spi)) {
31323134
pr_err("%s: failed to create for '%s'\n",
31333135
__func__, rd->dn->full_name);
3136+
of_node_clear_flag(rd->dn, OF_POPULATED);
31343137
return notifier_from_errno(PTR_ERR(spi));
31353138
}
31363139
break;

0 commit comments

Comments
 (0)