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

Commit 1ad669d2 authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: fix charger LED initialization



The default charger LED configuration is blink pattern '1'.
In case of software controlled charger LED configuration
the LED will start blinking unless userspace turns it off.

Initialize LED configuration as 'off' in case of software
controlled configuration.

CRs-Fixed: 840829
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
Change-Id: I7cc36e64ca3bdefccb37d206bfdc16c37da2614d
parent 2f0cac89
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -3572,16 +3572,20 @@ static void smbchg_regulator_deinit(struct smbchg_chip *chip)
#define CHG_LED_SHIFT		1
static int smbchg_chg_led_controls(struct smbchg_chip *chip)
{
	u8 reg;
	u8 reg, mask;
	int rc;

	if (chip->cfg_chg_led_sw_ctrl)
	if (chip->cfg_chg_led_sw_ctrl) {
		/* turn-off LED by default for software control */
		mask = CHG_LED_CTRL_BIT | LED_BLINKING_CFG_MASK;
		reg = LED_SW_CTRL_BIT;
	else
	} else {
		mask = CHG_LED_CTRL_BIT;
		reg = LED_CHG_CTRL_BIT;
	}

	rc = smbchg_masked_write(chip, chip->bat_if_base + CMD_CHG_LED_REG,
			CHG_LED_CTRL_BIT, reg);
			mask, reg);
	if (rc < 0)
		dev_err(chip->dev,
				"Couldn't write LED_CTRL_BIT rc=%d\n", rc);