Пример #1
0
static int vt1603_bat_suspend(struct platform_device *pdev, pm_message_t message)
{
    struct vt1603_bat_drvdata *bat_drv = NULL;

    dbg("Enter\n");
    bat_drv = dev_get_drvdata(&pdev->dev);
#ifdef VT1603_BATTERY_EN
    del_timer_sync(&bat_drv->bat_tmr);
#endif
#ifdef CONFIG_VT1603_BATTERY_ALARM
    vt1603_bat_alarm_setup(bat_drv, bat_drv->alarm_threshold, 
                                bat_drv->wakeup_src);
#endif
    dbg("Exit\n");
    return 0;
}
Пример #2
0
static int vt1603_bat_i2c_suspend(struct i2c_client *i2c, pm_message_t message)
{
    struct vt1603_bat_drvdata *bat_drv = NULL;
    struct vt1603_bat_platform_data *bat_pdata = NULL;

    bat_dbg("Enter\n");
    bat_drv = dev_get_drvdata(&i2c->dev);
    bat_pdata = i2c->dev.platform_data;
#ifdef CONFIG_VT1603_BATTERY_ENABLE
    del_timer_sync(&bat_drv->bat_tmr);
#endif
#ifdef CONFIG_VT1603_BATTERY_ALARM
    vt1603_bat_alarm_setup(bat_drv, bat_pdata->alarm_threshold, 
                                bat_pdata->wakeup_src);
#endif
    bat_dbg("Exit\n");
    return 0;
}