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

Commit e9fc3417 authored by Nicholas Troast's avatar Nicholas Troast
Browse files

smb138x-charger: add handler for slave chg state change



Add an IRQ handler function that notifies when the slave charge state
changes.

Change-Id: I359ed08c5ad289ceeabd6fa8720a959c74b6bb5e
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent 45ad5727
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -108,6 +108,17 @@ module_param_named(
	debug_mask, __debug_mask, int, S_IRUSR | S_IWUSR
);

irqreturn_t smb138x_handle_slave_chg_state_change(int irq, void *data)
{
	struct smb_irq_data *irq_data = data;
	struct smb138x *chip = irq_data->parent_data;

	if (chip->parallel_psy)
		power_supply_changed(chip->parallel_psy);

	return IRQ_HANDLED;
}

static int smb138x_parse_dt(struct smb138x *chip)
{
	struct smb_charger *chg = &chip->chg;
@@ -989,7 +1000,8 @@ static const struct smb138x_irq_info smb138x_irqs[] = {
	},
	{
		.name		= "chg-state-change",
		.handler	= smblib_handle_debug,
		.handler	= smb138x_handle_slave_chg_state_change,
		.wake		= true,
	},
	{
		.name		= "step-chg-state-change",