Sven Schwermer | 2595752 | 2019-06-24 13:03:33 +0200 | [diff] [blame] | 1 | // 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 | |
Sven Schwermer | 2595752 | 2019-06-24 13:03:33 +0200 | [diff] [blame] | 10 | #include <asm/gpio.h> |
Sven Schwermer | 2595752 | 2019-06-24 13:03:33 +0200 | [diff] [blame] | 11 | |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 12 | struct regulator_common_plat { |
Sven Schwermer | 2595752 | 2019-06-24 13:03:33 +0200 | [diff] [blame] | 13 | struct gpio_desc gpio; /* GPIO for regulator enable control */ |
| 14 | unsigned int startup_delay_us; |
| 15 | unsigned int off_on_delay_us; |
| 16 | }; |
| 17 | |
Simon Glass | aad29ae | 2020-12-03 16:55:21 -0700 | [diff] [blame] | 18 | int regulator_common_of_to_plat(struct udevice *dev, |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 19 | struct regulator_common_plat *dev_pdata, const |
| 20 | char *enable_gpio_name); |
Sven Schwermer | 2595752 | 2019-06-24 13:03:33 +0200 | [diff] [blame] | 21 | int regulator_common_get_enable(const struct udevice *dev, |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 22 | struct regulator_common_plat *dev_pdata); |
Sven Schwermer | 2595752 | 2019-06-24 13:03:33 +0200 | [diff] [blame] | 23 | int regulator_common_set_enable(const struct udevice *dev, |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 24 | struct regulator_common_plat *dev_pdata, bool enable); |
Sven Schwermer | 2595752 | 2019-06-24 13:03:33 +0200 | [diff] [blame] | 25 | |
| 26 | #endif /* _REGULATOR_COMMON_H */ |