power_off.c 544 B

123456789101112131415161718192021222324252627
  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. int count = 0;
  12. dprintf(CRITICAL, "mt_power_off\n");
  13. /* pull PWRBB low */
  14. rtc_bbpu_power_down();
  15. while (1) {
  16. mdelay(100);
  17. dprintf(CRITICAL, "mt_power_off : check charger\n");
  18. if (pmic_chrdet_status() == KAL_TRUE || count > 10)
  19. mtk_arch_reset(0);
  20. count++;
  21. }
  22. }
  23. #endif