mfd: palmas: Add irq_base support
Pradeep Goudagunta [Tue, 28 Aug 2012 19:23:36 +0000 (00:23 +0530)]
Add irq_base platform data and provided to regmap-irq
registration during initialization.

Bug 982704

Change-Id: Iec80f5946a40528f86b3d8a8c613f3ff7f67ed25
Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Reviewed-on: http://git-master/r/127944
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Tested-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/mfd/palmas.c
include/linux/mfd/palmas.h

index c4a69f1..51dd11c 100644 (file)
@@ -364,7 +364,7 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c,
        regmap_write(palmas->regmap[slave], addr, reg);
 
        ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq,
-                       IRQF_ONESHOT | IRQF_TRIGGER_LOW, -1, &palmas_irq_chip,
+                       IRQF_ONESHOT, pdata->irq_base, &palmas_irq_chip,
                        &palmas->irq_data);
        if (ret < 0)
                goto err;
index fb7ac18..670b124 100644 (file)
@@ -25,6 +25,8 @@
 struct palmas_pmic;
 struct palmas_rtc;
 
+#define palmas_rails(_name) "palmas_"#_name
+
 struct palmas {
        struct device *dev;
 
@@ -141,7 +143,7 @@ struct palmas_pmic_platform_data {
        /* An array of pointers to regulator init data indexed by regulator
         * ID
         */
-       struct regulator_init_data *reg_data[PALMAS_NUM_REGS];
+       struct regulator_init_data **reg_data;
 
        /* An array of pointers to structures containing sleep mode and DVS
         * configuration for regulators indexed by ID
@@ -156,6 +158,7 @@ struct palmas_pmic_platform_data {
 
 struct palmas_platform_data {
        int gpio_base;
+       int irq_base;
 
        /* bit value to be loaded to the POWER_CTRL register */
        u8 power_ctrl;