Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: bd9571mwv: Add BD9574MWF support

Add support for BD9574MWF which is similar chip with BD9571MWV.
Note that we don't support voltage rails VD{09,18,25,33} by this
driver on BD9574. The VD09 voltage could be read from PMIC but that
is not supported by this commit.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Yoshihiro Shimoda and committed by
Lee Jones
ceee9dc1 30402f97

+8 -2
+8 -2
drivers/regulator/bd9571mwv-regulator.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * ROHM BD9571MWV-M regulator driver 3 + * ROHM BD9571MWV-M and BD9574MWF-M regulator driver 4 4 * 5 5 * Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com> 6 6 * ··· 9 9 * NOTE: VD09 is missing 10 10 */ 11 11 12 + #include <linux/mfd/rohm-generic.h> 12 13 #include <linux/module.h> 13 14 #include <linux/of.h> 14 15 #include <linux/platform_device.h> ··· 278 277 struct regulator_dev *rdev; 279 278 unsigned int val; 280 279 int i; 280 + enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; 281 281 282 282 bdreg = devm_kzalloc(&pdev->dev, sizeof(*bdreg), GFP_KERNEL); 283 283 if (!bdreg) ··· 294 292 config.regmap = bdreg->regmap; 295 293 296 294 for (i = 0; i < ARRAY_SIZE(regulators); i++) { 295 + /* BD9574MWF supports DVFS only */ 296 + if (chip == ROHM_CHIP_TYPE_BD9574 && regulators[i].id != DVFS) 297 + continue; 297 298 rdev = devm_regulator_register(&pdev->dev, &regulators[i], 298 299 &config); 299 300 if (IS_ERR(rdev)) { ··· 344 339 } 345 340 346 341 static const struct platform_device_id bd9571mwv_regulator_id_table[] = { 347 - { "bd9571mwv-regulator", }, 342 + { "bd9571mwv-regulator", ROHM_CHIP_TYPE_BD9571 }, 343 + { "bd9574mwf-regulator", ROHM_CHIP_TYPE_BD9574 }, 348 344 { /* sentinel */ } 349 345 }; 350 346 MODULE_DEVICE_TABLE(platform, bd9571mwv_regulator_id_table);