| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * gpio-regulator.h |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 11 | 12 | * |
|---|
| 12 | 13 | * Copyright (c) 2009 Nokia Corporation |
|---|
| 13 | 14 | * Roger Quadros <ext-roger.quadros@nokia.com> |
|---|
| 14 | | - * |
|---|
| 15 | | - * This program is free software; you can redistribute it and/or |
|---|
| 16 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 17 | | - * published by the Free Software Foundation; either version 2 of the |
|---|
| 18 | | - * License, or (at your option) any later version. |
|---|
| 19 | 15 | */ |
|---|
| 20 | 16 | |
|---|
| 21 | 17 | #ifndef __REGULATOR_GPIO_H |
|---|
| 22 | 18 | #define __REGULATOR_GPIO_H |
|---|
| 19 | + |
|---|
| 20 | +#include <linux/gpio/consumer.h> |
|---|
| 23 | 21 | |
|---|
| 24 | 22 | struct regulator_init_data; |
|---|
| 25 | 23 | |
|---|
| .. | .. |
|---|
| 44 | 42 | /** |
|---|
| 45 | 43 | * struct gpio_regulator_config - config structure |
|---|
| 46 | 44 | * @supply_name: Name of the regulator supply |
|---|
| 47 | | - * @input_supply: Name of the regulator input supply |
|---|
| 48 | | - * @enable_gpio: GPIO to use for enable control |
|---|
| 49 | | - * set to -EINVAL if not used |
|---|
| 50 | | - * @enable_high: Polarity of enable GPIO |
|---|
| 51 | | - * 1 = Active high, 0 = Active low |
|---|
| 52 | 45 | * @enabled_at_boot: Whether regulator has been enabled at |
|---|
| 53 | 46 | * boot or not. 1 = Yes, 0 = No |
|---|
| 54 | 47 | * This is used to keep the regulator at |
|---|
| 55 | 48 | * the default state |
|---|
| 56 | 49 | * @startup_delay: Start-up time in microseconds |
|---|
| 57 | | - * @gpios: Array containing the gpios needed to control |
|---|
| 58 | | - * the setting of the regulator |
|---|
| 59 | | - * @nr_gpios: Number of gpios |
|---|
| 50 | + * @gflags: Array of GPIO configuration flags for initial |
|---|
| 51 | + * states |
|---|
| 52 | + * @ngpios: Number of GPIOs and configurations available |
|---|
| 60 | 53 | * @states: Array of gpio_regulator_state entries describing |
|---|
| 61 | 54 | * the gpio state for specific voltages |
|---|
| 62 | 55 | * @nr_states: Number of states available |
|---|
| .. | .. |
|---|
| 69 | 62 | */ |
|---|
| 70 | 63 | struct gpio_regulator_config { |
|---|
| 71 | 64 | const char *supply_name; |
|---|
| 72 | | - const char *input_supply; |
|---|
| 73 | 65 | |
|---|
| 74 | | - int enable_gpio; |
|---|
| 75 | | - unsigned enable_high:1; |
|---|
| 76 | 66 | unsigned enabled_at_boot:1; |
|---|
| 77 | 67 | unsigned startup_delay; |
|---|
| 78 | 68 | |
|---|
| 79 | | - struct gpio *gpios; |
|---|
| 80 | | - int nr_gpios; |
|---|
| 69 | + enum gpiod_flags *gflags; |
|---|
| 70 | + int ngpios; |
|---|
| 81 | 71 | |
|---|
| 82 | 72 | struct gpio_regulator_state *states; |
|---|
| 83 | 73 | int nr_states; |
|---|