regulator.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2014-2015 Samsung Electronics
  4. * Przemyslaw Marczak <p.marczak@samsung.com>
  5. */
  6. #ifndef _INCLUDE_REGULATOR_H_
  7. #define _INCLUDE_REGULATOR_H_
  8. /**
  9. * U-Boot Voltage/Current Regulator
  10. * ================================
  11. *
  12. * The regulator API is based on a driver model, with the device tree support.
  13. * And this header describes the functions and data types for the uclass id:
  14. * 'UCLASS_REGULATOR' and the regulator driver API.
  15. *
  16. * The regulator uclass - is based on uclass platform data which is allocated,
  17. * automatically for each regulator device on bind and 'dev->uclass_platdata'
  18. * points to it. The data type is: 'struct dm_regulator_uclass_platdata'.
  19. * The uclass file: 'drivers/power/regulator/regulator-uclass.c'
  20. *
  21. * The regulator device - is based on driver's model 'struct udevice'.
  22. * The API can use regulator name in two meanings:
  23. * - devname - the regulator device's name: 'dev->name'
  24. * - platname - the device's platdata's name. So in the code it looks like:
  25. * 'uc_pdata = dev->uclass_platdata'; 'name = uc_pdata->name'.
  26. *
  27. * The regulator device driver - provide an implementation of uclass operations
  28. * pointed by 'dev->driver->ops' as a struct of type 'struct dm_regulator_ops'.
  29. *
  30. * To proper bind the regulator device, the device tree node should provide
  31. * regulator constraints, like in the example below:
  32. *
  33. * ldo1 {
  34. * regulator-name = "VDD_MMC_1.8V"; (must be unique for proper bind)
  35. * regulator-min-microvolt = <1000000>; (optional)
  36. * regulator-max-microvolt = <1000000>; (optional)
  37. * regulator-min-microamp = <1000>; (optional)
  38. * regulator-max-microamp = <1000>; (optional)
  39. * regulator-always-on; (optional)
  40. * regulator-boot-on; (optional)
  41. * };
  42. *
  43. * Note: For the proper operation, at least name constraint is needed, since
  44. * it can be used when calling regulator_get_by_platname(). And the mandatory
  45. * rule for this name is, that it must be globally unique for the single dts.
  46. * If regulator-name property is not provided, node name will be chosen.
  47. *
  48. * Regulator bind:
  49. * For each regulator device, the device_bind() should be called with passed
  50. * device tree offset. This is required for this uclass's '.post_bind' method,
  51. * which does the scan on the device node, for the 'regulator-name' constraint.
  52. * If the parent is not a PMIC device, and the child is not bind by function:
  53. * 'pmic_bind_childs()', then it's recommended to bind the device by call to
  54. * dm_scan_fdt_dev() - this is usually done automatically for bus devices,
  55. * as a post bind method.
  56. *
  57. * Regulator get:
  58. * Having the device's name constraint, we can call regulator_by_platname(),
  59. * to find the required regulator. Before return, the regulator is probed,
  60. * and the rest of its constraints are put into the device's uclass platform
  61. * data, by the uclass regulator '.pre_probe' method.
  62. *
  63. * For more info about PMIC bind, please refer to file: 'include/power/pmic.h'
  64. *
  65. * Note:
  66. * Please do not use the device_bind_by_name() function, since it pass '-1' as
  67. * device node offset - and the bind will fail on uclass .post_bind method,
  68. * because of missing 'regulator-name' constraint.
  69. *
  70. *
  71. * Fixed Voltage/Current Regulator
  72. * ===============================
  73. *
  74. * When fixed voltage regulator is needed, then enable the config:
  75. * - CONFIG_DM_REGULATOR_FIXED
  76. *
  77. * The driver file: 'drivers/power/regulator/fixed.c', provides basic support
  78. * for control the GPIO, and return the device tree constraint values.
  79. *
  80. * To bind the fixed voltage regulator device, we usually use a 'simple-bus'
  81. * node as a parent. And 'regulator-fixed' for the driver compatible. This is
  82. * the same as in the kernel. The example node of fixed regulator:
  83. *
  84. * simple-bus {
  85. * compatible = "simple-bus";
  86. * #address-cells = <1>;
  87. * #size-cells = <0>;
  88. *
  89. * blue_led {
  90. * compatible = "regulator-fixed";
  91. * regulator-name = "VDD_LED_3.3V";
  92. * regulator-min-microvolt = <3300000>;
  93. * regulator-max-microvolt = <3300000>;
  94. * gpio = <&gpc1 0 GPIO_ACTIVE_LOW>;
  95. * };
  96. * };
  97. *
  98. * The fixed regulator devices also provide regulator uclass platform data. And
  99. * devices bound from such node, can use the regulator drivers API.
  100. */
  101. /* enum regulator_type - used for regulator_*() variant calls */
  102. enum regulator_type {
  103. REGULATOR_TYPE_LDO = 0,
  104. REGULATOR_TYPE_BUCK,
  105. REGULATOR_TYPE_DVS,
  106. REGULATOR_TYPE_FIXED,
  107. REGULATOR_TYPE_GPIO,
  108. REGULATOR_TYPE_OTHER,
  109. };
  110. /**
  111. * struct dm_regulator_mode - this structure holds an information about
  112. * each regulator operation mode. Probably in most cases - an array.
  113. * This will be probably a driver-static data, since it is device-specific.
  114. *
  115. * @id - a driver-specific mode id
  116. * @register_value - a driver-specific value for its mode id
  117. * @name - the name of mode - used for regulator command
  118. * Note:
  119. * The field 'id', should be always a positive number, since the negative values
  120. * are reserved for the errno numbers when returns the mode id.
  121. */
  122. struct dm_regulator_mode {
  123. int id; /* Set only as >= 0 (negative value is reserved for errno) */
  124. int register_value;
  125. const char *name;
  126. };
  127. enum regulator_flag {
  128. REGULATOR_FLAG_AUTOSET_UV = 1 << 0,
  129. REGULATOR_FLAG_AUTOSET_UA = 1 << 1,
  130. };
  131. /**
  132. * struct dm_regulator_uclass_platdata - pointed by dev->uclass_platdata, and
  133. * allocated on each regulator bind. This structure holds an information
  134. * about each regulator's constraints and supported operation modes.
  135. * There is no "step" voltage value - so driver should take care of this.
  136. *
  137. * @type - one of 'enum regulator_type'
  138. * @mode - pointer to the regulator mode (array if more than one)
  139. * @mode_count - number of '.mode' entries
  140. * @min_uV* - minimum voltage (micro Volts)
  141. * @max_uV* - maximum voltage (micro Volts)
  142. * @min_uA* - minimum amperage (micro Amps)
  143. * @max_uA* - maximum amperage (micro Amps)
  144. * @always_on* - bool type, true or false
  145. * @boot_on* - bool type, true or false
  146. * TODO(sjg@chromium.org): Consider putting the above two into @flags
  147. * @ramp_delay - Time to settle down after voltage change (unit: uV/us)
  148. * @flags: - flags value (see REGULATOR_FLAG_...)
  149. * @name** - fdt regulator name - should be taken from the device tree
  150. * ctrl_reg: - Control register offset used to enable/disable regulator
  151. * volt_reg: - register offset for writing voltage vsel values
  152. *
  153. * Note:
  154. * * - set automatically on device probe by the uclass's '.pre_probe' method.
  155. * ** - set automatically on device bind by the uclass's '.post_bind' method.
  156. * The constraints: type, mode, mode_count, can be set by device driver, e.g.
  157. * by the driver '.probe' method.
  158. */
  159. struct dm_regulator_uclass_platdata {
  160. enum regulator_type type;
  161. struct dm_regulator_mode *mode;
  162. int mode_count;
  163. int min_uV;
  164. int max_uV;
  165. int init_uV;
  166. int min_uA;
  167. int max_uA;
  168. unsigned int ramp_delay;
  169. bool always_on;
  170. bool boot_on;
  171. const char *name;
  172. int flags;
  173. u8 ctrl_reg;
  174. u8 volt_reg;
  175. bool suspend_on;
  176. u32 suspend_uV;
  177. };
  178. /* Regulator device operations */
  179. struct dm_regulator_ops {
  180. /**
  181. * The regulator output value function calls operates on a micro Volts.
  182. *
  183. * get/set_value - get/set output value of the given output number
  184. * @dev - regulator device
  185. * Sets:
  186. * @uV - set the output value [micro Volts]
  187. * @return output value [uV] on success or negative errno if fail.
  188. */
  189. int (*get_value)(struct udevice *dev);
  190. int (*set_value)(struct udevice *dev, int uV);
  191. /**
  192. * The regulator suspend output value function calls operates
  193. * on a micro Volts.
  194. *
  195. * get/set_suspen_value - get/set suspend mode output value
  196. * @dev - regulator device
  197. * Sets:
  198. * @uV - set the suspend output value [micro Volts]
  199. * @return output value [uV] on success or negative errno if fail.
  200. */
  201. int (*set_suspend_value)(struct udevice *dev, int uV);
  202. int (*get_suspend_value)(struct udevice *dev);
  203. /**
  204. * The regulator output current function calls operates on a micro Amps.
  205. *
  206. * get/set_current - get/set output current of the given output number
  207. * @dev - regulator device
  208. * Sets:
  209. * @uA - set the output current [micro Amps]
  210. * @return output value [uA] on success or negative errno if fail.
  211. */
  212. int (*get_current)(struct udevice *dev);
  213. int (*set_current)(struct udevice *dev, int uA);
  214. /**
  215. * The most basic feature of the regulator output is its enable state.
  216. *
  217. * get/set_enable - get/set enable state of the given output number
  218. * @dev - regulator device
  219. * Sets:
  220. * @enable - set true - enable or false - disable
  221. * @return true/false for get or -errno if fail; 0 / -errno for set.
  222. */
  223. int (*get_enable)(struct udevice *dev);
  224. int (*set_enable)(struct udevice *dev, bool enable);
  225. /**
  226. * The most basic feature of the regulator output is its enable state
  227. * in suspend mode.
  228. *
  229. * get/set_suspend_enable - get/set enable state of the suspend output
  230. * @dev - regulator device
  231. * Sets:
  232. * @enable - set true - enable or false - disable
  233. * @return true/false for get or -errno if fail; 0 / -errno for set.
  234. */
  235. int (*set_suspend_enable)(struct udevice *dev, bool enable);
  236. int (*get_suspend_enable)(struct udevice *dev);
  237. /**
  238. * The 'get/set_mode()' function calls should operate on a driver-
  239. * specific mode id definitions, which should be found in:
  240. * field 'id' of struct dm_regulator_mode.
  241. *
  242. * get/set_mode - get/set operation mode of the given output number
  243. * @dev - regulator device
  244. * Sets
  245. * @mode_id - set output mode id (struct dm_regulator_mode->id)
  246. * @return id/0 for get/set on success or negative errno if fail.
  247. * Note:
  248. * The field 'id' of struct type 'dm_regulator_mode', should be always
  249. * a positive number, since the negative is reserved for the error.
  250. */
  251. int (*get_mode)(struct udevice *dev);
  252. int (*set_mode)(struct udevice *dev, int mode_id);
  253. };
  254. #if CONFIG_IS_ENABLED(DM_REGULATOR)
  255. /**
  256. * regulator_mode: returns a pointer to the array of regulator mode info
  257. *
  258. * @dev - pointer to the regulator device
  259. * @modep - pointer to the returned mode info array
  260. * @return - count of modep entries on success or negative errno if fail.
  261. */
  262. int regulator_mode(struct udevice *dev, struct dm_regulator_mode **modep);
  263. /**
  264. * regulator_get_value: get microvoltage voltage value of a given regulator
  265. *
  266. * @dev - pointer to the regulator device
  267. * @return - positive output value [uV] on success or negative errno if fail.
  268. */
  269. int regulator_get_value(struct udevice *dev);
  270. /**
  271. * regulator_set_value: set the microvoltage value of a given regulator.
  272. *
  273. * @dev - pointer to the regulator device
  274. * @uV - the output value to set [micro Volts]
  275. * @return - 0 on success or -errno val if fails
  276. */
  277. int regulator_set_value(struct udevice *dev, int uV);
  278. /**
  279. * regulator_set_suspend_value: set the suspend microvoltage value of a given regulator.
  280. *
  281. * @dev - pointer to the regulator device
  282. * @uV - the output suspend value to set [micro Volts]
  283. * @return - 0 on success or -errno val if fails
  284. */
  285. int regulator_set_suspend_value(struct udevice *dev, int uV);
  286. /**
  287. * regulator_get_suspend_value: get the suspend microvoltage value of a given regulator.
  288. *
  289. * @dev - pointer to the regulator device
  290. * @return - positive output value [uV] on success or negative errno if fail.
  291. */
  292. int regulator_get_suspend_value(struct udevice *dev);
  293. /**
  294. * regulator_set_value_force: set the microvoltage value of a given regulator
  295. * without any min-,max condition check
  296. *
  297. * @dev - pointer to the regulator device
  298. * @uV - the output value to set [micro Volts]
  299. * @return - 0 on success or -errno val if fails
  300. */
  301. int regulator_set_value_force(struct udevice *dev, int uV);
  302. /**
  303. * regulator_get_current: get microampere value of a given regulator
  304. *
  305. * @dev - pointer to the regulator device
  306. * @return - positive output current [uA] on success or negative errno if fail.
  307. */
  308. int regulator_get_current(struct udevice *dev);
  309. /**
  310. * regulator_set_current: set the microampere value of a given regulator.
  311. *
  312. * @dev - pointer to the regulator device
  313. * @uA - set the output current [micro Amps]
  314. * @return - 0 on success or -errno val if fails
  315. */
  316. int regulator_set_current(struct udevice *dev, int uA);
  317. /**
  318. * regulator_get_enable: get regulator device enable state.
  319. *
  320. * @dev - pointer to the regulator device
  321. * @return - true/false of enable state or -errno val if fails
  322. */
  323. int regulator_get_enable(struct udevice *dev);
  324. /**
  325. * regulator_set_enable: set regulator enable state
  326. *
  327. * @dev - pointer to the regulator device
  328. * @enable - set true or false
  329. * @return - 0 on success or -errno val if fails
  330. */
  331. int regulator_set_enable(struct udevice *dev, bool enable);
  332. /**
  333. * regulator_set_enable_if_allowed: set regulator enable state if allowed by
  334. * regulator
  335. *
  336. * @dev - pointer to the regulator device
  337. * @enable - set true or false
  338. * @return - 0 on success or if enabling is not supported
  339. * -errno val if fails.
  340. */
  341. int regulator_set_enable_if_allowed(struct udevice *dev, bool enable);
  342. /**
  343. * regulator_set_suspend_enable: set regulator suspend enable state
  344. *
  345. * @dev - pointer to the regulator device
  346. * @enable - set true or false
  347. * @return - 0 on success or -errno val if fails
  348. */
  349. int regulator_set_suspend_enable(struct udevice *dev, bool enable);
  350. /**
  351. * regulator_get_suspend_enable: get regulator suspend enable state
  352. *
  353. * @dev - pointer to the regulator device
  354. * @return - true/false of enable state or -errno val if fails
  355. */
  356. int regulator_get_suspend_enable(struct udevice *dev);
  357. /**
  358. * regulator_get_mode: get active operation mode id of a given regulator
  359. *
  360. * @dev - pointer to the regulator device
  361. * @return - positive mode 'id' number on success or -errno val if fails
  362. * Note:
  363. * The device can provide an array of operating modes, which is type of struct
  364. * dm_regulator_mode. Each mode has it's own 'id', which should be unique inside
  365. * that array. By calling this function, the driver should return an active mode
  366. * id of the given regulator device.
  367. */
  368. int regulator_get_mode(struct udevice *dev);
  369. /**
  370. * regulator_set_mode: set the given regulator's, active mode id
  371. *
  372. * @dev - pointer to the regulator device
  373. * @mode_id - mode id to set ('id' field of struct type dm_regulator_mode)
  374. * @return - 0 on success or -errno value if fails
  375. * Note:
  376. * The device can provide an array of operating modes, which is type of struct
  377. * dm_regulator_mode. Each mode has it's own 'id', which should be unique inside
  378. * that array. By calling this function, the driver should set the active mode
  379. * of a given regulator to given by "mode_id" argument.
  380. */
  381. int regulator_set_mode(struct udevice *dev, int mode_id);
  382. /**
  383. * regulators_enable_boot_on() - enable regulators needed for boot
  384. *
  385. * This enables all regulators which are marked to be on at boot time. This
  386. * only works for regulators which don't have a range for voltage/current,
  387. * since in that case it is not possible to know which value to use.
  388. *
  389. * This effectively calls regulator_autoset() for every regulator.
  390. */
  391. int regulators_enable_boot_on(bool verbose);
  392. /**
  393. * regulator_autoset: setup the voltage/current on a regulator
  394. *
  395. * The setup depends on constraints found in device's uclass's platform data
  396. * (struct dm_regulator_uclass_platdata):
  397. *
  398. * - Enable - will set - if any of: 'always_on' or 'boot_on' is set to true,
  399. * or if both are unset, then the function returns
  400. * - Voltage value - will set - if '.min_uV' and '.max_uV' values are equal
  401. * - Current limit - will set - if '.min_uA' and '.max_uA' values are equal
  402. *
  403. * The function returns on the first-encountered error.
  404. *
  405. * @platname - expected string for dm_regulator_uclass_platdata .name field
  406. * @devp - returned pointer to the regulator device - if non-NULL passed
  407. * @return: 0 on success or negative value of errno.
  408. */
  409. int regulator_autoset(struct udevice *dev);
  410. /**
  411. * regulator_autoset_by_name: setup the regulator given by its uclass's
  412. * platform data name field. The setup depends on constraints found in device's
  413. * uclass's platform data (struct dm_regulator_uclass_platdata):
  414. * - Enable - will set - if any of: 'always_on' or 'boot_on' is set to true,
  415. * or if both are unset, then the function returns
  416. * - Voltage value - will set - if '.min_uV' and '.max_uV' values are equal
  417. * - Current limit - will set - if '.min_uA' and '.max_uA' values are equal
  418. *
  419. * The function returns on first encountered error.
  420. *
  421. * @platname - expected string for dm_regulator_uclass_platdata .name field
  422. * @devp - returned pointer to the regulator device - if non-NULL passed
  423. * @return: 0 on success or negative value of errno.
  424. *
  425. * The returned 'regulator' device can be used with:
  426. * - regulator_get/set_*
  427. */
  428. int regulator_autoset_by_name(const char *platname, struct udevice **devp);
  429. /**
  430. * regulator_list_autoset: setup the regulators given by list of their uclass's
  431. * platform data name field. The setup depends on constraints found in device's
  432. * uclass's platform data. The function loops with calls to:
  433. * regulator_autoset_by_name() for each name from the list.
  434. *
  435. * @list_platname - an array of expected strings for .name field of each
  436. * regulator's uclass platdata
  437. * @list_devp - an array of returned pointers to the successfully setup
  438. * regulator devices if non-NULL passed
  439. * @verbose - (true/false) print each regulator setup info, or be quiet
  440. * @return 0 on successfully setup of all list entries, otherwise first error.
  441. *
  442. * The returned 'regulator' devices can be used with:
  443. * - regulator_get/set_*
  444. *
  445. * Note: The list must ends with NULL entry, like in the "platname" list below:
  446. * char *my_regulators[] = {
  447. * "VCC_3.3V",
  448. * "VCC_1.8V",
  449. * NULL,
  450. * };
  451. */
  452. int regulator_list_autoset(const char *list_platname[],
  453. struct udevice *list_devp[],
  454. bool verbose);
  455. /**
  456. * regulator_get_by_devname: returns the pointer to the pmic regulator device.
  457. * Search by name, found in regulator device's name.
  458. *
  459. * @devname - expected string for 'dev->name' of regulator device
  460. * @devp - returned pointer to the regulator device
  461. * @return 0 on success or negative value of errno.
  462. *
  463. * The returned 'regulator' device is probed and can be used with:
  464. * - regulator_get/set_*
  465. */
  466. int regulator_get_by_devname(const char *devname, struct udevice **devp);
  467. /**
  468. * regulator_get_by_platname: returns the pointer to the pmic regulator device.
  469. * Search by name, found in regulator uclass platdata.
  470. *
  471. * @platname - expected string for uc_pdata->name of regulator uclass platdata
  472. * @devp - returns pointer to the regulator device or NULL on error
  473. * @return 0 on success or negative value of errno.
  474. *
  475. * The returned 'regulator' device is probed and can be used with:
  476. * - regulator_get/set_*
  477. */
  478. int regulator_get_by_platname(const char *platname, struct udevice **devp);
  479. /**
  480. * device_get_supply_regulator: returns the pointer to the supply regulator.
  481. * Search by phandle, found in device's node.
  482. *
  483. * Note: Please pay attention to proper order of device bind sequence.
  484. * The regulator device searched by the phandle, must be binded before
  485. * this function call.
  486. *
  487. * @dev - device with supply phandle
  488. * @supply_name - phandle name of regulator
  489. * @devp - returned pointer to the supply device
  490. * @return 0 on success or negative value of errno.
  491. */
  492. int device_get_supply_regulator(struct udevice *dev, const char *supply_name,
  493. struct udevice **devp);
  494. #else
  495. static inline int regulator_mode(struct udevice *dev, struct dm_regulator_mode **modep)
  496. {
  497. return -ENOSYS;
  498. }
  499. static inline int regulator_get_value(struct udevice *dev)
  500. {
  501. return -ENOSYS;
  502. }
  503. static inline int regulator_set_value(struct udevice *dev, int uV)
  504. {
  505. return -ENOSYS;
  506. }
  507. static inline int regulator_set_suspend_value(struct udevice *dev, int uV)
  508. {
  509. return -ENOSYS;
  510. }
  511. static inline int regulator_get_suspend_value(struct udevice *dev)
  512. {
  513. return -ENOSYS;
  514. }
  515. static inline int regulator_set_value_force(struct udevice *dev, int uV)
  516. {
  517. return -ENOSYS;
  518. }
  519. static inline int regulator_get_current(struct udevice *dev)
  520. {
  521. return -ENOSYS;
  522. }
  523. static inline int regulator_set_current(struct udevice *dev, int uA)
  524. {
  525. return -ENOSYS;
  526. }
  527. static inline int regulator_get_enable(struct udevice *dev)
  528. {
  529. return -ENOSYS;
  530. }
  531. static inline int regulator_set_enable(struct udevice *dev, bool enable)
  532. {
  533. return -ENOSYS;
  534. }
  535. static inline int regulator_set_enable_if_allowed(struct udevice *dev, bool enable)
  536. {
  537. return -ENOSYS;
  538. }
  539. static inline int regulator_set_suspend_enable(struct udevice *dev, bool enable)
  540. {
  541. return -ENOSYS;
  542. }
  543. static inline int regulator_get_suspend_enable(struct udevice *dev)
  544. {
  545. return -ENOSYS;
  546. }
  547. static inline int regulator_get_mode(struct udevice *dev)
  548. {
  549. return -ENOSYS;
  550. }
  551. static inline int regulator_set_mode(struct udevice *dev, int mode_id)
  552. {
  553. return -ENOSYS;
  554. }
  555. static inline int regulators_enable_boot_on(bool verbose)
  556. {
  557. return -ENOSYS;
  558. }
  559. static inline int regulator_autoset(struct udevice *dev)
  560. {
  561. return -ENOSYS;
  562. }
  563. static inline int regulator_autoset_by_name(const char *platname, struct udevice **devp)
  564. {
  565. return -ENOSYS;
  566. }
  567. static inline int regulator_list_autoset(const char *list_platname[], struct udevice *list_devp[],
  568. bool verbose)
  569. {
  570. return -ENOSYS;
  571. }
  572. static inline int regulator_get_by_devname(const char *devname, struct udevice **devp)
  573. {
  574. return -ENOSYS;
  575. }
  576. static inline int regulator_get_by_platname(const char *platname, struct udevice **devp)
  577. {
  578. return -ENOSYS;
  579. }
  580. static inline int device_get_supply_regulator(struct udevice *dev, const char *supply_name,
  581. struct udevice **devp)
  582. {
  583. return -ENOSYS;
  584. }
  585. #endif
  586. #endif /* _INCLUDE_REGULATOR_H_ */