Lines Matching refs:machinfo

181 	int i = sharpsl_pm.machinfo->bat_levels - 1;
182 int bl_status = sharpsl_pm.machinfo->backlight_get_status ? sharpsl_pm.machinfo->backlight_get_status() : 0;
186 thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_acin_bl : sharpsl_pm.machinfo->bat_levels_acin;
188 thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_noac_bl : sharpsl_pm.machinfo->bat_levels_noac;
201 high_thresh = sharpsl_pm.machinfo->status_high_acin;
202 low_thresh = sharpsl_pm.machinfo->status_low_acin;
204 high_thresh = sharpsl_pm.machinfo->status_high_noac;
205 low_thresh = sharpsl_pm.machinfo->status_low_noac;
224 if (!sharpsl_pm.machinfo)
227 sharpsl_pm.battstat.ac_status = (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN) ? APM_AC_ONLINE : APM_AC_OFFLINE);
230 if (!sharpsl_pm.machinfo->batfull_irq && (sharpsl_pm.charge_mode == CHRG_ON)
235 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
240 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage;
300 sharpsl_pm.machinfo->charge(0);
310 sharpsl_pm.machinfo->charge(0);
318 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
327 sharpsl_pm.machinfo->charge(0);
329 sharpsl_pm.machinfo->charge(1);
336 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
365 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
400 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) {
405 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL)) {
496 sharpsl_pm.machinfo->measure_temp(1);
498 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_TEMP);
499 sharpsl_pm.machinfo->measure_temp(0);
505 if (val > sharpsl_pm.machinfo->charge_on_temp) {
519 sharpsl_pm.machinfo->charge(0);
520 sharpsl_pm.machinfo->discharge(1);
523 if (sharpsl_pm.machinfo->discharge1)
524 sharpsl_pm.machinfo->discharge1(1);
528 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
532 if (sharpsl_pm.machinfo->discharge1)
533 sharpsl_pm.machinfo->discharge1(0);
535 sharpsl_pm.machinfo->discharge(0);
540 if (val < sharpsl_pm.machinfo->charge_on_volt)
552 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT);
559 if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low)) {
600 if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN))) {
607 sharpsl_pm.machinfo->presuspend();
627 sharpsl_pm.machinfo->postsuspend();
634 if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable)) {
648 if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) ||
649 (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL))) {
670 if (sharpsl_pm.machinfo->earlyresume)
671 sharpsl_pm.machinfo->earlyresume();
681 sharpsl_pm.machinfo->charge(0);
707 sharpsl_pm.machinfo->charge(0);
709 sharpsl_pm.machinfo->charge(1);
727 sharpsl_pm.machinfo->charge(0);
729 sharpsl_pm.machinfo->charge(1);
737 if (sharpsl_pm.machinfo->charger_wakeup())
742 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
745 sharpsl_pm.machinfo->charge(0);
747 sharpsl_pm.machinfo->charge(1);
760 if (sharpsl_pm.machinfo->charger_wakeup())
771 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
774 sharpsl_pm.machinfo->charge(0);
830 sharpsl_pm.machinfo = pdev->dev.platform_data;
840 sharpsl_pm.machinfo->init();
842 gpio_request(sharpsl_pm.machinfo->gpio_acin, "AC IN");
843 gpio_direction_input(sharpsl_pm.machinfo->gpio_acin);
844 gpio_request(sharpsl_pm.machinfo->gpio_batfull, "Battery Full");
845 gpio_direction_input(sharpsl_pm.machinfo->gpio_batfull);
846 gpio_request(sharpsl_pm.machinfo->gpio_batlock, "Battery Lock");
847 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
850 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_acin);
855 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock);
860 if (sharpsl_pm.machinfo->gpio_fatal) {
861 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal);
867 if (sharpsl_pm.machinfo->batfull_irq) {
869 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull);
900 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
901 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
903 if (sharpsl_pm.machinfo->gpio_fatal)
904 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
906 if (sharpsl_pm.machinfo->batfull_irq)
907 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
909 gpio_free(sharpsl_pm.machinfo->gpio_batlock);
910 gpio_free(sharpsl_pm.machinfo->gpio_batfull);
911 gpio_free(sharpsl_pm.machinfo->gpio_acin);
913 if (sharpsl_pm.machinfo->exit)
914 sharpsl_pm.machinfo->exit();