power_off.c 504 B

1234567891011121314151617181920212223242526
  1. //#include <common.h>
  2. //#include <asm/arch/mt65xx.h>
  3. #include <debug.h>
  4. #include <platform/mt_typedefs.h>
  5. #include <platform/mt_rtc.h>
  6. #include <platform/mtk_wdt.h>
  7. extern kal_bool pmic_chrdet_status(void);
  8. #ifndef NO_POWER_OFF
  9. void mt6575_power_off(void)
  10. {
  11. dprintf(CRITICAL, "mt_power_off\n");
  12. /* pull PWRBB low */
  13. rtc_bbpu_power_down();
  14. while (1) {
  15. dprintf(CRITICAL, "mt_power_off : check charger\n");
  16. if (pmic_chrdet_status() == KAL_TRUE) {
  17. mtk_arch_reset(0);
  18. break;
  19. }
  20. }
  21. }
  22. #endif