Skip to content

Commit d15d764

Browse files
committed
Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates for 3.4 from Mark Brown: "This has been a fairly quiet release from a regulator point of view, the only real framework features added were devm support and a convenience helper for setting up fixed voltage regulators. We also added a couple of drivers (but will drop the BQ240022 driver via the arm-soc tree as it's been replaced by the more generic gpio-regulator driver) and Axel Lin continued his relentless and generally awesome stream of fixes and cleanups." * tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (93 commits) regulator: Fix up a confusing dev_warn when DT lookup fails regulator: Convert tps6507x to set_voltage_sel regulator: Refactor tps6507x to use one tps6507x_pmic_ops for all LDOs and DCDCs regulator: Make s5m8767_get_voltage_register always return correct register regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier regulator: tps65910: Provide settling time for DCDC voltage change regulator: Add Anatop regulator driver regulator: Simplify implementation of tps65912_get_voltage_dcdc regulator: Use tps65912_set_voltage_sel for both DCDCx and LDOx regulator: tps65910: Provide settling time for enabling rails regulator: max8925: Use DIV_ROUND_UP macro regulator: tps65912: Use simple equations to get register address regulator: Fix the logic of tps65910_get_mode regulator: Merge tps65217_pmic_ldo234_ops and tps65217_pmic_dcdc_ops to tps65217_pmic_ops regulator: Use DIV_ROUND_CLOSEST in wm8350_isink_get_current regulator: Use array to store dcdc_range settings for tps65912 regulator: Rename s5m8767_convert_voltage to s5m8767_convert_voltage_to_sel regulator: tps6524x: Remove unneeded comment for N_REGULATORS regulator: Rename set_voltage_sel callback function name to *_sel regulator: Fix s5m8767_set_voltage_time_sel calculation value ...
2 parents 0c2fe82 + 4992fa1 commit d15d764

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3660
-1048
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
TWL family of regulators
2+
3+
Required properties:
4+
For twl6030 regulators/LDOs
5+
- compatible:
6+
- "ti,twl6030-vaux1" for VAUX1 LDO
7+
- "ti,twl6030-vaux2" for VAUX2 LDO
8+
- "ti,twl6030-vaux3" for VAUX3 LDO
9+
- "ti,twl6030-vmmc" for VMMC LDO
10+
- "ti,twl6030-vpp" for VPP LDO
11+
- "ti,twl6030-vusim" for VUSIM LDO
12+
- "ti,twl6030-vana" for VANA LDO
13+
- "ti,twl6030-vcxio" for VCXIO LDO
14+
- "ti,twl6030-vdac" for VDAC LDO
15+
- "ti,twl6030-vusb" for VUSB LDO
16+
- "ti,twl6030-v1v8" for V1V8 LDO
17+
- "ti,twl6030-v2v1" for V2V1 LDO
18+
- "ti,twl6030-clk32kg" for CLK32KG RESOURCE
19+
- "ti,twl6030-vdd1" for VDD1 SMPS
20+
- "ti,twl6030-vdd2" for VDD2 SMPS
21+
- "ti,twl6030-vdd3" for VDD3 SMPS
22+
For twl6025 regulators/LDOs
23+
- compatible:
24+
- "ti,twl6025-ldo1" for LDO1 LDO
25+
- "ti,twl6025-ldo2" for LDO2 LDO
26+
- "ti,twl6025-ldo3" for LDO3 LDO
27+
- "ti,twl6025-ldo4" for LDO4 LDO
28+
- "ti,twl6025-ldo5" for LDO5 LDO
29+
- "ti,twl6025-ldo6" for LDO6 LDO
30+
- "ti,twl6025-ldo7" for LDO7 LDO
31+
- "ti,twl6025-ldoln" for LDOLN LDO
32+
- "ti,twl6025-ldousb" for LDOUSB LDO
33+
- "ti,twl6025-smps3" for SMPS3 SMPS
34+
- "ti,twl6025-smps4" for SMPS4 SMPS
35+
- "ti,twl6025-vio" for VIO SMPS
36+
For twl4030 regulators/LDOs
37+
- compatible:
38+
- "ti,twl4030-vaux1" for VAUX1 LDO
39+
- "ti,twl4030-vaux2" for VAUX2 LDO
40+
- "ti,twl5030-vaux2" for VAUX2 LDO
41+
- "ti,twl4030-vaux3" for VAUX3 LDO
42+
- "ti,twl4030-vaux4" for VAUX4 LDO
43+
- "ti,twl4030-vmmc1" for VMMC1 LDO
44+
- "ti,twl4030-vmmc2" for VMMC2 LDO
45+
- "ti,twl4030-vpll1" for VPLL1 LDO
46+
- "ti,twl4030-vpll2" for VPLL2 LDO
47+
- "ti,twl4030-vsim" for VSIM LDO
48+
- "ti,twl4030-vdac" for VDAC LDO
49+
- "ti,twl4030-vintana2" for VINTANA2 LDO
50+
- "ti,twl4030-vio" for VIO LDO
51+
- "ti,twl4030-vdd1" for VDD1 SMPS
52+
- "ti,twl4030-vdd2" for VDD2 SMPS
53+
- "ti,twl4030-vintana1" for VINTANA1 LDO
54+
- "ti,twl4030-vintdig" for VINTDIG LDO
55+
- "ti,twl4030-vusb1v5" for VUSB1V5 LDO
56+
- "ti,twl4030-vusb1v8" for VUSB1V8 LDO
57+
- "ti,twl4030-vusb3v1" for VUSB3V1 LDO
58+
59+
Optional properties:
60+
- Any optional property defined in bindings/regulator/regulator.txt
61+
62+
Example:
63+
64+
xyz: regulator@0 {
65+
compatible = "ti,twl6030-vaux1";
66+
regulator-min-microvolt = <1000000>;
67+
regulator-max-microvolt = <3000000>;
68+
};

Documentation/driver-model/devres.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,8 @@ IOMAP
271271
pcim_iounmap()
272272
pcim_iomap_table() : array of mapped addresses indexed by BAR
273273
pcim_iomap_regions() : do request_region() and iomap() on multiple BARs
274+
275+
REGULATOR
276+
devm_regulator_get()
277+
devm_regulator_put()
278+
devm_regulator_bulk_get()

arch/arm/mach-imx/mach-pcm037.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include <linux/usb/ulpi.h>
3333
#include <linux/gfp.h>
3434
#include <linux/memblock.h>
35+
#include <linux/regulator/machine.h>
36+
#include <linux/regulator/fixed.h>
3537

3638
#include <media/soc_camera.h>
3739

@@ -570,6 +572,11 @@ static int __init pcm037_otg_mode(char *options)
570572
}
571573
__setup("otg_mode=", pcm037_otg_mode);
572574

575+
static struct regulator_consumer_supply dummy_supplies[] = {
576+
REGULATOR_SUPPLY("vdd33a", "smsc911x"),
577+
REGULATOR_SUPPLY("vddvario", "smsc911x"),
578+
};
579+
573580
/*
574581
* Board specific initialization.
575582
*/
@@ -579,6 +586,8 @@ static void __init pcm037_init(void)
579586

580587
imx31_soc_init();
581588

589+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
590+
582591
mxc_iomux_set_gpr(MUX_PGP_UH2, 1);
583592

584593
mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),

arch/arm/mach-u300/i2c.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static struct regulator_consumer_supply supply_ldo_c[] = {
6060
*/
6161
static struct regulator_consumer_supply supply_ldo_d[] = {
6262
{
63-
.dev = NULL,
6463
.supply = "vana15", /* Powers the SoC (CPU etc) */
6564
},
6665
};
@@ -92,7 +91,6 @@ static struct regulator_consumer_supply supply_ldo_k[] = {
9291
*/
9392
static struct regulator_consumer_supply supply_ldo_ext[] = {
9493
{
95-
.dev = NULL,
9694
.supply = "vext", /* External power */
9795
},
9896
};

arch/arm/plat-mxc/3ds_debugboard.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/platform_device.h>
1717
#include <linux/gpio.h>
1818
#include <linux/smsc911x.h>
19+
#include <linux/regulator/machine.h>
20+
#include <linux/regulator/fixed.h>
1921

2022
#include <mach/hardware.h>
2123

@@ -148,6 +150,11 @@ static struct irq_chip expio_irq_chip = {
148150
.irq_unmask = expio_unmask_irq,
149151
};
150152

153+
static struct regulator_consumer_supply dummy_supplies[] = {
154+
REGULATOR_SUPPLY("vdd33a", "smsc911x"),
155+
REGULATOR_SUPPLY("vddvario", "smsc911x"),
156+
};
157+
151158
int __init mxc_expio_init(u32 base, u32 p_irq)
152159
{
153160
int i;
@@ -188,6 +195,8 @@ int __init mxc_expio_init(u32 base, u32 p_irq)
188195
irq_set_chained_handler(p_irq, mxc_expio_irq_handler);
189196

190197
/* Register Lan device on the debugboard */
198+
regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
199+
191200
smsc911x_resources[0].start = LAN9217_BASE_ADDR(base);
192201
smsc911x_resources[0].end = LAN9217_BASE_ADDR(base) + 0x100 - 1;
193202
platform_device_register(&smsc_lan9217_device);

drivers/mfd/twl-core.c

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ add_regulator_linked(int num, struct regulator_init_data *pdata,
618618
unsigned num_consumers, unsigned long features)
619619
{
620620
unsigned sub_chip_id;
621+
struct twl_regulator_driver_data drv_data;
622+
621623
/* regulator framework demands init_data ... */
622624
if (!pdata)
623625
return NULL;
@@ -627,7 +629,19 @@ add_regulator_linked(int num, struct regulator_init_data *pdata,
627629
pdata->num_consumer_supplies = num_consumers;
628630
}
629631

630-
pdata->driver_data = (void *)features;
632+
if (pdata->driver_data) {
633+
/* If we have existing drv_data, just add the flags */
634+
struct twl_regulator_driver_data *tmp;
635+
tmp = pdata->driver_data;
636+
tmp->features |= features;
637+
} else {
638+
/* add new driver data struct, used only during init */
639+
drv_data.features = features;
640+
drv_data.set_voltage = NULL;
641+
drv_data.get_voltage = NULL;
642+
drv_data.data = NULL;
643+
pdata->driver_data = &drv_data;
644+
}
631645

632646
/* NOTE: we currently ignore regulator IRQs, e.g. for short circuits */
633647
sub_chip_id = twl_map[TWL_MODULE_PM_MASTER].sid;
@@ -750,9 +764,9 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
750764

751765
/* we need to connect regulators to this transceiver */
752766
if (twl_has_regulator() && child) {
753-
usb1v5.dev = child;
754-
usb1v8.dev = child;
755-
usb3v1.dev = child;
767+
usb1v5.dev_name = dev_name(child);
768+
usb1v8.dev_name = dev_name(child);
769+
usb3v1.dev_name = dev_name(child);
756770
}
757771
}
758772
if (twl_has_usb() && pdata->usb && twl_class_is_6030()) {
@@ -798,7 +812,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
798812
return PTR_ERR(child);
799813
/* we need to connect regulators to this transceiver */
800814
if (twl_has_regulator() && child)
801-
usb3v3.dev = child;
815+
usb3v3.dev_name = dev_name(child);
802816
} else if (twl_has_regulator() && twl_class_is_6030()) {
803817
if (features & TWL6025_SUBCLASS)
804818
child = add_regulator(TWL6025_REG_LDOUSB,
@@ -934,6 +948,31 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
934948
/* twl6030 regulators */
935949
if (twl_has_regulator() && twl_class_is_6030() &&
936950
!(features & TWL6025_SUBCLASS)) {
951+
child = add_regulator(TWL6030_REG_VDD1, pdata->vdd1,
952+
features);
953+
if (IS_ERR(child))
954+
return PTR_ERR(child);
955+
956+
child = add_regulator(TWL6030_REG_VDD2, pdata->vdd2,
957+
features);
958+
if (IS_ERR(child))
959+
return PTR_ERR(child);
960+
961+
child = add_regulator(TWL6030_REG_VDD3, pdata->vdd3,
962+
features);
963+
if (IS_ERR(child))
964+
return PTR_ERR(child);
965+
966+
child = add_regulator(TWL6030_REG_V1V8, pdata->v1v8,
967+
features);
968+
if (IS_ERR(child))
969+
return PTR_ERR(child);
970+
971+
child = add_regulator(TWL6030_REG_V2V1, pdata->v2v1,
972+
features);
973+
if (IS_ERR(child))
974+
return PTR_ERR(child);
975+
937976
child = add_regulator(TWL6030_REG_VMMC, pdata->vmmc,
938977
features);
939978
if (IS_ERR(child))

0 commit comments

Comments
 (0)