1
2
3
4
5
6
7
8
9
10 #ifndef __MFD_ALTERA_A10SR_H
11 #define __MFD_ALTERA_A10SR_H
12
13 #include <linux/completion.h>
14 #include <linux/list.h>
15 #include <linux/mfd/core.h>
16 #include <linux/regmap.h>
17 #include <linux/slab.h>
18
19
20 #define WRITE_REG_MASK 0xFE
21
22 #define READ_REG_MASK 0x01
23
24 #define ALTR_A10SR_BITS_PER_REGISTER 8
25
26
27
28
29
30 #define ALTR_A10SR_REG_OFFSET(X) (((X) / ALTR_A10SR_BITS_PER_REGISTER) << 1)
31 #define ALTR_A10SR_REG_BIT(X) ((X) % ALTR_A10SR_BITS_PER_REGISTER)
32 #define ALTR_A10SR_REG_BIT_CHG(X, Y) ((X) << ALTR_A10SR_REG_BIT(Y))
33 #define ALTR_A10SR_REG_BIT_MASK(X) (1 << ALTR_A10SR_REG_BIT(X))
34
35
36 #define ALTR_A10SR_NOP 0x00
37 #define ALTR_A10SR_VERSION_READ 0x00
38
39 #define ALTR_A10SR_LED_REG 0x02
40
41 #define ALTR_A10SR_LED_VALID_SHIFT 4
42 #define ALTR_A10SR_OUT_VALID_RANGE_LO ALTR_A10SR_LED_VALID_SHIFT
43 #define ALTR_A10SR_OUT_VALID_RANGE_HI 7
44
45 #define ALTR_A10SR_PBDSW_REG 0x04
46 #define ALTR_A10SR_PBDSW_IRQ_REG 0x06
47
48 #define ALTR_A10SR_IN_VALID_RANGE_LO 8
49 #define ALTR_A10SR_IN_VALID_RANGE_HI 15
50
51 #define ALTR_A10SR_PWR_GOOD1_REG 0x08
52 #define ALTR_A10SR_PWR_GOOD2_REG 0x0A
53 #define ALTR_A10SR_PWR_GOOD3_REG 0x0C
54 #define ALTR_A10SR_FMCAB_REG 0x0E
55 #define ALTR_A10SR_HPS_RST_REG 0x10
56 #define ALTR_A10SR_USB_QSPI_REG 0x12
57 #define ALTR_A10SR_SFPA_REG 0x14
58 #define ALTR_A10SR_SFPB_REG 0x16
59 #define ALTR_A10SR_I2C_M_REG 0x18
60 #define ALTR_A10SR_WARM_RST_REG 0x1A
61 #define ALTR_A10SR_WR_KEY_REG 0x1C
62 #define ALTR_A10SR_PMBUS_REG 0x1E
63
64
65
66
67
68
69 struct altr_a10sr {
70 struct device *dev;
71 struct regmap *regmap;
72 };
73
74 #endif