Lines Matching refs:machinfo
190 int i = sharpsl_pm.machinfo->bat_levels - 1; in get_percentage()
191 …int bl_status = sharpsl_pm.machinfo->backlight_get_status ? sharpsl_pm.machinfo->backlight_get_sta… in get_percentage()
195 …thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_acin_bl : sharpsl_pm.machinfo->bat_levels_aci… in get_percentage()
197 …thresh = bl_status ? sharpsl_pm.machinfo->bat_levels_noac_bl : sharpsl_pm.machinfo->bat_levels_noa… in get_percentage()
210 high_thresh = sharpsl_pm.machinfo->status_high_acin; in get_apm_status()
211 low_thresh = sharpsl_pm.machinfo->status_low_acin; in get_apm_status()
213 high_thresh = sharpsl_pm.machinfo->status_high_noac; in get_apm_status()
214 low_thresh = sharpsl_pm.machinfo->status_low_noac; in get_apm_status()
235 if (!sharpsl_pm.machinfo) in sharpsl_battery_thread()
238 …sharpsl_pm.battstat.ac_status = (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN) ? APM_AC_O… in sharpsl_battery_thread()
241 if (!sharpsl_pm.machinfo->batfull_irq && (sharpsl_pm.charge_mode == CHRG_ON) in sharpsl_battery_thread()
246 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); in sharpsl_battery_thread()
251 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage; in sharpsl_battery_thread()
311 sharpsl_pm.machinfo->charge(0); in sharpsl_charge_off()
321 sharpsl_pm.machinfo->charge(0); in sharpsl_charge_error()
329 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) { in sharpsl_charge_toggle()
338 sharpsl_pm.machinfo->charge(0); in sharpsl_charge_toggle()
340 sharpsl_pm.machinfo->charge(1); in sharpsl_charge_toggle()
347 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); in sharpsl_ac_timer()
376 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) { in sharpsl_chrg_full_timer()
411 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) { in sharpsl_fatal_isr()
416 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL)) { in sharpsl_fatal_isr()
507 sharpsl_pm.machinfo->measure_temp(1); in sharpsl_check_battery_temp()
509 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_TEMP); in sharpsl_check_battery_temp()
510 sharpsl_pm.machinfo->measure_temp(0); in sharpsl_check_battery_temp()
516 if (val > sharpsl_pm.machinfo->charge_on_temp) { in sharpsl_check_battery_temp()
530 sharpsl_pm.machinfo->charge(0); in sharpsl_check_battery_voltage()
531 sharpsl_pm.machinfo->discharge(1); in sharpsl_check_battery_voltage()
534 if (sharpsl_pm.machinfo->discharge1) in sharpsl_check_battery_voltage()
535 sharpsl_pm.machinfo->discharge1(1); in sharpsl_check_battery_voltage()
539 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); in sharpsl_check_battery_voltage()
543 if (sharpsl_pm.machinfo->discharge1) in sharpsl_check_battery_voltage()
544 sharpsl_pm.machinfo->discharge1(0); in sharpsl_check_battery_voltage()
546 sharpsl_pm.machinfo->discharge(0); in sharpsl_check_battery_voltage()
551 if (val < sharpsl_pm.machinfo->charge_on_volt) in sharpsl_check_battery_voltage()
563 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT); in sharpsl_ac_check()
570 …if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low… in sharpsl_ac_check()
611 …if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STA… in corgi_goto_sleep()
618 sharpsl_pm.machinfo->presuspend(); in corgi_goto_sleep()
638 sharpsl_pm.machinfo->postsuspend(); in corgi_goto_sleep()
645 …if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable… in corgi_enter_suspend()
659 if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || in corgi_enter_suspend()
660 (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL))) { in corgi_enter_suspend()
681 if (sharpsl_pm.machinfo->earlyresume) in corgi_pxa_pm_enter()
682 sharpsl_pm.machinfo->earlyresume(); in corgi_pxa_pm_enter()
700 acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); in sharpsl_fatal_check()
703 sharpsl_pm.machinfo->charge(0); in sharpsl_fatal_check()
705 sharpsl_pm.machinfo->discharge(1); /* enable discharge */ in sharpsl_fatal_check()
709 if (sharpsl_pm.machinfo->discharge1) in sharpsl_fatal_check()
710 sharpsl_pm.machinfo->discharge1(1); in sharpsl_fatal_check()
714 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); in sharpsl_fatal_check()
718 if (sharpsl_pm.machinfo->discharge1) in sharpsl_fatal_check()
719 sharpsl_pm.machinfo->discharge1(0); in sharpsl_fatal_check()
723 sharpsl_pm.machinfo->charge(1); in sharpsl_fatal_check()
724 sharpsl_pm.machinfo->discharge(0); in sharpsl_fatal_check()
728 …%d, discharge voltage: %d, no discharge: %ld\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHA… in sharpsl_fatal_check()
730 if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) || in sharpsl_fatal_check()
731 (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt))) in sharpsl_fatal_check()
739 sharpsl_pm.machinfo->charge(0); in sharpsl_off_charge_error()
765 sharpsl_pm.machinfo->charge(0); in sharpsl_off_charge_battery()
767 sharpsl_pm.machinfo->charge(1); in sharpsl_off_charge_battery()
785 sharpsl_pm.machinfo->charge(0); in sharpsl_off_charge_battery()
787 sharpsl_pm.machinfo->charge(1); in sharpsl_off_charge_battery()
795 if (sharpsl_pm.machinfo->charger_wakeup() != 0) in sharpsl_off_charge_battery()
800 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) { in sharpsl_off_charge_battery()
803 sharpsl_pm.machinfo->charge(0); in sharpsl_off_charge_battery()
805 sharpsl_pm.machinfo->charge(1); in sharpsl_off_charge_battery()
818 if (sharpsl_pm.machinfo->charger_wakeup()) in sharpsl_off_charge_battery()
829 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) { in sharpsl_off_charge_battery()
832 sharpsl_pm.machinfo->charge(0); in sharpsl_off_charge_battery()
888 sharpsl_pm.machinfo = pdev->dev.platform_data; in sharpsl_pm_probe()
900 sharpsl_pm.machinfo->init(); in sharpsl_pm_probe()
902 gpio_request(sharpsl_pm.machinfo->gpio_acin, "AC IN"); in sharpsl_pm_probe()
903 gpio_direction_input(sharpsl_pm.machinfo->gpio_acin); in sharpsl_pm_probe()
904 gpio_request(sharpsl_pm.machinfo->gpio_batfull, "Battery Full"); in sharpsl_pm_probe()
905 gpio_direction_input(sharpsl_pm.machinfo->gpio_batfull); in sharpsl_pm_probe()
906 gpio_request(sharpsl_pm.machinfo->gpio_batlock, "Battery Lock"); in sharpsl_pm_probe()
907 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock); in sharpsl_pm_probe()
910 …if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRI… in sharpsl_pm_probe()
911 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin)); in sharpsl_pm_probe()
914 …if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IR… in sharpsl_pm_probe()
915 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock)); in sharpsl_pm_probe()
918 if (sharpsl_pm.machinfo->gpio_fatal) { in sharpsl_pm_probe()
919 …if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF… in sharpsl_pm_probe()
920 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal)); in sharpsl_pm_probe()
924 if (sharpsl_pm.machinfo->batfull_irq) { in sharpsl_pm_probe()
926 …if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED … in sharpsl_pm_probe()
927 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull)); in sharpsl_pm_probe()
956 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr); in sharpsl_pm_remove()
957 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr); in sharpsl_pm_remove()
959 if (sharpsl_pm.machinfo->gpio_fatal) in sharpsl_pm_remove()
960 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr); in sharpsl_pm_remove()
962 if (sharpsl_pm.machinfo->batfull_irq) in sharpsl_pm_remove()
963 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); in sharpsl_pm_remove()
965 gpio_free(sharpsl_pm.machinfo->gpio_batlock); in sharpsl_pm_remove()
966 gpio_free(sharpsl_pm.machinfo->gpio_batfull); in sharpsl_pm_remove()
967 gpio_free(sharpsl_pm.machinfo->gpio_acin); in sharpsl_pm_remove()
969 if (sharpsl_pm.machinfo->exit) in sharpsl_pm_remove()
970 sharpsl_pm.machinfo->exit(); in sharpsl_pm_remove()