blob: 18a525880a36e2efa1b4d94f25401b2d4a4962f0 [file] [log] [blame]
Sven Schwermer25957522019-06-24 13:03:33 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2019 Disruptive Technologies Research AS
4 * Sven Schwermer <sven.svenschwermer@disruptive-technologies.com>
5 */
6
7#ifndef _REGULATOR_COMMON_H
8#define _REGULATOR_COMMON_H
9
10#include <common.h>
11#include <asm/gpio.h>
12#include <dm.h>
13
14struct regulator_common_platdata {
15 struct gpio_desc gpio; /* GPIO for regulator enable control */
16 unsigned int startup_delay_us;
17 unsigned int off_on_delay_us;
18};
19
20int regulator_common_ofdata_to_platdata(struct udevice *dev,
21 struct regulator_common_platdata *dev_pdata, const char *enable_gpio_name);
22int regulator_common_get_enable(const struct udevice *dev,
23 struct regulator_common_platdata *dev_pdata);
24int regulator_common_set_enable(const struct udevice *dev,
25 struct regulator_common_platdata *dev_pdata, bool enable);
26
27#endif /* _REGULATOR_COMMON_H */