diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-05-10 15:41:29 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-05-11 09:35:06 +0100 |
commit | 0c8ccd8b267fc735e4621774ce62728f27d42863 (patch) | |
tree | 52a3a57e34263469bb7688899824467f9b985a3c /include/linux/pxa2xx_ssp.h | |
parent | 4761d2e7e51cfbe6fdb4e95903d407927f519f50 (diff) | |
download | linux-0c8ccd8b267fc735e4621774ce62728f27d42863.tar.gz linux-0c8ccd8b267fc735e4621774ce62728f27d42863.tar.bz2 linux-0c8ccd8b267fc735e4621774ce62728f27d42863.zip |
spi: pxa2xx: Use pxa_ssp_enable()/pxa_ssp_disable() in the driver
There are few places that repeat the logic of pxa_ssp_enable() and
pxa_ssp_disable(). Use them instead of open coded variants.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210510124134.24638-10-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/pxa2xx_ssp.h')
-rw-r--r-- | include/linux/pxa2xx_ssp.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h index 1b6c1a0922bd..fdfbe17e15f4 100644 --- a/include/linux/pxa2xx_ssp.h +++ b/include/linux/pxa2xx_ssp.h @@ -254,6 +254,22 @@ static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg) return __raw_readl(dev->mmio_base + reg); } +static inline void pxa_ssp_enable(struct ssp_device *ssp) +{ + u32 sscr0; + + sscr0 = pxa_ssp_read_reg(ssp, SSCR0) | SSCR0_SSE; + pxa_ssp_write_reg(ssp, SSCR0, sscr0); +} + +static inline void pxa_ssp_disable(struct ssp_device *ssp) +{ + u32 sscr0; + + sscr0 = pxa_ssp_read_reg(ssp, SSCR0) & ~SSCR0_SSE; + pxa_ssp_write_reg(ssp, SSCR0, sscr0); +} + #if IS_ENABLED(CONFIG_PXA_SSP) struct ssp_device *pxa_ssp_request(int port, const char *label); void pxa_ssp_free(struct ssp_device *); |