| 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | #include <linux/regulator/consumer.h> |
| 4 | |
| 5 | #ifndef CONFIG_REGULATOR |
| 6 | |
| 7 | void rust_helper_regulator_put(struct regulator *regulator) |
| 8 | { |
| 9 | regulator_put(regulator); |
| 10 | } |
| 11 | |
| 12 | int rust_helper_regulator_set_voltage(struct regulator *regulator, int min_uV, |
| 13 | int max_uV) |
| 14 | { |
| 15 | return regulator_set_voltage(regulator, min_uV, max_uV); |
| 16 | } |
| 17 | |
| 18 | int rust_helper_regulator_get_voltage(struct regulator *regulator) |
| 19 | { |
| 20 | return regulator_get_voltage(regulator); |
| 21 | } |
| 22 | |
| 23 | struct regulator *rust_helper_regulator_get(struct device *dev, const char *id) |
| 24 | { |
| 25 | return regulator_get(dev, id); |
| 26 | } |
| 27 | |
| 28 | int rust_helper_regulator_enable(struct regulator *regulator) |
| 29 | { |
| 30 | return regulator_enable(regulator); |
| 31 | } |
| 32 | |
| 33 | int rust_helper_regulator_disable(struct regulator *regulator) |
| 34 | { |
| 35 | return regulator_disable(regulator); |
| 36 | } |
| 37 | |
| 38 | int rust_helper_regulator_is_enabled(struct regulator *regulator) |
| 39 | { |
| 40 | return regulator_is_enabled(regulator); |
| 41 | } |
| 42 | |
| 43 | int rust_helper_devm_regulator_get_enable(struct device *dev, const char *id) |
| 44 | { |
| 45 | return devm_regulator_get_enable(dev, id); |
| 46 | } |
| 47 | |
| 48 | int rust_helper_devm_regulator_get_enable_optional(struct device *dev, const char *id) |
| 49 | { |
| 50 | return devm_regulator_get_enable_optional(dev, id); |
| 51 | } |
| 52 | |
| 53 | #endif |
| 54 | |