Files
Linux/include/linux/regulator/fixed.h
T
Linus Walleij 01dc79cd6f regulator: fixed/gpio: Pull inversion/OD into gpiolib
This pushes the handling of inversion semantics and open drain
settings to the GPIO descriptor and gpiolib. All affected board
files are also augmented.

This is especially nice since we don't have to have any
confusing flags passed around to the left and right littering
the fixed and GPIO regulator drivers and the regulator core.
It is all just very straight-forward: the core asks the GPIO
line to be asserted or deasserted and gpiolib deals with the
rest depending on how the platform is configured: if the line
is active low, it deals with that, if the line is open drain,
it deals with that too.

Cc: Alexander Shiyan <[email protected]> # i.MX boards user
Cc: Haojian Zhuang <[email protected]> # MMP2 maintainer
Cc: Aaro Koskinen <[email protected]> # OMAP1 maintainer
Cc: Tony Lindgren <[email protected]> # OMAP1,2,3 maintainer
Cc: Mike Rapoport <[email protected]> # EM-X270 maintainer
Cc: Robert Jarzmik <[email protected]> # EZX maintainer
Cc: Philipp Zabel <[email protected]> # Magician maintainer
Cc: Petr Cvek <[email protected]> # Magician
Cc: Robert Jarzmik <[email protected]> # PXA
Cc: Paul Parsons <[email protected]> # hx4700
Cc: Daniel Mack <[email protected]> # Raumfeld maintainer
Cc: Marc Zyngier <[email protected]> # Zeus maintainer
Cc: Geert Uytterhoeven <[email protected]> # SuperH pinctrl/GPIO maintainer
Cc: Russell King <[email protected]> # SA1100
Tested-by: Marek Szyprowski <[email protected]>
Tested-by: Janusz Krzysztofik <[email protected]> #OMAP1 Amstrad Delta
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2019-02-06 15:58:29 +00:00

64 lines
1.9 KiB
C

/*
* fixed.h
*
* Copyright 2008 Wolfson Microelectronics PLC.
*
* Author: Mark Brown <[email protected]>
*
* Copyright (c) 2009 Nokia Corporation
* Roger Quadros <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*/
#ifndef __REGULATOR_FIXED_H
#define __REGULATOR_FIXED_H
struct regulator_init_data;
/**
* struct fixed_voltage_config - fixed_voltage_config structure
* @supply_name: Name of the regulator supply
* @input_supply: Name of the input regulator supply
* @microvolts: Output voltage of regulator
* @startup_delay: Start-up time in microseconds
* @enabled_at_boot: Whether regulator has been enabled at
* boot or not. 1 = Yes, 0 = No
* This is used to keep the regulator at
* the default state
* @init_data: regulator_init_data
*
* This structure contains fixed voltage regulator configuration
* information that must be passed by platform code to the fixed
* voltage regulator driver.
*/
struct fixed_voltage_config {
const char *supply_name;
const char *input_supply;
int microvolts;
unsigned startup_delay;
unsigned enabled_at_boot:1;
struct regulator_init_data *init_data;
};
struct regulator_consumer_supply;
#if IS_ENABLED(CONFIG_REGULATOR)
struct platform_device *regulator_register_always_on(int id, const char *name,
struct regulator_consumer_supply *supplies, int num_supplies, int uv);
#else
static inline struct platform_device *regulator_register_always_on(int id, const char *name,
struct regulator_consumer_supply *supplies, int num_supplies, int uv)
{
return NULL;
}
#endif
#define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
"fixed-dummy", s, ns, 0)
#endif