Skip to content

Commit

Permalink
mfd: Support for ICs compliant with max8998
Browse files Browse the repository at this point in the history
Signed-off-by: Lukasz Majewski <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Acked-by: Mark Brown <[email protected]>
Acked-by: Liam Girdwood <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
Lukasz Majewski authored and Samuel Ortiz committed Oct 28, 2010
1 parent 9d92492 commit 509bd47
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/mfd/max8998.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
max8998->dev = &i2c->dev;
max8998->i2c = i2c;
max8998->irq = i2c->irq;
max8998->type = id->driver_data;
if (pdata) {
max8998->ono = pdata->ono;
max8998->irq_base = pdata->irq_base;
Expand Down Expand Up @@ -169,8 +170,8 @@ static int max8998_i2c_remove(struct i2c_client *i2c)
}

static const struct i2c_device_id max8998_i2c_id[] = {
{ "max8998", 0 },
{ "lp3974", 0 },
{ "max8998", TYPE_MAX8998 },
{ "lp3974", TYPE_LP3974},
{ }
};
MODULE_DEVICE_TABLE(i2c, max8998_i2c_id);
Expand Down
11 changes: 11 additions & 0 deletions include/linux/mfd/max8998-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ enum {
MAX8998_IRQ_NR,
};

/* MAX8998 various variants */
enum {
TYPE_MAX8998 = 0, /* Default */
TYPE_LP3974, /* National version of MAX8998 */
TYPE_LP3979, /* Added AVS */
};

#define MAX8998_IRQ_DCINF_MASK (1 << 2)
#define MAX8998_IRQ_DCINR_MASK (1 << 3)
#define MAX8998_IRQ_JIGF_MASK (1 << 4)
Expand All @@ -123,6 +130,8 @@ enum {
#define MAX8998_IRQ_LOBAT1_MASK (1 << 0)
#define MAX8998_IRQ_LOBAT2_MASK (1 << 1)

#define MAX8998_ENRAMP (1 << 4)

/**
* struct max8998_dev - max8998 master device for sub-drivers
* @dev: master device of the chip (can be used to access platform data)
Expand All @@ -135,6 +144,7 @@ enum {
* @ono: power onoff IRQ number for max8998
* @irq_masks_cur: currently active value
* @irq_masks_cache: cached hardware value
* @type: indicate which max8998 "variant" is used
*/
struct max8998_dev {
struct device *dev;
Expand All @@ -148,6 +158,7 @@ struct max8998_dev {
int ono;
u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS];
u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS];
int type;
};

int max8998_irq_init(struct max8998_dev *max8998);
Expand Down

0 comments on commit 509bd47

Please sign in to comment.