regulator: lp872x: replacing legacy gpio interface for gpiod

Removing all linux/gpio.h and linux/of_gpio.h dependencies and replacing
them with the gpiod interface

Signed-off-by: Maíra Canal <maira.canal@usp.br>
Message-Id: <YWma2yTyuwS5XwhY@fedora>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Maíra Canal
2021-10-15 12:14:35 -03:00
committed by Mark Brown
parent 636bdb5f84
commit 72bf80cf09
2 changed files with 22 additions and 30 deletions

View File

@@ -10,7 +10,7 @@
#include <linux/regulator/machine.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#define LP872X_MAX_REGULATORS 9
@@ -41,8 +41,8 @@ enum lp872x_regulator_id {
};
enum lp872x_dvs_state {
DVS_LOW = GPIOF_OUT_INIT_LOW,
DVS_HIGH = GPIOF_OUT_INIT_HIGH,
DVS_LOW = GPIOD_OUT_LOW,
DVS_HIGH = GPIOD_OUT_HIGH,
};
enum lp872x_dvs_sel {
@@ -52,12 +52,12 @@ enum lp872x_dvs_sel {
/**
* lp872x_dvs
* @gpio : gpio pin number for dvs control
* @gpio : gpio descriptor for dvs control
* @vsel : dvs selector for buck v1 or buck v2 register
* @init_state : initial dvs pin state
*/
struct lp872x_dvs {
int gpio;
struct gpio_desc *gpio;
enum lp872x_dvs_sel vsel;
enum lp872x_dvs_state init_state;
};
@@ -78,14 +78,14 @@ struct lp872x_regulator_data {
* @update_config : if LP872X_GENERAL_CFG register is updated, set true
* @regulator_data : platform regulator id and init data
* @dvs : dvs data for buck voltage control
* @enable_gpio : gpio pin number for enable control
* @enable_gpio : gpio descriptor for enable control
*/
struct lp872x_platform_data {
u8 general_config;
bool update_config;
struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
struct lp872x_dvs *dvs;
int enable_gpio;
struct gpio_desc *enable_gpio;
};
#endif