Skip to content

Commit

Permalink
mtd: spi: renesas: Write DREAR register once
Browse files Browse the repository at this point in the history
Instead of writing DREAR with 0 first and then overwriting DREAR again
in case of 4 byte addressing mode, write DREAR in every case once with
the correct content right away. No functional change.

Signed-off-by: Marek Vasut <[email protected]>
  • Loading branch information
Marek Vasut committed Sep 8, 2024
1 parent 4ab0a58 commit 1cc7c7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/spi/renesas_rpc_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,15 @@ static int rpc_spi_mem_exec_op(struct spi_slave *spi,
writel(RPC_DRCMR_CMD(op->cmd.opcode), priv->regs + RPC_DRCMR);
smenr |= RPC_DRENR_CDE;

writel(0, priv->regs + RPC_DREAR);
if (op->addr.nbytes == 4) {
writel(RPC_DREAR_EAV(offset >> 25) | RPC_DREAR_EAC(1),
priv->regs + RPC_DREAR);
smenr |= RPC_DRENR_ADE(0xF);
} else if (op->addr.nbytes == 3) {
writel(0, priv->regs + RPC_DREAR);
smenr |= RPC_DRENR_ADE(0x7);
} else {
writel(0, priv->regs + RPC_DREAR);
smenr |= RPC_DRENR_ADE(0);
}

Expand Down

0 comments on commit 1cc7c7e

Please sign in to comment.