diff options
| author | Eric Tashakkor <w36098@motorola.com> | 2014-05-28 15:06:02 -0500 |
|---|---|---|
| committer | ERIC TASHAKKOR <w36098@motorola.com> | 2014-05-29 19:50:47 +0000 |
| commit | 987ba520f90fcdbb32a1f84ef8b168507d700e30 (patch) | |
| tree | 2394ffd2a210caa57e93f06e72350de623e319a5 /include/linux/m4sensorhub.h | |
| parent | 9c1764fef85c8f34489dfe73183b258bbfced4e1 (diff) | |
| download | olio-linux-3.10-987ba520f90fcdbb32a1f84ef8b168507d700e30.tar.xz olio-linux-3.10-987ba520f90fcdbb32a1f84ef8b168507d700e30.zip | |
IKXCLOCK-1703 Add M4 Pre-Flash Callback for RTC
Added a pre-flash callback system for drivers with timing restrictions like RTC
Updated the RTC driver to save and use set time requests until M4 is ready
Fixed a bug where uninitialized memory was preventing the time being set
Minor clean up of driver files to meet checkpatch style requirements
Change-Id: I9e03f373226e678e8e884c836f68fcb265f39a57
Signed-off-by: Eric Tashakkor <w36098@motorola.com>
Diffstat (limited to 'include/linux/m4sensorhub.h')
| -rw-r--r-- | include/linux/m4sensorhub.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/include/linux/m4sensorhub.h b/include/linux/m4sensorhub.h index 0559eb980f0..2e0de82aa1b 100644 --- a/include/linux/m4sensorhub.h +++ b/include/linux/m4sensorhub.h @@ -31,10 +31,10 @@ extern char m4sensorhub_debug; #define M4SENSORHUB_DRIVER_NAME "m4sensorhub" #define M4SENSORHUB_I2C_ADDR 0x18 -#define KDEBUG(i, format, s...) \ - do { \ +#define KDEBUG(i, format, s...) \ + do { \ if (m4sensorhub_debug >= i) \ - printk(KERN_CRIT format, ##s); \ + pr_crit(format, ##s); \ } while (0) enum m4sensorhub_debug_level { @@ -222,6 +222,23 @@ int m4sensorhub_register_initcall(int(*initfunc)(struct init_calldata *), void m4sensorhub_unregister_initcall( int(*initfunc)(struct init_calldata *)); +/* + * Some M4 drivers (e.g., RTC) require reading data on boot, even if M4 + * needs a firmware update. These functions allow drivers to register + * callbacks with the core to take care of small maintenance tasks before + * M4 is reflashed (e.g., caching the system time). + * + * NOTE: Drivers should not rely on this call for normal operation. + * Reflashing M4 is an uncommon event, and most of the time, + * especially in production, these callbacks will never be used. + */ +int m4sensorhub_register_preflash_callback( + int(*initfunc)(struct init_calldata *), void *pdata); +void m4sensorhub_unregister_preflash_callback( + int(*initfunc)(struct init_calldata *)); +void m4sensorhub_call_preflash_callbacks(void); /* For FW flash core */ +bool m4sensorhub_preflash_callbacks_exist(void); /* For FW flash core */ + int m4sensorhub_irq_disable_all(struct m4sensorhub_data *m4sensorhub); #endif /* __KERNEL__ */ |