Skip to content

Commit 6a6939d

Browse files
fabioestevambroonie
authored andcommitted
regulator: pfuze100: Convert the driver to DT-only
Since 5.10-rc1 i.MX is a devicetree-only platform, so simplify the code by removing the unused non-DT support. Signed-off-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20201210212748.5849-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0da6736 commit 6a6939d

3 files changed

Lines changed: 2 additions & 40 deletions

File tree

drivers/regulator/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ config REGULATOR_PF8X00
830830

831831
config REGULATOR_PFUZE100
832832
tristate "Freescale PFUZE100/200/3000/3001 regulator driver"
833-
depends on I2C
833+
depends on I2C && OF
834834
select REGMAP_I2C
835835
help
836836
Say y here to support the regulators found on the Freescale

drivers/regulator/pfuze100-regulator.c

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,6 @@ static const int pfuze3000_sw2hi[] = {
105105
2500000, 2800000, 2850000, 3000000, 3100000, 3150000, 3200000, 3300000,
106106
};
107107

108-
static const struct i2c_device_id pfuze_device_id[] = {
109-
{.name = "pfuze100", .driver_data = PFUZE100},
110-
{.name = "pfuze200", .driver_data = PFUZE200},
111-
{.name = "pfuze3000", .driver_data = PFUZE3000},
112-
{.name = "pfuze3001", .driver_data = PFUZE3001},
113-
{ }
114-
};
115-
MODULE_DEVICE_TABLE(i2c, pfuze_device_id);
116-
117108
static const struct of_device_id pfuze_dt_ids[] = {
118109
{ .compatible = "fsl,pfuze100", .data = (void *)PFUZE100},
119110
{ .compatible = "fsl,pfuze200", .data = (void *)PFUZE200},
@@ -440,7 +431,6 @@ static struct pfuze_regulator pfuze3001_regulators[] = {
440431
PFUZE100_VGEN_REG(PFUZE3001, VLDO4, PFUZE100_VGEN6VOL, 1800000, 3300000, 100000),
441432
};
442433

443-
#ifdef CONFIG_OF
444434
/* PFUZE100 */
445435
static struct of_regulator_match pfuze100_matches[] = {
446436
{ .name = "sw1ab", },
@@ -578,22 +568,6 @@ static inline struct device_node *match_of_node(int index)
578568
{
579569
return pfuze_matches[index].of_node;
580570
}
581-
#else
582-
static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
583-
{
584-
return 0;
585-
}
586-
587-
static inline struct regulator_init_data *match_init_data(int index)
588-
{
589-
return NULL;
590-
}
591-
592-
static inline struct device_node *match_of_node(int index)
593-
{
594-
return NULL;
595-
}
596-
#endif
597571

598572
static struct pfuze_chip *syspm_pfuze_chip;
599573

@@ -708,8 +682,6 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
708682
const struct i2c_device_id *id)
709683
{
710684
struct pfuze_chip *pfuze_chip;
711-
struct pfuze_regulator_platform_data *pdata =
712-
dev_get_platdata(&client->dev);
713685
struct regulator_config config = { };
714686
int i, ret;
715687
const struct of_device_id *match;
@@ -802,10 +774,7 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
802774

803775
desc = &pfuze_chip->regulator_descs[i].desc;
804776

805-
if (pdata)
806-
init_data = pdata->init_data[i];
807-
else
808-
init_data = match_init_data(i);
777+
init_data = match_init_data(i);
809778

810779
/* SW2~SW4 high bit check and modify the voltage value table */
811780
if (i >= sw_check_start && i <= sw_check_end) {
@@ -876,7 +845,6 @@ static int pfuze100_regulator_remove(struct i2c_client *client)
876845
}
877846

878847
static struct i2c_driver pfuze_driver = {
879-
.id_table = pfuze_device_id,
880848
.driver = {
881849
.name = "pfuze100-regulator",
882850
.of_match_table = pfuze_dt_ids,

include/linux/regulator/pfuze100.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,4 @@
6363
#define PFUZE3001_VLDO3 8
6464
#define PFUZE3001_VLDO4 9
6565

66-
struct regulator_init_data;
67-
68-
struct pfuze_regulator_platform_data {
69-
struct regulator_init_data *init_data[PFUZE100_MAX_REGULATOR];
70-
};
71-
7266
#endif /* __LINUX_REG_PFUZE100_H */

0 commit comments

Comments
 (0)