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

Commit 4a440c5a authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb5: Modify WDOG SNARL IRQ enable/disable flow"

parents a5be1f74 e034d694
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -2591,11 +2591,16 @@ static int smb5_request_interrupts(struct smb5 *chip)
		chg->usb_icl_change_irq_enabled = true;

	/*
	 * Disable WDOG SNARL IRQ by default to prevent IRQ storm. If required
	 * for any application, enable it through votable.
	 * WDOG_SNARL_IRQ is required for SW Thermal Regulation WA only. In
	 * case the WA is not required, disable the WDOG_SNARL_IRQ to prevent
	 * interrupt storm.
	 */
	if (chg->irq_info[WDOG_SNARL_IRQ].irq)
		vote(chg->wdog_snarl_irq_en_votable, DEFAULT_VOTER, false, 0);

	if (chg->irq_info[WDOG_SNARL_IRQ].irq && !(chg->wa_flags &
						SW_THERM_REGULATION_WA)) {
		disable_irq_wake(chg->irq_info[WDOG_SNARL_IRQ].irq);
		disable_irq_nosync(chg->irq_info[WDOG_SNARL_IRQ].irq);
	}

	return rc;
}
+0 −35
Original line number Diff line number Diff line
@@ -1502,25 +1502,6 @@ static int smblib_usb_irq_enable_vote_callback(struct votable *votable,
	return 0;
}

static int smblib_wdog_snarl_irq_en_vote_callback(struct votable *votable,
				void *data, int enable, const char *client)
{
	struct smb_charger *chg = data;

	if (!chg->irq_info[WDOG_SNARL_IRQ].irq)
		return 0;

	if (enable) {
		enable_irq(chg->irq_info[WDOG_SNARL_IRQ].irq);
		enable_irq_wake(chg->irq_info[WDOG_SNARL_IRQ].irq);
	} else {
		disable_irq_wake(chg->irq_info[WDOG_SNARL_IRQ].irq);
		disable_irq_nosync(chg->irq_info[WDOG_SNARL_IRQ].irq);
	}

	return 0;
}

/*******************
 * VCONN REGULATOR *
 * *****************/
@@ -2383,8 +2364,6 @@ static int smblib_set_sw_thermal_regulation(struct smb_charger *chg,
			return rc;
		}

		vote(chg->wdog_snarl_irq_en_votable, SW_THERM_REGULATION_VOTER,
							true, 0);
		/*
		 * Schedule SW_THERM_REGULATION_WORK directly if USB input
		 * is suspended due to SW thermal regulation WA since WDOG
@@ -2397,8 +2376,6 @@ static int smblib_set_sw_thermal_regulation(struct smb_charger *chg,
			schedule_delayed_work(&chg->thermal_regulation_work, 0);
		}
	} else {
		vote(chg->wdog_snarl_irq_en_votable, SW_THERM_REGULATION_VOTER,
							false, 0);
		cancel_delayed_work_sync(&chg->thermal_regulation_work);
		vote(chg->awake_votable, SW_THERM_REGULATION_VOTER, false, 0);
	}
@@ -5822,16 +5799,6 @@ static int smblib_create_votables(struct smb_charger *chg)
		return rc;
	}

	chg->wdog_snarl_irq_en_votable = create_votable("SNARL_WDOG_IRQ_ENABLE",
					VOTE_SET_ANY,
					smblib_wdog_snarl_irq_en_vote_callback,
					chg);
	if (IS_ERR(chg->wdog_snarl_irq_en_votable)) {
		rc = PTR_ERR(chg->wdog_snarl_irq_en_votable);
		chg->wdog_snarl_irq_en_votable = NULL;
		return rc;
	}

	return rc;
}

@@ -5845,8 +5812,6 @@ static void smblib_destroy_votables(struct smb_charger *chg)
		destroy_votable(chg->awake_votable);
	if (chg->chg_disable_votable)
		destroy_votable(chg->chg_disable_votable);
	if (chg->wdog_snarl_irq_en_votable)
		destroy_votable(chg->wdog_snarl_irq_en_votable);
}

static void smblib_iio_deinit(struct smb_charger *chg)
+0 −1
Original line number Diff line number Diff line
@@ -372,7 +372,6 @@ struct smb_charger {
	struct votable		*pl_enable_votable_indirect;
	struct votable		*usb_irq_enable_votable;
	struct votable		*cp_disable_votable;
	struct votable		*wdog_snarl_irq_en_votable;
	struct votable		*smb_override_votable;

	/* work */