mpfs/spi: adapt to sysreg define changes

This commit is contained in:
Janne Rosberg 2021-08-23 15:49:13 +03:00 committed by Xiang Xiao
parent 3e6b19dfc5
commit dc54ba924e

View File

@ -1332,25 +1332,21 @@ static void mpfs_spi_init(struct spi_dev_s *dev)
if (priv->id == 0) if (priv->id == 0)
{ {
modifyreg32(MPFS_SYSREG_SOFT_RESET_CR, 0, modifyreg32(MPFS_SYSREG_SOFT_RESET_CR, 0, SYSREG_SOFT_RESET_CR_SPI0);
(1 << SYSREG_SOFT_RESET_CR_SPI0));
modifyreg32(MPFS_SYSREG_SOFT_RESET_CR, modifyreg32(MPFS_SYSREG_SOFT_RESET_CR, SYSREG_SOFT_RESET_CR_SPI0, 0);
(1 << SYSREG_SOFT_RESET_CR_SPI0), 0);
modifyreg32(MPFS_SYSREG_SUBBLK_CLOCK_CR, 0, modifyreg32(MPFS_SYSREG_SUBBLK_CLOCK_CR, 0,
(1 << SYSREG_SUBBLK_CLOCK_CR_SPI0)); SYSREG_SUBBLK_CLOCK_CR_SPI0);
} }
else else
{ {
modifyreg32(MPFS_SYSREG_SOFT_RESET_CR, 0, modifyreg32(MPFS_SYSREG_SOFT_RESET_CR, 0, SYSREG_SOFT_RESET_CR_SPI1);
(1 << SYSREG_SOFT_RESET_CR_SPI1));
modifyreg32(MPFS_SYSREG_SOFT_RESET_CR, modifyreg32(MPFS_SYSREG_SOFT_RESET_CR, SYSREG_SOFT_RESET_CR_SPI1, 0);
(1 << SYSREG_SOFT_RESET_CR_SPI1), 0);
modifyreg32(MPFS_SYSREG_SUBBLK_CLOCK_CR, 0, modifyreg32(MPFS_SYSREG_SUBBLK_CLOCK_CR, 0,
(1 << SYSREG_SUBBLK_CLOCK_CR_SPI1)); SYSREG_SUBBLK_CLOCK_CR_SPI1);
} }
/* Reset the device */ /* Reset the device */
@ -1399,14 +1395,12 @@ static void mpfs_spi_deinit(struct spi_dev_s *dev)
if (priv->id == 0) if (priv->id == 0)
{ {
modifyreg32(MPFS_SYSREG_SUBBLK_CLOCK_CR, modifyreg32(MPFS_SYSREG_SUBBLK_CLOCK_CR,
(1 << SYSREG_SUBBLK_CLOCK_CR_SPI0), SYSREG_SUBBLK_CLOCK_CR_SPI0, 0);
0);
} }
else else
{ {
modifyreg32(MPFS_SYSREG_SUBBLK_CLOCK_CR, modifyreg32(MPFS_SYSREG_SUBBLK_CLOCK_CR,
(1 << SYSREG_SUBBLK_CLOCK_CR_SPI1), SYSREG_SUBBLK_CLOCK_CR_SPI1, 0);
0);
} }
priv->frequency = 0; priv->frequency = 0;