spmi: pmic_arb: Fix opcode calculate error in pmic_arb_cmd

The original calculation of spmi command in pmic_arb_cmd()function
has wrong opcode bits value.

Change-Id: Ifdddaac4d4a58b71dca8307af002435333af0910
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
This commit is contained in:
Wu Fenglin 2013-12-24 11:21:58 +08:00
parent 1b61129781
commit 1f8122a5d1

View File

@ -237,7 +237,9 @@ static int pmic_arb_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid)
if (opc < SPMI_CMD_RESET || opc > SPMI_CMD_WAKEUP)
return -EINVAL;
cmd = ((opc | 0x40) << 27) | ((sid & 0xf) << 20);
opc -= SPMI_CMD_RESET - PMIC_ARB_OP_RESET;
cmd = (opc << 27) | ((sid & 0xf) << 20);
spin_lock_irqsave(&pmic_arb->lock, flags);
pmic_arb_write(pmic_arb, PMIC_ARB_CMD(pmic_arb->channel), cmd);