diff options
Diffstat (limited to 'drivers/spi/spi-fsl-dspi.c')
-rw-r--r-- | drivers/spi/spi-fsl-dspi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 448216025ce8..4cda994d3f40 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | #define SPI_TCR 0x08 | 47 | #define SPI_TCR 0x08 |
48 | 48 | ||
49 | #define SPI_CTAR(x) (0x0c + (x * 4)) | 49 | #define SPI_CTAR(x) (0x0c + (((x) & 0x3) * 4)) |
50 | #define SPI_CTAR_FMSZ(x) (((x) & 0x0000000f) << 27) | 50 | #define SPI_CTAR_FMSZ(x) (((x) & 0x0000000f) << 27) |
51 | #define SPI_CTAR_CPOL(x) ((x) << 26) | 51 | #define SPI_CTAR_CPOL(x) ((x) << 26) |
52 | #define SPI_CTAR_CPHA(x) ((x) << 25) | 52 | #define SPI_CTAR_CPHA(x) ((x) << 25) |
@@ -70,7 +70,7 @@ | |||
70 | 70 | ||
71 | #define SPI_PUSHR 0x34 | 71 | #define SPI_PUSHR 0x34 |
72 | #define SPI_PUSHR_CONT (1 << 31) | 72 | #define SPI_PUSHR_CONT (1 << 31) |
73 | #define SPI_PUSHR_CTAS(x) (((x) & 0x00000007) << 28) | 73 | #define SPI_PUSHR_CTAS(x) (((x) & 0x00000003) << 28) |
74 | #define SPI_PUSHR_EOQ (1 << 27) | 74 | #define SPI_PUSHR_EOQ (1 << 27) |
75 | #define SPI_PUSHR_CTCNT (1 << 26) | 75 | #define SPI_PUSHR_CTCNT (1 << 26) |
76 | #define SPI_PUSHR_PCS(x) (((1 << x) & 0x0000003f) << 16) | 76 | #define SPI_PUSHR_PCS(x) (((1 << x) & 0x0000003f) << 16) |
@@ -438,7 +438,7 @@ static int dspi_resume(struct device *dev) | |||
438 | 438 | ||
439 | static SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume); | 439 | static SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume); |
440 | 440 | ||
441 | static struct regmap_config dspi_regmap_config = { | 441 | static const struct regmap_config dspi_regmap_config = { |
442 | .reg_bits = 32, | 442 | .reg_bits = 32, |
443 | .val_bits = 32, | 443 | .val_bits = 32, |
444 | .reg_stride = 4, | 444 | .reg_stride = 4, |
@@ -492,7 +492,6 @@ static int dspi_probe(struct platform_device *pdev) | |||
492 | goto out_master_put; | 492 | goto out_master_put; |
493 | } | 493 | } |
494 | 494 | ||
495 | dspi_regmap_config.lock_arg = dspi; | ||
496 | dspi->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "dspi", base, | 495 | dspi->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "dspi", base, |
497 | &dspi_regmap_config); | 496 | &dspi_regmap_config); |
498 | if (IS_ERR(dspi->regmap)) { | 497 | if (IS_ERR(dspi->regmap)) { |