spi: i.MX: Simplify cspi_0_0_init()
Use SPI module software reset to simplify cspi_0_0_init(). Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
e9ab71561b
commit
6a40096a6c
|
@ -67,6 +67,8 @@
|
||||||
|
|
||||||
#define CSPI_0_0_TEST_LBC (1 << 14)
|
#define CSPI_0_0_TEST_LBC (1 << 14)
|
||||||
|
|
||||||
|
#define CSPI_0_0_RESET_START (1 << 0)
|
||||||
|
|
||||||
#define CSPI_0_7_RXDATA 0x00
|
#define CSPI_0_7_RXDATA 0x00
|
||||||
#define CSPI_0_7_TXDATA 0x04
|
#define CSPI_0_7_TXDATA 0x04
|
||||||
#define CSPI_0_7_CTRL 0x08
|
#define CSPI_0_7_CTRL 0x08
|
||||||
|
@ -197,13 +199,9 @@ static void cspi_0_0_init(struct imx_spi *imx)
|
||||||
{
|
{
|
||||||
void __iomem *base = imx->regs;
|
void __iomem *base = imx->regs;
|
||||||
|
|
||||||
writel(CSPI_0_0_CTRL_ENABLE | CSPI_0_0_CTRL_MASTER,
|
writel(CSPI_0_0_RESET_START, base + CSPI_0_0_RESET);
|
||||||
base + CSPI_0_0_CTRL);
|
do {
|
||||||
writel(CSPI_0_0_PERIOD_32KHZ,
|
} while (readl(base + CSPI_0_0_RESET) & CSPI_0_0_RESET_START);
|
||||||
base + CSPI_0_0_PERIOD);
|
|
||||||
while (readl(base + CSPI_0_0_INT) & CSPI_0_0_STAT_RR)
|
|
||||||
readl(base + CSPI_0_0_RXDATA);
|
|
||||||
writel(0, base + CSPI_0_0_INT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int cspi_0_7_xchg_single(struct imx_spi *imx, unsigned int data)
|
static unsigned int cspi_0_7_xchg_single(struct imx_spi *imx, unsigned int data)
|
||||||
|
|
Loading…
Reference in New Issue