xref: /OK3568_Linux_fs/kernel/Documentation/power/regulator/regulator.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun==========================
2*4882a593SmuzhiyunRegulator Driver Interface
3*4882a593Smuzhiyun==========================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunThe regulator driver interface is relatively simple and designed to allow
6*4882a593Smuzhiyunregulator drivers to register their services with the core framework.
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunRegistration
10*4882a593Smuzhiyun============
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunDrivers can register a regulator by calling::
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun  struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
15*4882a593Smuzhiyun					   const struct regulator_config *config);
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunThis will register the regulator's capabilities and operations to the regulator
18*4882a593Smuzhiyuncore.
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunRegulators can be unregistered by calling::
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun  void regulator_unregister(struct regulator_dev *rdev);
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunRegulator Events
26*4882a593Smuzhiyun================
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunRegulators can send events (e.g. overtemperature, undervoltage, etc) to
29*4882a593Smuzhiyunconsumer drivers by calling::
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun  int regulator_notifier_call_chain(struct regulator_dev *rdev,
32*4882a593Smuzhiyun				    unsigned long event, void *data);
33