From: Hong Liu Date: Mon, 26 Jul 2010 09:05:52 +0000 (+0100) Subject: intel_scu_ipc: fix data packing of PMIC command on Moorestown X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=215c330fe92be8d9f74bc292ea085dbe2ace6bf5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git intel_scu_ipc: fix data packing of PMIC command on Moorestown Data is 2-byte per entry for PMIC read-modify-update command. Signed-off-by: Hong Liu Signed-off-by: Alan Cox Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 5055c523c5e2..84a2d4bfdec8 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -154,7 +154,7 @@ static inline int busy_loop(void) /* Wait till scu status is busy */ /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) { - int i, nc, bytes; + int i, nc, bytes, d; u32 offset = 0; u32 err = 0; u8 cbuf[IPC_WWBUF_SIZE] = { }; @@ -171,15 +171,16 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) if (platform != MRST_CPU_CHIP_PENWELL) { bytes = 0; - for(i=0; i> 8; if (id != IPC_CMD_PCNTRL_R) - cbuf[bytes++] = data[i]; + cbuf[bytes++] = data[d++]; if (id == IPC_CMD_PCNTRL_M) - cbuf[bytes++] = data[i + 1]; + cbuf[bytes++] = data[d++]; } - for(i=0; i