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

Commit 6b55651c authored by Kiran Kumar's avatar Kiran Kumar Committed by Harshit Agarwal
Browse files

Optimize dash charging

Change-Id: Iac6ed5588109cc638af0d295a5bbda9447d390d6
parent f56fc65a
Loading
Loading
Loading
Loading
+31 −29
Original line number Diff line number Diff line
@@ -1278,12 +1278,12 @@ void op_adapter_init(struct op_adapter_chip *chip)

static void handle_dash_charge_current(struct fastchg_device_info *di)
{
	if (di->is_call_on) { // Normal call or Video call on
		dash_write_4bits(di, CURRENT_LIMIT_1);
		pr_err("CALLON:dash command sent %d for 2A\n", CURRENT_LIMIT_1);
	} else { // Non-call
	// Handle the charge current when LCD on
	if (di->is_lcd_on) {
			if (di->is_skin_thermal_high) {
		if (di->is_call_on) { // Normal call or Video call on
			dash_write_4bits(di, CURRENT_LIMIT_6);
			pr_err("CALLON:dash command sent %d for 6A\n", CURRENT_LIMIT_6);
		} else if (di->is_skin_thermal_high) {
			dash_write_4bits(di, CURRENT_LIMIT_1);
			pr_err("HIGH:dash command sent %d for 2A\n",
					CURRENT_LIMIT_1);
@@ -1296,12 +1296,15 @@ static void handle_dash_charge_current(struct fastchg_device_info *di)
			pr_err("MEDIUM:dash command sent %d for 4A\n",
					CURRENT_LIMIT_4);
		} else {
				dash_write_4bits(di, CURRENT_LIMIT_5);
				pr_err("NORMAL:dash command sent %d for 5A\n",
					CURRENT_LIMIT_5);
			dash_write_4bits(di, CURRENT_LIMIT_6);
			pr_err("NORMAL:dash command sent %d for 6A\n",
					CURRENT_LIMIT_6);
		}
		} else {
			if (di->is_skin_thermal_high) {
	} else { // Handle the charge current when LCD is off
		if (di->is_call_on) { // Normal call or Video call on
			dash_write_4bits(di, CURRENT_LIMIT_1);
			pr_err("CALLON:dash command sent %d for 2A\n", CURRENT_LIMIT_1);
		} else if (di->is_skin_thermal_high) {
			dash_write_4bits(di, CURRENT_LIMIT_2);
			pr_err("HIGH:dash command sent %d for 2.5A\n",
					CURRENT_LIMIT_2);
@@ -1316,7 +1319,6 @@ static void handle_dash_charge_current(struct fastchg_device_info *di)
		}
	}
}
}

static long  dash_dev_ioctl(struct file *filp, unsigned int cmd,
		unsigned long arg)