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

Commit b8e406bf authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: use correct bit definitions for uv and ov



Currently, smbcharger driver checks the register for values (0x0, 0x01)
instead of the bit positions corresponding to them for uv (undervolt)
and ov(overvolt) conditions.

The effect of this error is benign until now since the code ended up
checking 0x1 = BIT(0) which is the uv case. Almost all the time
when a charger is not present the uv condition is set. Rarely does
a charger goes ov.

But nevertheless, fix the issue.

Change-Id: I8a4117fb9d483e9937a47df624c8792e03f44f1f
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 3f821f8b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -471,8 +471,8 @@ static enum pwr_path_type smbchg_get_pwr_path(struct smbchg_chip *chip)
#define IDEV_STS			0x8
#define RT_STS				0x10
#define USBID_MSB			0xE
#define USBIN_UV_BIT			0x0
#define USBIN_OV_BIT			0x1
#define USBIN_UV_BIT			BIT(0)
#define USBIN_OV_BIT			BIT(1)
#define FMB_STS_MASK			SMB_MASK(3, 0)
#define USBID_GND_THRESHOLD		0x495
static bool is_otg_present(struct smbchg_chip *chip)
@@ -530,8 +530,8 @@ static bool is_otg_present(struct smbchg_chip *chip)
#define DCIN_UNREG			BIT(1)
#define DCIN_LV				BIT(0)
#define INPUT_STS			0x0D
#define DCIN_UV_BIT			0x0
#define DCIN_OV_BIT			0x1
#define DCIN_UV_BIT			BIT(0)
#define DCIN_OV_BIT			BIT(1)
static bool is_dc_present(struct smbchg_chip *chip)
{
	int rc;