diff options
Diffstat (limited to 'drivers/regulator/pfuze.c')
-rw-r--r-- | drivers/regulator/pfuze.c | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/drivers/regulator/pfuze.c b/drivers/regulator/pfuze.c index 1950ffb04c..3e8890b10c 100644 --- a/drivers/regulator/pfuze.c +++ b/drivers/regulator/pfuze.c @@ -1,17 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2017 Sascha Hauer, Pengutronix - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * */ #include <common.h> @@ -21,18 +10,15 @@ #include <errno.h> #include <malloc.h> #include <of.h> -#include <regmap.h> +#include <linux/regmap.h> #include <mfd/pfuze.h> #include <i2c/i2c.h> #include <poweroff.h> -#include <mach/imx6.h> #define DRIVERNAME "pfuze" -#define MC13XXX_NUMREGS 0x3f - #define PFUZE100_SW1ABMODE 0x23 #define PFUZE100_SW1CMODE 0x31 #define PFUZE100_SW2MODE 0x38 @@ -54,7 +40,7 @@ #define PFUZE100_VGENxSTBY BIT(5) struct pfuze { - struct device_d *dev; + struct device *dev; struct regmap *map; struct i2c_client *client; int revision; @@ -144,8 +130,6 @@ static void pfuze_power_off_prepare(struct poweroff_handler *handler) regmap_write_bits(pfuze_dev->map, PFUZE100_VGEN6VOL, PFUZE100_VGENxLPWR | PFUZE100_VGENxSTBY, PFUZE100_VGENxSTBY); - - imx6_pm_stby_poweroff(); } static struct regmap_bus regmap_pfuze_i2c_bus = { @@ -159,7 +143,7 @@ static const struct regmap_config pfuze_regmap_i2c_config = { .max_register = 127, }; -static int __init pfuze_probe(struct device_d *dev) +static int __init pfuze_probe(struct device *dev) { int ret; @@ -180,7 +164,7 @@ static int __init pfuze_probe(struct device_d *dev) if (pfuze_init_callback) pfuze_init_callback(pfuze_dev->map); - if (of_property_read_bool(dev->device_node, + if (of_property_read_bool(dev->of_node, "fsl,pmic-stby-poweroff")) return poweroff_handler_register_fn(pfuze_power_off_prepare); @@ -202,23 +186,13 @@ static __maybe_unused struct of_device_id pfuze_dt_ids[] = { { .compatible = "fsl,pfuze3001" }, { } }; +MODULE_DEVICE_TABLE(of, pfuze_dt_ids); -static struct driver_d pfuze_i2c_driver = { +static struct driver pfuze_i2c_driver = { .name = "pfuze-i2c", .probe = pfuze_probe, .id_table = pfuze_ids, .of_compatible = DRV_OF_COMPAT(pfuze_dt_ids), }; -static int __init pfuze_init(void) -{ - int ret; - - ret = i2c_driver_register(&pfuze_i2c_driver); - if (ret) - return ret; - - return 0; - -} -late_initcall(pfuze_init); +device_i2c_driver(pfuze_i2c_driver); |