From: Grazvydas Ignotas Date: Sun, 22 May 2016 21:48:06 +0000 (+0300) Subject: regulator: add regen regulator X-Git-Tag: sz_175~22 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=334e5ea8efcd3f811c31c1799c9102abdf249a9b regulator: add regen regulator Well it's not really a regulator, just an output signal that is programmed the same way as a regulator, so it's easiest to add it this way. --- diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 5182f6d8e761..9b1df0baad34 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -985,6 +985,11 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) features); if (IS_ERR(child)) return PTR_ERR(child); + + child = add_regulator(TWL4030_REG_REGEN, pdata->regen, + features); + if (IS_ERR(child)) + return PTR_ERR(child); } /* maybe add LDOs that are omitted on cost-reduced parts */ diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index b44f6678c7ef..d1f3c1013489 100644 --- a/drivers/regulator/twl-regulator.c +++ b/drivers/regulator/twl-regulator.c @@ -999,6 +999,20 @@ static struct regulator_ops twlsmps_ops = { }, \ } +#define TWL4030_FIXED_RESOURCE(label, offset, num, turnon_delay, remap_conf) { \ + .base = offset, \ + .id = num, \ + .delay = turnon_delay, \ + .remap = remap_conf, \ + .desc = { \ + .name = #label, \ + .id = TWL4030_REG_##label, \ + .ops = &twl4030fixed_ops, \ + .type = REGULATOR_VOLTAGE, \ + .owner = THIS_MODULE, \ + }, \ + } + #define TWL6030_FIXED_RESOURCE(label, offset, turnon_delay) { \ .base = offset, \ .delay = turnon_delay, \ @@ -1052,6 +1066,8 @@ static struct twlreg_info twl_regs[] = { TWL4030_FIXED_LDO(VUSB3V1, 0x77, 3100, 19, 150, 0x08), /* VUSBCP is managed *only* by the USB subchip */ + TWL4030_FIXED_RESOURCE(REGEN, 0x7f, 21, 10, 0x08), /* OD to VBAT */ + /* 6030 REG with base as PMC Slave Misc : 0x0030 */ /* Turnon-delay and remap configuration values for 6030 are not verified since the specification is not public */ diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index ca0aeec4ccbf..f1a95c24219c 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h @@ -729,6 +729,9 @@ struct twl4030_platform_data { struct regulator_init_data *vintana1; struct regulator_init_data *vintana2; struct regulator_init_data *vintdig; + + struct regulator_init_data *regen; + /* TWL6030 LDO regulators */ struct regulator_init_data *vmmc; struct regulator_init_data *vpp; @@ -811,6 +814,9 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } #define TWL4030_REG_VUSB1V8 18 #define TWL4030_REG_VUSB3V1 19 +/* output signals */ +#define TWL4030_REG_REGEN 21 + /* TWL6030 SMPS/LDO's */ /* EXTERNAL dc-to-dc buck convertor controllable via SR */ #define TWL6030_REG_VDD1 30