Commit 862f9f84 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'regulator/topic/88pm800',...

Merge remote-tracking branches 'regulator/topic/88pm800', 'regulator/topic/ab8500', 'regulator/topic/act8865', 'regulator/topic/as3722' and 'regulator/topic/bcm590xx' into regulator-next
ACT8865 regulator
ACT88xx regulators
-------------------
Required properties:
- compatible: "active-semi,act8865"
- compatible: "active-semi,act8846" or "active-semi,act8865"
- reg: I2C slave address
Any standard regulator properties can be used to configure the single regulator.
The valid names for regulators are:
- for act8846:
REG1, REG2, REG3, REG4, REG5, REG6, REG7, REG8, REG9, REG10, REG11, REG12
- for act8865:
DCDC_REG1, DCDC_REG2, DCDC_REG3, LDO_REG1, LDO_REG2, LDO_REG3, LDO_REG4.
Example:
......
......@@ -52,7 +52,6 @@
#define PM800_BUCK1_3 (0x3F)
#define PM800_BUCK2 (0x40)
#define PM800_BUCK3 (0x41)
#define PM800_BUCK3 (0x41)
#define PM800_BUCK4 (0x42)
#define PM800_BUCK4_1 (0x43)
#define PM800_BUCK4_2 (0x44)
......
......@@ -3037,28 +3037,12 @@ static int ab8500_regulator_register(struct platform_device *pdev,
return 0;
}
static int
ab8500_regulator_of_probe(struct platform_device *pdev,
struct device_node *np)
{
struct of_regulator_match *match = abx500_regulator.match;
int err, i;
for (i = 0; i < abx500_regulator.info_size; i++) {
err = ab8500_regulator_register(
pdev, match[i].init_data, i, match[i].of_node);
if (err)
return err;
}
return 0;
}
static int ab8500_regulator_probe(struct platform_device *pdev)
{
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
struct device_node *np = pdev->dev.of_node;
int err;
struct of_regulator_match *match;
int err, i;
if (!ab8500) {
dev_err(&pdev->dev, "null mfd parent\n");
......@@ -3075,24 +3059,20 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
"Error parsing regulator init data: %d\n", err);
return err;
}
return ab8500_regulator_of_probe(pdev, np);
}
static int ab8500_regulator_remove(struct platform_device *pdev)
{
int err;
/* remove regulator debug */
err = ab8500_regulator_debug_exit(pdev);
match = abx500_regulator.match;
for (i = 0; i < abx500_regulator.info_size; i++) {
err = ab8500_regulator_register(pdev, match[i].init_data, i,
match[i].of_node);
if (err)
return err;
}
return 0;
}
static struct platform_driver ab8500_regulator_driver = {
.probe = ab8500_regulator_probe,
.remove = ab8500_regulator_remove,
.driver = {
.name = "ab8500-regulator",
.owner = THIS_MODULE,
......
This diff is collapsed.
......@@ -219,7 +219,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
{
.regulator_id = AS3722_REGULATOR_ID_LDO3,
.name = "as3722-ldo3",
.name = "vin-ldo3-4",
.sname = "vin-ldo3-4",
.vsel_reg = AS3722_LDO3_VOLTAGE_REG,
.vsel_mask = AS3722_LDO3_VSEL_MASK,
.enable_reg = AS3722_LDOCONTROL0_REG,
......@@ -231,7 +231,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
{
.regulator_id = AS3722_REGULATOR_ID_LDO4,
.name = "as3722-ldo4",
.name = "vin-ldo3-4",
.sname = "vin-ldo3-4",
.vsel_reg = AS3722_LDO4_VOLTAGE_REG,
.vsel_mask = AS3722_LDO_VSEL_MASK,
.enable_reg = AS3722_LDOCONTROL0_REG,
......
......@@ -331,10 +331,8 @@ static struct bcm590xx_board *bcm590xx_parse_dt_reg_data(
}
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data) {
dev_err(&pdev->dev, "failed to allocate regulator board data\n");
if (!data)
return NULL;
}
np = of_node_get(np);
regulators = of_get_child_by_name(np, "regulators");
......@@ -379,10 +377,8 @@ static int bcm590xx_probe(struct platform_device *pdev)
&bcm590xx_reg_matches);
pmu = devm_kzalloc(&pdev->dev, sizeof(*pmu), GFP_KERNEL);
if (!pmu) {
dev_err(&pdev->dev, "Memory allocation failed for pmu\n");
if (!pmu)
return -ENOMEM;
}
pmu->mfd = bcm590xx;
......@@ -390,17 +386,13 @@ static int bcm590xx_probe(struct platform_device *pdev)
pmu->desc = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
sizeof(struct regulator_desc), GFP_KERNEL);
if (!pmu->desc) {
dev_err(&pdev->dev, "Memory alloc fails for desc\n");
if (!pmu->desc)
return -ENOMEM;
}
pmu->info = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
sizeof(struct bcm590xx_info *), GFP_KERNEL);
if (!pmu->info) {
dev_err(&pdev->dev, "Memory alloc fails for info\n");
if (!pmu->info)
return -ENOMEM;
}
info = bcm590xx_regs;
......
......@@ -322,18 +322,4 @@ struct ab8500_regulator_platform_data {
struct regulator_init_data *ext_regulator;
};
#ifdef CONFIG_REGULATOR_AB8500_DEBUG
int ab8500_regulator_debug_init(struct platform_device *pdev);
int ab8500_regulator_debug_exit(struct platform_device *pdev);
#else
static inline int ab8500_regulator_debug_init(struct platform_device *pdev)
{
return 0;
}
static inline int ab8500_regulator_debug_exit(struct platform_device *pdev)
{
return 0;
}
#endif
#endif
/*
* act8865.h -- Voltage regulation for the active-semi act8865
* act8865.h -- Voltage regulation for active-semi act88xx PMUs
*
* Copyright (C) 2013 Atmel Corporation.
*
......@@ -29,6 +29,27 @@ enum {
ACT8865_REG_NUM,
};
enum {
ACT8846_ID_REG1,
ACT8846_ID_REG2,
ACT8846_ID_REG3,
ACT8846_ID_REG4,
ACT8846_ID_REG5,
ACT8846_ID_REG6,
ACT8846_ID_REG7,
ACT8846_ID_REG8,
ACT8846_ID_REG9,
ACT8846_ID_REG10,
ACT8846_ID_REG11,
ACT8846_ID_REG12,
ACT8846_REG_NUM,
};
enum {
ACT8865,
ACT8846,
};
/**
* act8865_regulator_data - regulator data
* @id: regulator id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment