blob: 99c68ab4c0d9b14db6cc0c9b87b6ffdc44cd87bd [file] [log] [blame]
Mark Brown0cdfcc02013-09-11 13:15:40 +01001/*
2 * internal.h -- Voltage/Current Regulator framework internal code
3 *
4 * Copyright 2007, 2008 Wolfson Microelectronics PLC.
5 * Copyright 2008 SlimLogic Ltd.
6 *
7 * Author: Liam Girdwood <lrg@slimlogic.co.uk>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifndef __REGULATOR_INTERNAL_H
17#define __REGULATOR_INTERNAL_H
18
19/*
20 * struct regulator
21 *
22 * One for each consumer device.
23 */
24struct regulator {
25 struct device *dev;
26 struct list_head list;
27 unsigned int always_on:1;
28 unsigned int bypass:1;
29 int uA_load;
30 int min_uV;
31 int max_uV;
David Collinscea41352017-01-10 17:34:21 -080032 int enabled;
Mark Brown0cdfcc02013-09-11 13:15:40 +010033 char *supply_name;
34 struct device_attribute dev_attr;
35 struct regulator_dev *rdev;
36 struct dentry *debugfs;
37};
38
Mark Brownef126a42014-09-10 15:17:01 +010039#ifdef CONFIG_OF
Mark Browna0c7b162014-09-09 23:13:57 +010040struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
41 const struct regulator_desc *desc,
Krzysztof Kozlowskibfa21a02015-01-05 12:48:42 +010042 struct regulator_config *config,
Mark Browna0c7b162014-09-09 23:13:57 +010043 struct device_node **node);
Mark Brownef126a42014-09-10 15:17:01 +010044#else
45static inline struct regulator_init_data *
46regulator_of_get_init_data(struct device *dev,
47 const struct regulator_desc *desc,
Krzysztof Kozlowskibfa21a02015-01-05 12:48:42 +010048 struct regulator_config *config,
Mark Brownef126a42014-09-10 15:17:01 +010049 struct device_node **node)
50{
51 return NULL;
52}
53#endif
Mark Browna0c7b162014-09-09 23:13:57 +010054
Mark Brown0cdfcc02013-09-11 13:15:40 +010055#endif