From patchwork Tue Jul 29 16:28:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 4641371 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 26EBFC0338 for ; Tue, 29 Jul 2014 16:32:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1ECD520145 for ; Tue, 29 Jul 2014 16:32:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D7502014A for ; Tue, 29 Jul 2014 16:32:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XCAI7-0002Aw-8M; Tue, 29 Jul 2014 16:30:19 +0000 Received: from bhuna.collabora.co.uk ([93.93.135.160]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XCAHZ-0000mS-Dk for linux-arm-kernel@lists.infradead.org; Tue, 29 Jul 2014 16:29:47 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: javier) with ESMTPSA id 74AE126880D8 From: Javier Martinez Canillas To: Mark Brown Subject: [RFC 4/5] regulator: tps65090: Set voltage for fixed regulators Date: Tue, 29 Jul 2014 18:28:58 +0200 Message-Id: <1406651339-28901-5-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <1406651339-28901-1-git-send-email-javier.martinez@collabora.co.uk> References: <1406651339-28901-1-git-send-email-javier.martinez@collabora.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140729_092945_804735_BEA730AE X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Doug Anderson , linux-kernel@vger.kernel.org, Kukjin Kim , Yuvaraj Kumar C D , Olof Johansson , Javier Martinez Canillas , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to the tps65090 data manual [0], the DCDC1 and DCDC2 step-down converters and the LDO's have a fixed output voltage. Add this information to the driver since these fixed regulators be used as input supply for load switches which don't provide an output voltage and their parent supply voltage is used. [0]: http://www.ti.com/lit/gpn/tps65090 Signed-off-by: Javier Martinez Canillas --- drivers/regulator/tps65090-regulator.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c index 2064b3f..919f5ce 100644 --- a/drivers/regulator/tps65090-regulator.c +++ b/drivers/regulator/tps65090-regulator.c @@ -192,12 +192,14 @@ static struct regulator_ops tps65090_fet_control_ops = { static struct regulator_ops tps65090_ldo_ops = { }; -#define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _ops) \ +#define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _nvolt, _volt, _ops) \ { \ .name = "TPS65090_RAILS"#_id, \ .supply_name = _sname, \ .id = TPS65090_REGULATOR_##_id, \ + .n_voltages = _nvolt, \ .ops = &_ops, \ + .fixed_uV = _volt, \ .enable_reg = _en_reg, \ .enable_val = _en_bits, \ .enable_mask = _en_bits, \ @@ -205,39 +207,45 @@ static struct regulator_ops tps65090_ldo_ops = { .owner = THIS_MODULE, \ } +#define tps65090_REG_FIX(_id, _sname, en_reg, _en_bits, _volt, _ops) \ + tps65090_REG_DESC(_id, _sname, en_reg, _en_bits, 1, _volt, _ops) + +#define tps65090_REG_VAR(_id, _sname, en_reg, _en_bits, _ops) \ + tps65090_REG_DESC(_id, _sname, en_reg, _en_bits, 0, 0, _ops) + static struct regulator_desc tps65090_regulator_desc[] = { - tps65090_REG_DESC(DCDC1, "vsys1", 0x0C, BIT(CTRL_EN_BIT), + tps65090_REG_FIX(DCDC1, "vsys1", 0x0C, BIT(CTRL_EN_BIT), 5000000, tps65090_reg_control_ops), - tps65090_REG_DESC(DCDC2, "vsys2", 0x0D, BIT(CTRL_EN_BIT), + tps65090_REG_FIX(DCDC2, "vsys2", 0x0D, BIT(CTRL_EN_BIT), 3300000, tps65090_reg_control_ops), - tps65090_REG_DESC(DCDC3, "vsys3", 0x0E, BIT(CTRL_EN_BIT), + tps65090_REG_VAR(DCDC3, "vsys3", 0x0E, BIT(CTRL_EN_BIT), tps65090_reg_control_ops), - tps65090_REG_DESC(FET1, "infet1", 0x0F, + tps65090_REG_VAR(FET1, "infet1", 0x0F, BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), tps65090_fet_control_ops), - tps65090_REG_DESC(FET2, "infet2", 0x10, + tps65090_REG_VAR(FET2, "infet2", 0x10, BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), tps65090_fet_control_ops), - tps65090_REG_DESC(FET3, "infet3", 0x11, + tps65090_REG_VAR(FET3, "infet3", 0x11, BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), tps65090_fet_control_ops), - tps65090_REG_DESC(FET4, "infet4", 0x12, + tps65090_REG_VAR(FET4, "infet4", 0x12, BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), tps65090_fet_control_ops), - tps65090_REG_DESC(FET5, "infet5", 0x13, + tps65090_REG_VAR(FET5, "infet5", 0x13, BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), tps65090_fet_control_ops), - tps65090_REG_DESC(FET6, "infet6", 0x14, + tps65090_REG_VAR(FET6, "infet6", 0x14, BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), tps65090_fet_control_ops), - tps65090_REG_DESC(FET7, "infet7", 0x15, + tps65090_REG_VAR(FET7, "infet7", 0x15, BIT(CTRL_EN_BIT) | BIT(CTRL_PG_BIT), tps65090_fet_control_ops), - tps65090_REG_DESC(LDO1, "vsys-l1", 0, 0, + tps65090_REG_FIX(LDO1, "vsys-l1", 0, 0, 5000000, tps65090_ldo_ops), - tps65090_REG_DESC(LDO2, "vsys-l2", 0, 0, + tps65090_REG_FIX(LDO2, "vsys-l2", 0, 0, 3300000, tps65090_ldo_ops), };