summaryrefslogtreecommitdiff
path: root/include/linux/regulator/stub-regulator.h
blob: 1155d82ba27bf2cdc6fead908d8d115258470f64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __STUB_REGULATOR_H__
#define __STUB_REGULATOR_H__

#include <linux/regulator/machine.h>

#define STUB_REGULATOR_DRIVER_NAME "stub-regulator"

/**
 * struct stub_regulator_pdata - stub regulator device data
 * @init_data:		regulator constraints
 * @hpm_min_load:	minimum load in uA that will result in the regulator
 *			being set to high power mode
 * @system_uA:		current drawn from regulator not accounted for by any
 *			regulator framework consumer
 */
struct stub_regulator_pdata {
	struct regulator_init_data	init_data;
	int				hpm_min_load;
	int				system_uA;
};

#ifdef CONFIG_REGULATOR_STUB

/**
 * regulator_stub_init() - register platform driver for stub-regulator
 *
 * This initialization function should be called in systems in which driver
 * registration ordering must be controlled precisely.
 */

int __init regulator_stub_init(void);

#else

static inline int __init regulator_stub_init(void)
{
	return -ENODEV;
}

#endif /* CONFIG_REGULATOR_STUB */

#endif