aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/max8998.c5
-rw-r--r--include/linux/mfd/max8998-private.h11
2 files changed, 14 insertions, 2 deletions
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index 310fd8054f35..a720f412cd15 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -133,6 +133,7 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
133 max8998->dev = &i2c->dev; 133 max8998->dev = &i2c->dev;
134 max8998->i2c = i2c; 134 max8998->i2c = i2c;
135 max8998->irq = i2c->irq; 135 max8998->irq = i2c->irq;
136 max8998->type = id->driver_data;
136 if (pdata) { 137 if (pdata) {
137 max8998->ono = pdata->ono; 138 max8998->ono = pdata->ono;
138 max8998->irq_base = pdata->irq_base; 139 max8998->irq_base = pdata->irq_base;
@@ -169,8 +170,8 @@ static int max8998_i2c_remove(struct i2c_client *i2c)
169} 170}
170 171
171static const struct i2c_device_id max8998_i2c_id[] = { 172static const struct i2c_device_id max8998_i2c_id[] = {
172 { "max8998", 0 }, 173 { "max8998", TYPE_MAX8998 },
173 { "lp3974", 0 }, 174 { "lp3974", TYPE_LP3974},
174 { } 175 { }
175}; 176};
176MODULE_DEVICE_TABLE(i2c, max8998_i2c_id); 177MODULE_DEVICE_TABLE(i2c, max8998_i2c_id);
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h
index 170f665c7cdd..0ff42116d5dd 100644
--- a/include/linux/mfd/max8998-private.h
+++ b/include/linux/mfd/max8998-private.h
@@ -101,6 +101,13 @@ enum {
101 MAX8998_IRQ_NR, 101 MAX8998_IRQ_NR,
102}; 102};
103 103
104/* MAX8998 various variants */
105enum {
106 TYPE_MAX8998 = 0, /* Default */
107 TYPE_LP3974, /* National version of MAX8998 */
108 TYPE_LP3979, /* Added AVS */
109};
110
104#define MAX8998_IRQ_DCINF_MASK (1 << 2) 111#define MAX8998_IRQ_DCINF_MASK (1 << 2)
105#define MAX8998_IRQ_DCINR_MASK (1 << 3) 112#define MAX8998_IRQ_DCINR_MASK (1 << 3)
106#define MAX8998_IRQ_JIGF_MASK (1 << 4) 113#define MAX8998_IRQ_JIGF_MASK (1 << 4)
@@ -123,6 +130,8 @@ enum {
123#define MAX8998_IRQ_LOBAT1_MASK (1 << 0) 130#define MAX8998_IRQ_LOBAT1_MASK (1 << 0)
124#define MAX8998_IRQ_LOBAT2_MASK (1 << 1) 131#define MAX8998_IRQ_LOBAT2_MASK (1 << 1)
125 132
133#define MAX8998_ENRAMP (1 << 4)
134
126/** 135/**
127 * struct max8998_dev - max8998 master device for sub-drivers 136 * struct max8998_dev - max8998 master device for sub-drivers
128 * @dev: master device of the chip (can be used to access platform data) 137 * @dev: master device of the chip (can be used to access platform data)
@@ -135,6 +144,7 @@ enum {
135 * @ono: power onoff IRQ number for max8998 144 * @ono: power onoff IRQ number for max8998
136 * @irq_masks_cur: currently active value 145 * @irq_masks_cur: currently active value
137 * @irq_masks_cache: cached hardware value 146 * @irq_masks_cache: cached hardware value
147 * @type: indicate which max8998 "variant" is used
138 */ 148 */
139struct max8998_dev { 149struct max8998_dev {
140 struct device *dev; 150 struct device *dev;
@@ -148,6 +158,7 @@ struct max8998_dev {
148 int ono; 158 int ono;
149 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; 159 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS];
150 u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; 160 u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS];
161 int type;
151}; 162};
152 163
153int max8998_irq_init(struct max8998_dev *max8998); 164int max8998_irq_init(struct max8998_dev *max8998);