static void ssp_power_suspend(struct power_suspend *handler) { struct ssp_data *data; data = container_of(handler, struct ssp_data, power_suspend); func_dbg(); disable_debug_timer(data); #ifdef CONFIG_SENSORS_SSP_SENSORHUB /* give notice to user that AP goes to sleep */ ssp_sensorhub_report_notice(data, MSG2SSP_AP_STATUS_SLEEP); ssp_sleep_mode(data); #else if (atomic_read(&data->aSensorEnable) > 0) ssp_sleep_mode(data); #endif }
static int ssp_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct ssp_data *data = i2c_get_clientdata(client); func_dbg(); disable_debug_timer(data); if (atomic_read(&data->aSensorEnable) > 0) ssp_sleep_mode(data); data->bCheckSuspend = true; return 0; }