diff options
| -rw-r--r-- | drivers/platform/x86/intel_scu_ipc.c | 11 |
1 files changed, 6 insertions, 5 deletions
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 */ | |||
| 154 | /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */ | 154 | /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */ |
| 155 | static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) | 155 | static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) |
| 156 | { | 156 | { |
| 157 | int i, nc, bytes; | 157 | int i, nc, bytes, d; |
| 158 | u32 offset = 0; | 158 | u32 offset = 0; |
| 159 | u32 err = 0; | 159 | u32 err = 0; |
| 160 | u8 cbuf[IPC_WWBUF_SIZE] = { }; | 160 | u8 cbuf[IPC_WWBUF_SIZE] = { }; |
| @@ -171,15 +171,16 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) | |||
| 171 | 171 | ||
| 172 | if (platform != MRST_CPU_CHIP_PENWELL) { | 172 | if (platform != MRST_CPU_CHIP_PENWELL) { |
| 173 | bytes = 0; | 173 | bytes = 0; |
| 174 | for(i=0; i<count; i++) { | 174 | d = 0; |
| 175 | for (i = 0; i < count; i++) { | ||
| 175 | cbuf[bytes++] = addr[i]; | 176 | cbuf[bytes++] = addr[i]; |
| 176 | cbuf[bytes++] = addr[i] >> 8; | 177 | cbuf[bytes++] = addr[i] >> 8; |
| 177 | if (id != IPC_CMD_PCNTRL_R) | 178 | if (id != IPC_CMD_PCNTRL_R) |
| 178 | cbuf[bytes++] = data[i]; | 179 | cbuf[bytes++] = data[d++]; |
| 179 | if (id == IPC_CMD_PCNTRL_M) | 180 | if (id == IPC_CMD_PCNTRL_M) |
| 180 | cbuf[bytes++] = data[i + 1]; | 181 | cbuf[bytes++] = data[d++]; |
| 181 | } | 182 | } |
| 182 | for(i=0; i<bytes; i+=4) | 183 | for (i = 0; i < bytes; i += 4) |
| 183 | ipc_data_writel(wbuf[i/4], i); | 184 | ipc_data_writel(wbuf[i/4], i); |
| 184 | ipc_command(bytes << 16 | id << 12 | 0 << 8 | op); | 185 | ipc_command(bytes << 16 | id << 12 | 0 << 8 | op); |
| 185 | } else { | 186 | } else { |
