diff options
| author | Tony Lindgren <tony@atomide.com> | 2010-08-02 14:23:38 +0300 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2010-08-02 14:23:38 +0300 |
| commit | 055a1b8c9927bc587f293020a54c6cd8e24dfac0 (patch) | |
| tree | db7c8d00931180c4896c9e00d2cb506939592cda /drivers/platform/x86/intel_scu_ipc.c | |
| parent | 8a6f7e14fc3b3ea911838c3f4ce137cb8a3d134a (diff) | |
| parent | f535daed925c2d3c1db06b06a63c4955f2c51988 (diff) | |
| download | olio-linux-3.10-055a1b8c9927bc587f293020a54c6cd8e24dfac0.tar.xz olio-linux-3.10-055a1b8c9927bc587f293020a54c6cd8e24dfac0.zip | |
Merge branch 'devel-misc' into omap-for-linus
Diffstat (limited to 'drivers/platform/x86/intel_scu_ipc.c')
| -rw-r--r-- | drivers/platform/x86/intel_scu_ipc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 40658e3385b..bb2f1fba637 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -489,7 +489,7 @@ int intel_scu_ipc_simple_command(int cmd, int sub) mutex_unlock(&ipclock); return -ENODEV; } - ipc_command(cmd << 12 | sub); + ipc_command(sub << 12 | cmd); err = busy_loop(); mutex_unlock(&ipclock); return err; @@ -501,9 +501,9 @@ EXPORT_SYMBOL(intel_scu_ipc_simple_command); * @cmd: command * @sub: sub type * @in: input data - * @inlen: input length + * @inlen: input length in dwords * @out: output data - * @outlein: output length + * @outlein: output length in dwords * * Issue a command to the SCU which involves data transfers. Do the * data copies under the lock but leave it for the caller to interpret @@ -524,7 +524,7 @@ int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, for (i = 0; i < inlen; i++) ipc_data_writel(*in++, 4 * i); - ipc_command((cmd << 12) | sub | (inlen << 18)); + ipc_command((sub << 12) | cmd | (inlen << 18)); err = busy_loop(); for (i = 0; i < outlen; i++) @@ -556,6 +556,10 @@ int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data) u32 cmd = 0; mutex_lock(&ipclock); + if (ipcdev.pdev == NULL) { + mutex_unlock(&ipclock); + return -ENODEV; + } cmd = (addr >> 24) & 0xFF; if (cmd == IPC_I2C_READ) { writel(addr, ipcdev.i2c_base + IPC_I2C_CNTRL_ADDR); |