diff options
| author | Amit Jain <ajain@motorola.com> | 2014-02-06 11:11:46 -0600 |
|---|---|---|
| committer | James Wylder <jwylder@motorola.com> | 2014-03-05 17:47:18 -0600 |
| commit | 2855fb7b26ef2fb97edd7ca39f2d9fef3173ea3c (patch) | |
| tree | d138de72cd9d23984d88a87be9c6ab7969842874 /include/linux/m4sensorhub.h | |
| parent | 07a7fd709b227d60cfbc39d554c56f4883bc2c13 (diff) | |
| download | olio-linux-3.10-2855fb7b26ef2fb97edd7ca39f2d9fef3173ea3c.tar.xz olio-linux-3.10-2855fb7b26ef2fb97edd7ca39f2d9fef3173ea3c.zip | |
IKXCLOCK-193:Init mechanism of M4 based drivers
Change-Id: I3c665f1c31d14e73d3776982d570c250e6f8c3b1
Reviewed-on: http://gerrit.pcs.mot.com/608745
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Sajid Dalvi <fsd017@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Diffstat (limited to 'include/linux/m4sensorhub.h')
| -rw-r--r-- | include/linux/m4sensorhub.h | 19 |
1 files changed, 17 insertions, 2 deletions
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__ */ |