Lines Matching refs:machinfo

185 	int i = sharpsl_pm.machinfo->bat_levels - 1;
186 int bl_status = sharpsl_pm.machinfo->backlight_get_status ? sharpsl_pm.machinfo->backlight_get_status() : 0;
190 thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_acin_bl : sharpsl_pm.machinfo->bat_levels_acin;
192 thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_noac_bl : sharpsl_pm.machinfo->bat_levels_noac;
205 high_thresh = sharpsl_pm.machinfo->status_high_acin;
206 low_thresh = sharpsl_pm.machinfo->status_low_acin;
208 high_thresh = sharpsl_pm.machinfo->status_high_noac;
209 low_thresh = sharpsl_pm.machinfo->status_low_noac;
228 if (!sharpsl_pm.machinfo)
231 sharpsl_pm.battstat.ac_status = (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN) ? APM_AC_ONLINE : APM_AC_OFFLINE);
234 if (!sharpsl_pm.machinfo->batfull_irq && (sharpsl_pm.charge_mode == CHRG_ON)
239 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
244 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage;
304 sharpsl_pm.machinfo->charge(0);
314 sharpsl_pm.machinfo->charge(0);
322 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
331 sharpsl_pm.machinfo->charge(0);
333 sharpsl_pm.machinfo->charge(1);
340 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
369 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
404 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) {
409 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL)) {
500 sharpsl_pm.machinfo->measure_temp(1);
502 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_TEMP);
503 sharpsl_pm.machinfo->measure_temp(0);
509 if (val > sharpsl_pm.machinfo->charge_on_temp) {
523 sharpsl_pm.machinfo->charge(0);
524 sharpsl_pm.machinfo->discharge(1);
527 if (sharpsl_pm.machinfo->discharge1)
528 sharpsl_pm.machinfo->discharge1(1);
532 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
536 if (sharpsl_pm.machinfo->discharge1)
537 sharpsl_pm.machinfo->discharge1(0);
539 sharpsl_pm.machinfo->discharge(0);
544 if (val < sharpsl_pm.machinfo->charge_on_volt)
556 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT);
563 if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low)) {
604 if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN))) {
611 sharpsl_pm.machinfo->presuspend();
631 sharpsl_pm.machinfo->postsuspend();
638 if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable)) {
652 if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) ||
653 (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL))) {
674 if (sharpsl_pm.machinfo->earlyresume)
675 sharpsl_pm.machinfo->earlyresume();
685 sharpsl_pm.machinfo->charge(0);
711 sharpsl_pm.machinfo->charge(0);
713 sharpsl_pm.machinfo->charge(1);
731 sharpsl_pm.machinfo->charge(0);
733 sharpsl_pm.machinfo->charge(1);
741 if (sharpsl_pm.machinfo->charger_wakeup())
746 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
749 sharpsl_pm.machinfo->charge(0);
751 sharpsl_pm.machinfo->charge(1);
764 if (sharpsl_pm.machinfo->charger_wakeup())
775 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
778 sharpsl_pm.machinfo->charge(0);
834 sharpsl_pm.machinfo = pdev->dev.platform_data;
844 sharpsl_pm.machinfo->init();
846 gpio_request(sharpsl_pm.machinfo->gpio_acin, "AC IN");
847 gpio_direction_input(sharpsl_pm.machinfo->gpio_acin);
848 gpio_request(sharpsl_pm.machinfo->gpio_batfull, "Battery Full");
849 gpio_direction_input(sharpsl_pm.machinfo->gpio_batfull);
850 gpio_request(sharpsl_pm.machinfo->gpio_batlock, "Battery Lock");
851 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
854 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_acin);
859 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock);
864 if (sharpsl_pm.machinfo->gpio_fatal) {
865 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal);
871 if (sharpsl_pm.machinfo->batfull_irq) {
873 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull);
904 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
905 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
907 if (sharpsl_pm.machinfo->gpio_fatal)
908 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
910 if (sharpsl_pm.machinfo->batfull_irq)
911 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
913 gpio_free(sharpsl_pm.machinfo->gpio_batlock);
914 gpio_free(sharpsl_pm.machinfo->gpio_batfull);
915 gpio_free(sharpsl_pm.machinfo->gpio_acin);
917 if (sharpsl_pm.machinfo->exit)
918 sharpsl_pm.machinfo->exit();