Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fddf5c98 authored by hecaiqiang's avatar hecaiqiang
Browse files

Optimize the connector temperature condition

Change-Id: I0c3e5a79e41e53c84dcbbf380b9588578eda70a1
(cherry picked from commit e7652866c736180eb91daa59b5617749abf37e09)
parent 0ddae316
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -5867,7 +5867,7 @@ static void op_get_aicl_work(struct work_struct *work)

#define NORMAL_CHECK_INTERVAL 300 /*ms*/
#define FAST_CHECK_INTERVAL 100 /*ms*/
#define HIGH_TEMP_SHORT_CHECK_TIMEOUT 1000 /*ms*/
#define HIGH_TEMP_SHORT_CHECK_TIMEOUT 1500 /*ms*/

static void op_connect_temp_check_work(struct work_struct *work)
{
@@ -5942,9 +5942,8 @@ static void op_connect_temp_check_work(struct work_struct *work)
					chg->connecter_temp);
			op_disconnect_vbus(chg, true);
			return;
		} else if (((interval_temp >= 10) && (interval_temp < 15)) &&
					(chg->connecter_temp >= 45)) {
		/* 10<= <15*/
		} else if (chg->connecter_temp >= 35) {
		/* >= 35 enter*/
			if (chg->count_run <= chg->count_total) {
			/*time out count*/
				if (chg->count_run == 0)
@@ -5954,8 +5953,14 @@ static void op_connect_temp_check_work(struct work_struct *work)
				if (chg->count_run > 0) {
					chg->current_temp = chg->connecter_temp;
					if ((chg->current_temp - chg->pre_temp)
						>= 3)
						>= 3) {
						chg->connector_short = true;
						pr_info("cout_run=%d,short=%d\n",
							chg->count_run,
							chg->connector_short);
						op_disconnect_vbus(chg, true);
						return;
					}
				}

				chg->count_run++;/*count ++*/