aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/intel_scu_ipc.h22
-rw-r--r--arch/x86/platform/mrst/mrst.c7
2 files changed, 29 insertions, 0 deletions
diff --git a/arch/x86/include/asm/intel_scu_ipc.h b/arch/x86/include/asm/intel_scu_ipc.h
index 29f66793cc55..4420993acc47 100644
--- a/arch/x86/include/asm/intel_scu_ipc.h
+++ b/arch/x86/include/asm/intel_scu_ipc.h
@@ -1,6 +1,8 @@
1#ifndef _ASM_X86_INTEL_SCU_IPC_H_ 1#ifndef _ASM_X86_INTEL_SCU_IPC_H_
2#define _ASM_X86_INTEL_SCU_IPC_H_ 2#define _ASM_X86_INTEL_SCU_IPC_H_
3 3
4#include <linux/notifier.h>
5
4#define IPCMSG_VRTC 0xFA /* Set vRTC device */ 6#define IPCMSG_VRTC 0xFA /* Set vRTC device */
5 7
6/* Command id associated with message IPCMSG_VRTC */ 8/* Command id associated with message IPCMSG_VRTC */
@@ -44,4 +46,24 @@ int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data);
44/* Update FW version */ 46/* Update FW version */
45int intel_scu_ipc_fw_update(u8 *buffer, u32 length); 47int intel_scu_ipc_fw_update(u8 *buffer, u32 length);
46 48
49extern struct blocking_notifier_head intel_scu_notifier;
50
51static inline void intel_scu_notifier_add(struct notifier_block *nb)
52{
53 blocking_notifier_chain_register(&intel_scu_notifier, nb);
54}
55
56static inline void intel_scu_notifier_remove(struct notifier_block *nb)
57{
58 blocking_notifier_chain_unregister(&intel_scu_notifier, nb);
59}
60
61static inline int intel_scu_notifier_post(unsigned long v, void *p)
62{
63 return blocking_notifier_call_chain(&intel_scu_notifier, v, p);
64}
65
66#define SCU_AVAILABLE 1
67#define SCU_DOWN 2
68
47#endif 69#endif
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
index fe73276e026b..51ec016c20d6 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -24,6 +24,7 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/notifier.h>
27 28
28#include <asm/setup.h> 29#include <asm/setup.h>
29#include <asm/mpspec_def.h> 30#include <asm/mpspec_def.h>
@@ -555,6 +556,9 @@ static void __init intel_scu_i2c_device_register(int bus,
555 i2c_devs[i2c_next_dev++] = new_dev; 556 i2c_devs[i2c_next_dev++] = new_dev;
556} 557}
557 558
559BLOCKING_NOTIFIER_HEAD(intel_scu_notifier);
560EXPORT_SYMBOL_GPL(intel_scu_notifier);
561
558/* Called by IPC driver */ 562/* Called by IPC driver */
559void intel_scu_devices_create(void) 563void intel_scu_devices_create(void)
560{ 564{
@@ -579,6 +583,7 @@ void intel_scu_devices_create(void)
579 } else 583 } else
580 i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1); 584 i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1);
581 } 585 }
586 intel_scu_notifier_post(SCU_AVAILABLE, 0L);
582} 587}
583EXPORT_SYMBOL_GPL(intel_scu_devices_create); 588EXPORT_SYMBOL_GPL(intel_scu_devices_create);
584 589
@@ -587,6 +592,8 @@ void intel_scu_devices_destroy(void)
587{ 592{
588 int i; 593 int i;
589 594
595 intel_scu_notifier_post(SCU_DOWN, 0L);
596
590 for (i = 0; i < ipc_next_dev; i++) 597 for (i = 0; i < ipc_next_dev; i++)
591 platform_device_del(ipc_devs[i]); 598 platform_device_del(ipc_devs[i]);
592} 599}