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

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

Merge "power: smb1360: add a property to select the stat pin irq configuration"

parents 89f07cdc 3ec99a5e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ Optional Properties:
- qcom,fg-voltage-empty-mv	The voltage which indicates the battery is empty.
- qcom,thermal-mitigation:	Array of input current limit values for different
				system thermal mitigation level.
- qcom,stat-pulsed-irq:		A boolean flag to indicate the state-irq pin will generate pulse
				signal when interrupt happened. If this property is not specified,
				the default configuration is static level irq.

Example:
	i2c@f9967000 {
+7 −1
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@ struct smb1360_chip {
	u8				revision;
	unsigned short			default_i2c_addr;
	unsigned short			fg_i2c_addr;
	bool				pulsed_irq;

	/* configuration data - charger */
	int				fake_battery_soc;
@@ -2223,7 +2224,10 @@ static int smb1360_hw_init(struct smb1360_chip *chip)
	if (chip->client->irq) {
		mask = CHG_STAT_IRQ_ONLY_BIT | CHG_STAT_ACTIVE_HIGH_BIT
						| CHG_STAT_DISABLE_BIT;
		if (!chip->pulsed_irq)
			reg = CHG_STAT_IRQ_ONLY_BIT;
		else
			reg = 0;
		rc = smb1360_masked_write(chip, CFG_STAT_CTRL_REG, mask, reg);
		if (rc < 0) {
			dev_err(chip->dev, "Couldn't set irq config rc = %d\n",
@@ -2304,6 +2308,8 @@ static int smb_parse_dt(struct smb1360_chip *chip)
		return -EINVAL;
	}

	chip->pulsed_irq = of_property_read_bool(node, "qcom,stat-pulsed-irq");

	rc = of_property_read_u32(node, "qcom,float-voltage-mv",
						&chip->vfloat_mv);
	if (rc < 0)