blob: 936a7d8c11a927791aaa77e8694a4e9460d65f5b [file] [log] [blame]
Mark Brown48d335b2008-04-30 15:50:21 +01001/*
2 * fixed.h
3 *
4 * Copyright 2008 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
Roger Quadros86d98842009-08-06 19:37:29 +03008 * Copyright (c) 2009 Nokia Corporation
9 * Roger Quadros <ext-roger.quadros@nokia.com>
10 *
Mark Brown48d335b2008-04-30 15:50:21 +010011 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 */
16
17#ifndef __REGULATOR_FIXED_H
18#define __REGULATOR_FIXED_H
19
Mark Brownbcf34022009-01-19 13:37:04 +000020struct regulator_init_data;
21
Roger Quadros86d98842009-08-06 19:37:29 +030022/**
23 * struct fixed_voltage_config - fixed_voltage_config structure
24 * @supply_name: Name of the regulator supply
25 * @microvolts: Output voltage of regulator
26 * @gpio: GPIO to use for enable control
27 * set to -EINVAL if not used
Adrian Huntereda79a32010-01-12 12:25:13 +020028 * @startup_delay: Start-up time in microseconds
Roger Quadros86d98842009-08-06 19:37:29 +030029 * @enable_high: Polarity of enable GPIO
30 * 1 = Active high, 0 = Active low
31 * @enabled_at_boot: Whether regulator has been enabled at
32 * boot or not. 1 = Yes, 0 = No
33 * This is used to keep the regulator at
34 * the default state
35 * @init_data: regulator_init_data
36 *
37 * This structure contains fixed voltage regulator configuration
38 * information that must be passed by platform code to the fixed
39 * voltage regulator driver.
40 */
Mark Brown48d335b2008-04-30 15:50:21 +010041struct fixed_voltage_config {
42 const char *supply_name;
43 int microvolts;
Roger Quadros86d98842009-08-06 19:37:29 +030044 int gpio;
Adrian Huntereda79a32010-01-12 12:25:13 +020045 unsigned startup_delay;
Roger Quadros86d98842009-08-06 19:37:29 +030046 unsigned enable_high:1;
47 unsigned enabled_at_boot:1;
Mark Brownbcf34022009-01-19 13:37:04 +000048 struct regulator_init_data *init_data;
Mark Brown48d335b2008-04-30 15:50:21 +010049};
50
Sascha Hauer613330a2012-03-03 12:40:02 +010051struct regulator_consumer_supply;
52
53#if IS_ENABLED(CONFIG_REGULATOR)
54struct platform_device *regulator_register_fixed(int id,
55 struct regulator_consumer_supply *supplies, int num_supplies);
56#else
57static inline struct platform_device *regulator_register_fixed(int id,
58 struct regulator_consumer_supply *supplies, int num_supplies)
59{
60 return NULL;
61}
62#endif
63
Mark Brown48d335b2008-04-30 15:50:21 +010064#endif