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

Commit a4a55f48 authored by Nauval Rizky's avatar Nauval Rizky Committed by Pranav Vashi
Browse files

power: supply: smb5: Properly opt-out from s/w based health reporting



Since we're either using bq2597x or ln8000, get_prop will always throw a
POWER_SUPPLY_HEALTH_UNKNOWN and then power_supply_show_property log it
as failed to report.
Instead of reporting unknown health and spamming log buffer, tell
userspace that there's no data for it.

Change-Id: Iebd346dfb235b132802d0f43956cd3d361d91c42
Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
parent e116151f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2157,6 +2157,10 @@ static int smb5_usb_main_get_prop(struct power_supply *psy,
		break;
	/* Use this property to report SMB health */
	case POWER_SUPPLY_PROP_HEALTH:
		if (chg->use_bq_pump) {
			rc = val->intval = -ENODATA;
			break;
		}
		rc = val->intval = smblib_get_prop_smb_health(chg);
		break;
	/* Use this property to report overheat status */