regulator: fixed: Support for open drain gpio pin
[deliverable/linux.git] / include / linux / regulator / fixed.h
CommitLineData
48d335ba
MB
1/*
2 * fixed.h
3 *
4 * Copyright 2008 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
86d9884b
RQ
8 * Copyright (c) 2009 Nokia Corporation
9 * Roger Quadros <ext-roger.quadros@nokia.com>
10 *
48d335ba
MB
11 * 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
bcf3402c
MB
20struct regulator_init_data;
21
86d9884b
RQ
22/**
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
eda79a30 28 * @startup_delay: Start-up time in microseconds
a4d9f179
LD
29 * @gpio_is_open_drain: Gpio pin is open drain or normal type.
30 * If it is open drain type then HIGH will be set
31 * through PULL-UP with setting gpio as input
32 * and low will be set as gpio-output with driven
33 * to low. For non-open-drain case, the gpio will
34 * will be in output and drive to low/high accordingly.
86d9884b
RQ
35 * @enable_high: Polarity of enable GPIO
36 * 1 = Active high, 0 = Active low
37 * @enabled_at_boot: Whether regulator has been enabled at
38 * boot or not. 1 = Yes, 0 = No
39 * This is used to keep the regulator at
40 * the default state
41 * @init_data: regulator_init_data
42 *
43 * This structure contains fixed voltage regulator configuration
44 * information that must be passed by platform code to the fixed
45 * voltage regulator driver.
46 */
48d335ba
MB
47struct fixed_voltage_config {
48 const char *supply_name;
49 int microvolts;
86d9884b 50 int gpio;
eda79a30 51 unsigned startup_delay;
a4d9f179 52 unsigned gpio_is_open_drain:1;
86d9884b
RQ
53 unsigned enable_high:1;
54 unsigned enabled_at_boot:1;
bcf3402c 55 struct regulator_init_data *init_data;
48d335ba
MB
56};
57
613330a0
SH
58struct regulator_consumer_supply;
59
60#if IS_ENABLED(CONFIG_REGULATOR)
61struct platform_device *regulator_register_fixed(int id,
62 struct regulator_consumer_supply *supplies, int num_supplies);
63#else
64static inline struct platform_device *regulator_register_fixed(int id,
65 struct regulator_consumer_supply *supplies, int num_supplies)
66{
67 return NULL;
68}
69#endif
70
48d335ba 71#endif
This page took 1.114038 seconds and 5 git commands to generate.