mfd: pm8xxx-irq: set mask on suspend flag

The pm8xxx irq controller doesn't have wakeup source configuration bits.
It relies on managing wakeup interrupts in software. The generic irq code
supports managing wakeup interrupts if the irq_chip is defined with
IRQCHP_MASK_ON_SUSPEND.

Update the pm8xxx irq controller to use IRQCHIP_MASK_ON_SUSPEND.

For a chip that implements IRQCHP_MASK_ON_SUSPEND a mask callback
is a must. This callback will be called when the system goes to
suspend on all non-wakeup interrupts.

CRs-Fixed: 303137
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/drivers/mfd/pm8xxx-irq.c b/drivers/mfd/pm8xxx-irq.c
index 29b708d..a51235c 100644
--- a/drivers/mfd/pm8xxx-irq.c
+++ b/drivers/mfd/pm8xxx-irq.c
@@ -203,6 +203,21 @@
 	return IRQ_HANDLED;
 }
 
+static void pm8xxx_irq_mask(struct irq_data *d)
+{
+	struct pm_irq_chip *chip = irq_data_get_irq_chip_data(d);
+	unsigned int pmirq = d->irq - chip->irq_base;
+	int	master, irq_bit;
+	u8	block, config;
+
+	block = pmirq / 8;
+	master = block / 8;
+	irq_bit = pmirq % 8;
+
+	config = chip->config[pmirq] | PM_IRQF_MASK_ALL;
+	pm8xxx_write_config_irq(chip, block, config);
+}
+
 static void pm8xxx_irq_mask_ack(struct irq_data *d)
 {
 	struct pm_irq_chip *chip = irq_data_get_irq_chip_data(d);
@@ -281,6 +296,7 @@
 
 static struct irq_chip pm8xxx_irq_chip = {
 	.name		= "pm8xxx",
+	.irq_mask	= pm8xxx_irq_mask,
 	.irq_mask_ack	= pm8xxx_irq_mask_ack,
 	.irq_unmask	= pm8xxx_irq_unmask,
 	.irq_set_type	= pm8xxx_irq_set_type,