mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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>
This commit is contained in:
committed by
Lee Jones
parent
30402f97f9
commit
ceee9dc13b
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/*
|
/*
|
||||||
* ROHM BD9571MWV-M regulator driver
|
* ROHM BD9571MWV-M and BD9574MWF-M regulator driver
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com>
|
* Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
* NOTE: VD09 is missing
|
* NOTE: VD09 is missing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/mfd/rohm-generic.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
@@ -277,6 +278,7 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
|
|||||||
struct regulator_dev *rdev;
|
struct regulator_dev *rdev;
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
int i;
|
int i;
|
||||||
|
enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data;
|
||||||
|
|
||||||
bdreg = devm_kzalloc(&pdev->dev, sizeof(*bdreg), GFP_KERNEL);
|
bdreg = devm_kzalloc(&pdev->dev, sizeof(*bdreg), GFP_KERNEL);
|
||||||
if (!bdreg)
|
if (!bdreg)
|
||||||
@@ -292,6 +294,9 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
|
|||||||
config.regmap = bdreg->regmap;
|
config.regmap = bdreg->regmap;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(regulators); i++) {
|
for (i = 0; i < ARRAY_SIZE(regulators); i++) {
|
||||||
|
/* BD9574MWF supports DVFS only */
|
||||||
|
if (chip == ROHM_CHIP_TYPE_BD9574 && regulators[i].id != DVFS)
|
||||||
|
continue;
|
||||||
rdev = devm_regulator_register(&pdev->dev, ®ulators[i],
|
rdev = devm_regulator_register(&pdev->dev, ®ulators[i],
|
||||||
&config);
|
&config);
|
||||||
if (IS_ERR(rdev)) {
|
if (IS_ERR(rdev)) {
|
||||||
@@ -339,7 +344,8 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct platform_device_id bd9571mwv_regulator_id_table[] = {
|
static const struct platform_device_id bd9571mwv_regulator_id_table[] = {
|
||||||
{ "bd9571mwv-regulator", },
|
{ "bd9571mwv-regulator", ROHM_CHIP_TYPE_BD9571 },
|
||||||
|
{ "bd9574mwf-regulator", ROHM_CHIP_TYPE_BD9574 },
|
||||||
{ /* sentinel */ }
|
{ /* sentinel */ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(platform, bd9571mwv_regulator_id_table);
|
MODULE_DEVICE_TABLE(platform, bd9571mwv_regulator_id_table);
|
||||||
|
Reference in New Issue
Block a user