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

Commit 4a2c9af6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb349-charger: Add a check to detect if the charger is present"

parents 370a47b2 b7017ac3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1194,6 +1194,7 @@ static int smb349_charger_probe(struct i2c_client *client,
	int rc, irq;
	struct smb349_charger *chip;
	struct power_supply *usb_psy;
	u8 reg = 0;

	usb_psy = power_supply_get_by_name("usb");
	if (!usb_psy) {
@@ -1211,6 +1212,13 @@ static int smb349_charger_probe(struct i2c_client *client,
	chip->dev = &client->dev;
	chip->usb_psy = usb_psy;

	/* probe the device to check if its actually connected */
	rc = smb349_read_reg(chip, CHG_OTH_CURRENT_CTRL_REG, &reg);
	if (rc) {
		pr_err("Failed to detect SMB349, device may be absent\n");
		return -ENODEV;
	}

	rc = smb_parse_dt(chip);
	if (rc) {
		dev_err(&client->dev, "Couldn't parse DT nodes rc=%d\n", rc);