Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * fixed.h
0004  *
0005  * Copyright 2008 Wolfson Microelectronics PLC.
0006  *
0007  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
0008  *
0009  * Copyright (c) 2009 Nokia Corporation
0010  * Roger Quadros <ext-roger.quadros@nokia.com>
0011  */
0012 
0013 #ifndef __REGULATOR_FIXED_H
0014 #define __REGULATOR_FIXED_H
0015 
0016 struct regulator_init_data;
0017 
0018 /**
0019  * struct fixed_voltage_config - fixed_voltage_config structure
0020  * @supply_name:    Name of the regulator supply
0021  * @input_supply:   Name of the input regulator supply
0022  * @microvolts:     Output voltage of regulator
0023  * @startup_delay:  Start-up time in microseconds
0024  * @enabled_at_boot:    Whether regulator has been enabled at
0025  *          boot or not. 1 = Yes, 0 = No
0026  *          This is used to keep the regulator at
0027  *          the default state
0028  * @init_data:      regulator_init_data
0029  *
0030  * This structure contains fixed voltage regulator configuration
0031  * information that must be passed by platform code to the fixed
0032  * voltage regulator driver.
0033  */
0034 struct fixed_voltage_config {
0035     const char *supply_name;
0036     const char *input_supply;
0037     int microvolts;
0038     unsigned startup_delay;
0039     unsigned int off_on_delay;
0040     unsigned enabled_at_boot:1;
0041     struct regulator_init_data *init_data;
0042 };
0043 
0044 struct regulator_consumer_supply;
0045 
0046 #if IS_ENABLED(CONFIG_REGULATOR)
0047 struct platform_device *regulator_register_always_on(int id, const char *name,
0048         struct regulator_consumer_supply *supplies, int num_supplies, int uv);
0049 #else
0050 static inline struct platform_device *regulator_register_always_on(int id, const char *name,
0051         struct regulator_consumer_supply *supplies, int num_supplies, int uv)
0052 {
0053     return NULL;
0054 }
0055 #endif
0056 
0057 #define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
0058                         "fixed-dummy", s, ns, 0)
0059 
0060 #endif