android_kernel_xiaomi_sm8350/include/linux/regulator/proxy-consumer.h
David Collins cd91cb8d06 regulator: add proxy consumer library
Add a proxy consumer library which can be used by regulator
drivers to ensure that a given regulator maintains a certain
minimum power state during bootup.  Enable state, voltage, and
current may be forced to specified levels.

Change-Id: I46853f55a1201195ed50f0365399cf49086f24ff
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-21 16:39:07 -08:00

39 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
*/
#ifndef _LINUX_REGULATOR_PROXY_CONSUMER_H_
#define _LINUX_REGULATOR_PROXY_CONSUMER_H_
#include <linux/device.h>
#include <linux/of.h>
#if IS_ENABLED(CONFIG_REGULATOR_PROXY_CONSUMER)
int regulator_proxy_consumer_register(struct device *dev,
struct device_node *node);
void regulator_proxy_consumer_unregister(struct device *dev);
int devm_regulator_proxy_consumer_register(struct device *dev,
struct device_node *node);
void devm_regulator_proxy_consumer_unregister(struct device *dev);
void regulator_proxy_consumer_sync_state(struct device *dev);
#else
static inline int regulator_proxy_consumer_register(struct device *dev,
struct device_node *node)
{ return 0; }
static inline void regulator_proxy_consumer_unregister(struct device *dev)
{ }
static inline int devm_regulator_proxy_consumer_register(struct device *dev,
struct device_node *node)
{ return 0; }
static inline void devm_regulator_proxy_consumer_unregister(struct device *dev)
{ }
void regulator_proxy_consumer_sync_state(struct device *dev)
{ }
#endif
#endif