xref: /openbmc/linux/Documentation/power/regulator/regulator.rst (revision 0898782247ae533d1f4e47a06bc5d4870931b284)
1*151f4e2bSMauro Carvalho Chehab==========================
2*151f4e2bSMauro Carvalho ChehabRegulator Driver Interface
3*151f4e2bSMauro Carvalho Chehab==========================
4*151f4e2bSMauro Carvalho Chehab
5*151f4e2bSMauro Carvalho ChehabThe regulator driver interface is relatively simple and designed to allow
6*151f4e2bSMauro Carvalho Chehabregulator drivers to register their services with the core framework.
7*151f4e2bSMauro Carvalho Chehab
8*151f4e2bSMauro Carvalho Chehab
9*151f4e2bSMauro Carvalho ChehabRegistration
10*151f4e2bSMauro Carvalho Chehab============
11*151f4e2bSMauro Carvalho Chehab
12*151f4e2bSMauro Carvalho ChehabDrivers can register a regulator by calling::
13*151f4e2bSMauro Carvalho Chehab
14*151f4e2bSMauro Carvalho Chehab  struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
15*151f4e2bSMauro Carvalho Chehab					   const struct regulator_config *config);
16*151f4e2bSMauro Carvalho Chehab
17*151f4e2bSMauro Carvalho ChehabThis will register the regulator's capabilities and operations to the regulator
18*151f4e2bSMauro Carvalho Chehabcore.
19*151f4e2bSMauro Carvalho Chehab
20*151f4e2bSMauro Carvalho ChehabRegulators can be unregistered by calling::
21*151f4e2bSMauro Carvalho Chehab
22*151f4e2bSMauro Carvalho Chehab  void regulator_unregister(struct regulator_dev *rdev);
23*151f4e2bSMauro Carvalho Chehab
24*151f4e2bSMauro Carvalho Chehab
25*151f4e2bSMauro Carvalho ChehabRegulator Events
26*151f4e2bSMauro Carvalho Chehab================
27*151f4e2bSMauro Carvalho Chehab
28*151f4e2bSMauro Carvalho ChehabRegulators can send events (e.g. overtemperature, undervoltage, etc) to
29*151f4e2bSMauro Carvalho Chehabconsumer drivers by calling::
30*151f4e2bSMauro Carvalho Chehab
31*151f4e2bSMauro Carvalho Chehab  int regulator_notifier_call_chain(struct regulator_dev *rdev,
32*151f4e2bSMauro Carvalho Chehab				    unsigned long event, void *data);
33