1
2
3
4
5
6
7
8
9
10
11 #ifndef __MFD_DA9063_CORE_H__
12 #define __MFD_DA9063_CORE_H__
13
14 #include <linux/interrupt.h>
15 #include <linux/mfd/da9063/registers.h>
16
17
18 #define DA9063_DRVNAME_CORE "da9063-core"
19 #define DA9063_DRVNAME_REGULATORS "da9063-regulators"
20 #define DA9063_DRVNAME_LEDS "da9063-leds"
21 #define DA9063_DRVNAME_WATCHDOG "da9063-watchdog"
22 #define DA9063_DRVNAME_HWMON "da9063-hwmon"
23 #define DA9063_DRVNAME_ONKEY "da9063-onkey"
24 #define DA9063_DRVNAME_RTC "da9063-rtc"
25 #define DA9063_DRVNAME_VIBRATION "da9063-vibration"
26
27 #define PMIC_CHIP_ID_DA9063 0x61
28
29 enum da9063_type {
30 PMIC_TYPE_DA9063 = 0,
31 PMIC_TYPE_DA9063L,
32 };
33
34 enum da9063_variant_codes {
35 PMIC_DA9063_AD = 0x3,
36 PMIC_DA9063_BB = 0x5,
37 PMIC_DA9063_CA = 0x6,
38 };
39
40
41 enum da9063_irqs {
42 DA9063_IRQ_ONKEY = 0,
43 DA9063_IRQ_ALARM,
44 DA9063_IRQ_TICK,
45 DA9063_IRQ_ADC_RDY,
46 DA9063_IRQ_SEQ_RDY,
47 DA9063_IRQ_WAKE,
48 DA9063_IRQ_TEMP,
49 DA9063_IRQ_COMP_1V2,
50 DA9063_IRQ_LDO_LIM,
51 DA9063_IRQ_REG_UVOV,
52 DA9063_IRQ_DVC_RDY,
53 DA9063_IRQ_VDD_MON,
54 DA9063_IRQ_WARN,
55 DA9063_IRQ_GPI0,
56 DA9063_IRQ_GPI1,
57 DA9063_IRQ_GPI2,
58 DA9063_IRQ_GPI3,
59 DA9063_IRQ_GPI4,
60 DA9063_IRQ_GPI5,
61 DA9063_IRQ_GPI6,
62 DA9063_IRQ_GPI7,
63 DA9063_IRQ_GPI8,
64 DA9063_IRQ_GPI9,
65 DA9063_IRQ_GPI10,
66 DA9063_IRQ_GPI11,
67 DA9063_IRQ_GPI12,
68 DA9063_IRQ_GPI13,
69 DA9063_IRQ_GPI14,
70 DA9063_IRQ_GPI15,
71 };
72
73 struct da9063 {
74
75 struct device *dev;
76 enum da9063_type type;
77 unsigned char variant_code;
78 unsigned int flags;
79
80
81 struct regmap *regmap;
82
83
84 int chip_irq;
85 unsigned int irq_base;
86 struct regmap_irq_chip_data *regmap_irq;
87 };
88
89 int da9063_device_init(struct da9063 *da9063, unsigned int irq);
90 int da9063_irq_init(struct da9063 *da9063);
91
92 #endif