From 2855fb7b26ef2fb97edd7ca39f2d9fef3173ea3c Mon Sep 17 00:00:00 2001 From: Amit Jain Date: Thu, 6 Feb 2014 11:11:46 -0600 Subject: IKXCLOCK-193:Init mechanism of M4 based drivers Change-Id: I3c665f1c31d14e73d3776982d570c250e6f8c3b1 Reviewed-on: http://gerrit.pcs.mot.com/608745 SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Sajid Dalvi Submit-Approved: Jira Key --- include/linux/m4sensorhub.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'include/linux/m4sensorhub.h') diff --git a/include/linux/m4sensorhub.h b/include/linux/m4sensorhub.h index d2a4a094715..c93321562ba 100644 --- a/include/linux/m4sensorhub.h +++ b/include/linux/m4sensorhub.h @@ -81,6 +81,15 @@ enum m4sensorhub_panichdl_index { struct m4sensorhub_data; +/* args passed to init callback, + p_m4sensorhub_data is pointer to M4's data + p_data is the void * that was registered along + with the function pointer*/ +struct init_calldata { + struct m4sensorhub_data *p_m4sensorhub_data; + void *p_data; +}; + struct m4sensorhub_platform_data { int (*hw_init)(struct m4sensorhub_data *); void (*hw_free)(struct m4sensorhub_data *); @@ -203,9 +212,15 @@ int m4sensorhub_panic_register(struct m4sensorhub_data *m4sensorhub, int m4sensorhub_panic_unregister(struct m4sensorhub_data *m4sensorhub, enum m4sensorhub_panichdl_index index); void m4sensorhub_panic_process(struct m4sensorhub_data *m4sensorhub); -int m4sensorhub_register_initcall(int(*initfunc)(struct m4sensorhub_data *)); +/* all M4 based drivers need to register an init call with the core, + this callback will be executed once M4 core has properly set up FW + on M4. For registration, a callback and a void* is passed in. When + the callback is executed, the client provided void* is passed back + as part of (init_calldata).p_data */ +int m4sensorhub_register_initcall(int(*initfunc)(struct init_calldata *), + void *pdata); void m4sensorhub_unregister_initcall( - int(*initfunc)(struct m4sensorhub_data *)); + int(*initfunc)(struct init_calldata *)); #endif /* __KERNEL__ */ -- cgit v1.2.3-70-g09d2