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

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

Merge "spmi: pmic-arb: support updating interrupt type flags"

parents 9469df76 e96f27c2
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -686,18 +686,25 @@ static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type)
		type.type |= bit_mask_irq;
		if (flow_type & IRQF_TRIGGER_RISING)
			type.polarity_high |=  bit_mask_irq;
		else
			type.polarity_high &= ~bit_mask_irq;
		if (flow_type & IRQF_TRIGGER_FALLING)
			type.polarity_low  |=  bit_mask_irq;
		else
			type.polarity_low  &= ~bit_mask_irq;
	} else {
		if ((flow_type & (IRQF_TRIGGER_HIGH)) &&
		    (flow_type & (IRQF_TRIGGER_LOW)))
			return -EINVAL;

		type.type &= ~bit_mask_irq; /* level trig */
		if (flow_type & IRQF_TRIGGER_HIGH)
		if (flow_type & IRQF_TRIGGER_HIGH) {
			type.polarity_high |=  bit_mask_irq;
		else
			type.polarity_low  &= ~bit_mask_irq;
		} else {
			type.polarity_low  |=  bit_mask_irq;
			type.polarity_high &= ~bit_mask_irq;
		}
	}

	qpnpint_spmi_write(d, QPNPINT_REG_SET_TYPE, &type, sizeof(type));