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

Commit 29cdde31 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb1351: Rearrange register reads in determine_initial_state"

parents 6e629475 fedd910c
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
/* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2700,12 +2700,6 @@ static int smb1351_determine_initial_state(struct smb1351_charger *chip)
	if (reg & IRQ_COLD_SOFT_BIT)
		chip->batt_cool = true;

	rc = smb1351_read_reg(chip, IRQ_E_REG, &reg);
	if (rc) {
		pr_err("Couldn't read IRQ_E rc = %d\n", rc);
		goto fail_init_status;
	}

	/* check initial state of OTG */
	rc = smb1351_read_reg(chip, IRQ_F_REG, &reg);
	if (rc) {
@@ -2714,6 +2708,12 @@ static int smb1351_determine_initial_state(struct smb1351_charger *chip)
	}
	smb1351_rid_handler(chip, reg & IRQ_RID_BIT);

	rc = smb1351_read_reg(chip, IRQ_E_REG, &reg);
	if (rc) {
		pr_err("Couldn't read IRQ_E rc = %d\n", rc);
		goto fail_init_status;
	}

	if (reg & IRQ_USBIN_UV_BIT) {
		smb1351_usbin_uv_handler(chip, 1);
	} else {