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