summaryrefstree
path: root/kernel/include/linux/mfd/muic_mfd.h
blob: 7e0f73254d6312a26069cb74e313c42529b94cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <linux/muic/muic.h>

#define MFD_MUIC_DEV_NAME "mfd-muic-universal"

enum max77849_irq {
	MUIC_MFD_IRQ,
	MUIC_MFD_IRQ_NR,
};

enum muic_mfd_irq_src {
	IRQ_SRC_MUIC	= 1 << 0,
	IRQ_SRC_SYS	= 1 << 1,
	IRQ_SRC_CHG	= 1 << 2,
	IRQ_SRC_FUEL	= 1 << 3,
	IRQ_SRC_NR,
};

enum muic_mfd_irq_grp {
	IRQ_GRP_MUIC  = 0,
	IRQ_GRP_SYS   = 1,
	IRQ_GRP_CHG   = 2,
	IRQ_GRP_FUEL  = 3,
	IRQ_GRP_NR,
};

struct muic_mfd_dev {
	struct device *dev;
	struct i2c_client *i2c;
	struct i2c_client *chg;
	struct i2c_client *fuel;
	struct i2c_client *muic;
	struct mutex i2c_lock;

	int type;

	int irq;
	int irq_base;
	int irq_gpio;
	bool wakeup;
	struct mutex irqlock;

	int irq_masks_cur[IRQ_GRP_NR];
	int irq_masks_cache[IRQ_GRP_NR];

	struct muic_mfd_platform_data *pdata;
};

struct muic_mfd_platform_data {
	/* IRQ */
	int irq_base;
	int irq_gpio;
	bool wakeup;
	struct muic_platform_data *muic_pdata;

#if 0
	sec_battery_platform_data_t *charger_data;
	sec_battery_platform_data_t *fuelgauge_data;
	int num_regulators;
	struct max77849_regulator_data *regulators;
#endif	

	struct mfd_cell *sub_devices;
	int num_subdevs;
};