#include <linux/gpio.h>
#include <linux/of_gpio.h>
#include <linux/rockchip/common.h>
+#include <linux/reboot.h>
#include <linux/scpi_protocol.h>
#include "../../arch/arm/mach-rockchip/efuse.h"
bool logout;
bool b_suspend;
struct mutex suspend_lock;
+ int shuttemp_count;
void __iomem *regs;
#define TSADC_TEST
#define TSADC_TEST_SAMPLE_TIME 200/* msec */
+#define TSADC_MAX_HW_SHUT_TEMP_COUNT 3
+
struct tsadc_table {
unsigned long code;
long temp;
if(thermal->logout)
printk("cpu temp:[%d], voltage: %d\n"
, temp, voltage);
+
+ if (temp > thermal->hw_shut_temp / 1000)
+ thermal->shuttemp_count++;
+ else
+ thermal->shuttemp_count = 0;
+ if (thermal->shuttemp_count >= TSADC_MAX_HW_SHUT_TEMP_COUNT) {
+ dev_err(&thermal->pdev->dev,
+ "critical temperature reached(%ld C),shutting down\n",
+ thermal->hw_shut_temp / 1000);
+ orderly_poweroff(true);
+ }
}
mutex_unlock(&thermal->suspend_lock);