.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * consumer.h -- SoC Regulator consumer support. |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC. |
---|
5 | 6 | * |
---|
6 | 7 | * Author: Liam Girdwood <lrg@slimlogic.co.uk> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | 8 | * |
---|
12 | 9 | * Regulator Consumer Interface. |
---|
13 | 10 | * |
---|
.. | .. |
---|
29 | 26 | * but this drops rapidly to 60% when below 100mA. Regulator r has > 90% |
---|
30 | 27 | * efficiency in IDLE mode at loads < 10mA. Thus regulator r will operate |
---|
31 | 28 | * in normal mode for loads > 10mA and in IDLE mode for load <= 10mA. |
---|
32 | | - * |
---|
33 | 29 | */ |
---|
34 | 30 | |
---|
35 | 31 | #ifndef __LINUX_REGULATOR_CONSUMER_H_ |
---|
.. | .. |
---|
295 | 291 | void *regulator_get_drvdata(struct regulator *regulator); |
---|
296 | 292 | void regulator_set_drvdata(struct regulator *regulator, void *data); |
---|
297 | 293 | |
---|
| 294 | +/* misc helpers */ |
---|
| 295 | + |
---|
| 296 | +void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers, |
---|
| 297 | + const char *const *supply_names, |
---|
| 298 | + unsigned int num_supplies); |
---|
| 299 | + |
---|
| 300 | +bool regulator_is_equal(struct regulator *reg1, struct regulator *reg2); |
---|
| 301 | + |
---|
298 | 302 | #else |
---|
299 | 303 | |
---|
300 | 304 | /* |
---|
.. | .. |
---|
323 | 327 | |
---|
324 | 328 | static inline struct regulator *__must_check |
---|
325 | 329 | regulator_get_exclusive(struct device *dev, const char *id) |
---|
| 330 | +{ |
---|
| 331 | + return ERR_PTR(-ENODEV); |
---|
| 332 | +} |
---|
| 333 | + |
---|
| 334 | +static inline struct regulator *__must_check |
---|
| 335 | +devm_regulator_get_exclusive(struct device *dev, const char *id) |
---|
326 | 336 | { |
---|
327 | 337 | return ERR_PTR(-ENODEV); |
---|
328 | 338 | } |
---|
.. | .. |
---|
482 | 492 | return -EINVAL; |
---|
483 | 493 | } |
---|
484 | 494 | |
---|
| 495 | +static inline int regulator_sync_voltage(struct regulator *regulator) |
---|
| 496 | +{ |
---|
| 497 | + return -EINVAL; |
---|
| 498 | +} |
---|
| 499 | + |
---|
485 | 500 | static inline int regulator_is_supported_voltage(struct regulator *regulator, |
---|
486 | 501 | int min_uV, int max_uV) |
---|
| 502 | +{ |
---|
| 503 | + return 0; |
---|
| 504 | +} |
---|
| 505 | + |
---|
| 506 | +static inline unsigned int regulator_get_linear_step(struct regulator *regulator) |
---|
487 | 507 | { |
---|
488 | 508 | return 0; |
---|
489 | 509 | } |
---|
.. | .. |
---|
569 | 589 | return 0; |
---|
570 | 590 | } |
---|
571 | 591 | |
---|
| 592 | +static inline int regulator_suspend_enable(struct regulator_dev *rdev, |
---|
| 593 | + suspend_state_t state) |
---|
| 594 | +{ |
---|
| 595 | + return -EINVAL; |
---|
| 596 | +} |
---|
| 597 | + |
---|
| 598 | +static inline int regulator_suspend_disable(struct regulator_dev *rdev, |
---|
| 599 | + suspend_state_t state) |
---|
| 600 | +{ |
---|
| 601 | + return -EINVAL; |
---|
| 602 | +} |
---|
| 603 | + |
---|
| 604 | +static inline int regulator_set_suspend_voltage(struct regulator *regulator, |
---|
| 605 | + int min_uV, int max_uV, |
---|
| 606 | + suspend_state_t state) |
---|
| 607 | +{ |
---|
| 608 | + return -EINVAL; |
---|
| 609 | +} |
---|
| 610 | + |
---|
572 | 611 | static inline void *regulator_get_drvdata(struct regulator *regulator) |
---|
573 | 612 | { |
---|
574 | 613 | return NULL; |
---|
.. | .. |
---|
589 | 628 | return -EINVAL; |
---|
590 | 629 | } |
---|
591 | 630 | |
---|
| 631 | +static inline void |
---|
| 632 | +regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers, |
---|
| 633 | + const char *const *supply_names, |
---|
| 634 | + unsigned int num_supplies) |
---|
| 635 | +{ |
---|
| 636 | +} |
---|
| 637 | + |
---|
| 638 | +static inline bool |
---|
| 639 | +regulator_is_equal(struct regulator *reg1, struct regulator *reg2) |
---|
| 640 | +{ |
---|
| 641 | + return false; |
---|
| 642 | +} |
---|
592 | 643 | #endif |
---|
593 | 644 | |
---|
594 | 645 | static inline int regulator_set_voltage_triplet(struct regulator *regulator, |
---|