xref: /OK3568_Linux_fs/kernel/include/linux/regulator/fixed.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * fixed.h
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright 2008 Wolfson Microelectronics PLC.
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * Copyright (c) 2009 Nokia Corporation
10*4882a593Smuzhiyun  * Roger Quadros <ext-roger.quadros@nokia.com>
11*4882a593Smuzhiyun  */
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #ifndef __REGULATOR_FIXED_H
14*4882a593Smuzhiyun #define __REGULATOR_FIXED_H
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun struct regulator_init_data;
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun /**
19*4882a593Smuzhiyun  * struct fixed_voltage_config - fixed_voltage_config structure
20*4882a593Smuzhiyun  * @supply_name:	Name of the regulator supply
21*4882a593Smuzhiyun  * @input_supply:	Name of the input regulator supply
22*4882a593Smuzhiyun  * @microvolts:		Output voltage of regulator
23*4882a593Smuzhiyun  * @startup_delay:	Start-up time in microseconds
24*4882a593Smuzhiyun  * @enabled_at_boot:	Whether regulator has been enabled at
25*4882a593Smuzhiyun  * 			boot or not. 1 = Yes, 0 = No
26*4882a593Smuzhiyun  * 			This is used to keep the regulator at
27*4882a593Smuzhiyun  * 			the default state
28*4882a593Smuzhiyun  * @init_data:		regulator_init_data
29*4882a593Smuzhiyun  *
30*4882a593Smuzhiyun  * This structure contains fixed voltage regulator configuration
31*4882a593Smuzhiyun  * information that must be passed by platform code to the fixed
32*4882a593Smuzhiyun  * voltage regulator driver.
33*4882a593Smuzhiyun  */
34*4882a593Smuzhiyun struct fixed_voltage_config {
35*4882a593Smuzhiyun 	const char *supply_name;
36*4882a593Smuzhiyun 	const char *input_supply;
37*4882a593Smuzhiyun 	int microvolts;
38*4882a593Smuzhiyun 	unsigned startup_delay;
39*4882a593Smuzhiyun 	unsigned int off_on_delay;
40*4882a593Smuzhiyun 	unsigned enabled_at_boot:1;
41*4882a593Smuzhiyun 	struct regulator_init_data *init_data;
42*4882a593Smuzhiyun };
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun struct regulator_consumer_supply;
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun #if IS_ENABLED(CONFIG_REGULATOR)
47*4882a593Smuzhiyun struct platform_device *regulator_register_always_on(int id, const char *name,
48*4882a593Smuzhiyun 		struct regulator_consumer_supply *supplies, int num_supplies, int uv);
49*4882a593Smuzhiyun #else
regulator_register_always_on(int id,const char * name,struct regulator_consumer_supply * supplies,int num_supplies,int uv)50*4882a593Smuzhiyun static inline struct platform_device *regulator_register_always_on(int id, const char *name,
51*4882a593Smuzhiyun 		struct regulator_consumer_supply *supplies, int num_supplies, int uv)
52*4882a593Smuzhiyun {
53*4882a593Smuzhiyun 	return NULL;
54*4882a593Smuzhiyun }
55*4882a593Smuzhiyun #endif
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun #define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
58*4882a593Smuzhiyun 						"fixed-dummy", s, ns, 0)
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun #endif
61