Commit | Line | Data |
---|---|---|
af873fce | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
14fa5691 LW |
2 | /* |
3 | * Copyright (C) 2007-2009 ST-Ericsson AB | |
fa661258 MW |
4 | * |
5 | * ABX500 core access functions. | |
0fd0013c | 6 | * The abx500 interface is used for the Analog Baseband chips. |
fa661258 MW |
7 | * |
8 | * Author: Mattias Wallin <mattias.wallin@stericsson.com> | |
9 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> | |
10 | * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com> | |
11 | * Author: Rickard Andersson <rickard.andersson@stericsson.com> | |
14fa5691 LW |
12 | */ |
13 | ||
d619bc14 | 14 | #include <linux/regulator/machine.h> |
14fa5691 | 15 | |
313162d0 PG |
16 | struct device; |
17 | ||
fa661258 MW |
18 | #ifndef MFD_ABX500_H |
19 | #define MFD_ABX500_H | |
14fa5691 | 20 | |
fa661258 MW |
21 | /** |
22 | * struct abx500_init_setting | |
23 | * Initial value of the registers for driver to use during setup. | |
24 | */ | |
25 | struct abx500_init_settings { | |
26 | u8 bank; | |
27 | u8 reg; | |
28 | u8 setting; | |
29 | }; | |
30 | ||
fa661258 MW |
31 | int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, |
32 | u8 value); | |
33 | int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg, | |
34 | u8 *value); | |
35 | int abx500_get_register_page_interruptible(struct device *dev, u8 bank, | |
36 | u8 first_reg, u8 *regvals, u8 numregs); | |
37 | int abx500_set_register_page_interruptible(struct device *dev, u8 bank, | |
38 | u8 first_reg, u8 *regvals, u8 numregs); | |
39 | /** | |
40 | * abx500_mask_and_set_register_inerruptible() - Modifies selected bits of a | |
41 | * target register | |
42 | * | |
43 | * @dev: The AB sub device. | |
44 | * @bank: The i2c bank number. | |
45 | * @bitmask: The bit mask to use. | |
46 | * @bitvalues: The new bit values. | |
47 | * | |
48 | * Updates the value of an AB register: | |
49 | * value -> ((value & ~bitmask) | (bitvalues & bitmask)) | |
50 | */ | |
51 | int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank, | |
52 | u8 reg, u8 bitmask, u8 bitvalues); | |
53 | int abx500_get_chip_id(struct device *dev); | |
54 | int abx500_event_registers_startup_state_get(struct device *dev, u8 *event); | |
55 | int abx500_startup_irq_enabled(struct device *dev, unsigned int irq); | |
56 | ||
57 | struct abx500_ops { | |
58 | int (*get_chip_id) (struct device *); | |
59 | int (*get_register) (struct device *, u8, u8, u8 *); | |
60 | int (*set_register) (struct device *, u8, u8, u8); | |
61 | int (*get_register_page) (struct device *, u8, u8, u8 *, u8); | |
62 | int (*set_register_page) (struct device *, u8, u8, u8 *, u8); | |
63 | int (*mask_and_set_register) (struct device *, u8, u8, u8, u8); | |
64 | int (*event_registers_startup_state_get) (struct device *, u8 *); | |
65 | int (*startup_irq_enabled) (struct device *, unsigned int); | |
e0f4fec0 | 66 | void (*dump_all_banks) (struct device *); |
fa661258 MW |
67 | }; |
68 | ||
69 | int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); | |
c6252e9c | 70 | void abx500_remove_ops(struct device *dev); |
14fa5691 | 71 | #endif |