diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-05-23 18:44:47 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-05-23 18:44:45 -0700 |
| commit | 01008184eca238948eea88d4044cebefd0d30205 (patch) | |
| tree | 1614f9fe604697c73c0cb25753a60590ab8d595f | |
| parent | d0d5319fd6d72f1b4382e8d4276a6aad2b74b300 (diff) | |
| parent | 9401b69e1d1ea89dc850418294d9994b7f9ab7f0 (diff) | |
Merge "spmi: pmic-arb: support updating interrupt type flags"
| -rw-r--r-- | drivers/spmi/spmi-pmic-arb.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index d3130cfd6433..4e4b39c26e89 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -691,19 +691,26 @@ static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type) if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { type.type |= bit_mask_irq; if (flow_type & IRQF_TRIGGER_RISING) - type.polarity_high |= bit_mask_irq; + 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; + 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) - type.polarity_high |= bit_mask_irq; - else - type.polarity_low |= bit_mask_irq; + if (flow_type & IRQF_TRIGGER_HIGH) { + type.polarity_high |= bit_mask_irq; + 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)); |
