hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/include/linux/regulator/consumer.h
....@@ -1,13 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * consumer.h -- SoC Regulator consumer support.
34 *
45 * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
56 *
67 * 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.
118 *
129 * Regulator Consumer Interface.
1310 *
....@@ -29,7 +26,6 @@
2926 * but this drops rapidly to 60% when below 100mA. Regulator r has > 90%
3027 * efficiency in IDLE mode at loads < 10mA. Thus regulator r will operate
3128 * in normal mode for loads > 10mA and in IDLE mode for load <= 10mA.
32
- *
3329 */
3430
3531 #ifndef __LINUX_REGULATOR_CONSUMER_H_
....@@ -295,6 +291,14 @@
295291 void *regulator_get_drvdata(struct regulator *regulator);
296292 void regulator_set_drvdata(struct regulator *regulator, void *data);
297293
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
+
298302 #else
299303
300304 /*
....@@ -323,6 +327,12 @@
323327
324328 static inline struct regulator *__must_check
325329 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)
326336 {
327337 return ERR_PTR(-ENODEV);
328338 }
....@@ -482,8 +492,18 @@
482492 return -EINVAL;
483493 }
484494
495
+static inline int regulator_sync_voltage(struct regulator *regulator)
496
+{
497
+ return -EINVAL;
498
+}
499
+
485500 static inline int regulator_is_supported_voltage(struct regulator *regulator,
486501 int min_uV, int max_uV)
502
+{
503
+ return 0;
504
+}
505
+
506
+static inline unsigned int regulator_get_linear_step(struct regulator *regulator)
487507 {
488508 return 0;
489509 }
....@@ -569,6 +589,25 @@
569589 return 0;
570590 }
571591
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
+
572611 static inline void *regulator_get_drvdata(struct regulator *regulator)
573612 {
574613 return NULL;
....@@ -589,6 +628,18 @@
589628 return -EINVAL;
590629 }
591630
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
+}
592643 #endif
593644
594645 static inline int regulator_set_voltage_triplet(struct regulator *regulator,