From patchwork Tue May 23 12:16:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 9742421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4C2FE601C2 for ; Tue, 23 May 2017 12:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C52727C05 for ; Tue, 23 May 2017 12:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3157E287CF; Tue, 23 May 2017 12:21:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D298827C05 for ; Tue, 23 May 2017 12:21:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934833AbdEWMVD (ORCPT ); Tue, 23 May 2017 08:21:03 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:42027 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934248AbdEWMVA (ORCPT ); Tue, 23 May 2017 08:21:00 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4NCKgdu000599; Tue, 23 May 2017 07:20:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1495542042; bh=hnP3mSID1Qhdd5q/ZtongudcxfAvByyb58RjQ6p+gjI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vC0Zf7XYmrgHA1aU0r6XbOwo2OjY9ECFcl9WnCQCk51nsWeU/QYyNgNhr8/dGmqi/ aOOxfJS3zxSVNjsuyQHbYTXmoLN8g4d1tKKfdzZmHPkibxhZswizbL2iPCZnv4nQjk 2J9P17ZhfJgKlsJTB5u7wuAdx/nxZehJEigjBoWU= Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4NCKg7w007392; Tue, 23 May 2017 07:20:42 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Tue, 23 May 2017 07:20:42 -0500 Received: from ula0393675.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4NCKDWQ004759; Tue, 23 May 2017 07:20:34 -0500 From: Keerthy To: , , CC: , , , , , , , Subject: [PATCH v2 3/3] regulator: tps65917: Add support for SMPS12 Date: Tue, 23 May 2017 17:46:56 +0530 Message-ID: <1495541816-14801-4-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495541816-14801-1-git-send-email-j-keerthy@ti.com> References: <1495541816-14801-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP App support for SMPS12 dual phase regulator. Signed-off-by: Keerthy Acked-by: Lee Jones --- Changes in v2: * Added Lee Jones's Ack. drivers/regulator/palmas-regulator.c | 18 +++++++++++++++--- include/linux/mfd/palmas.h | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 31ae5ee..8018a44 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -264,6 +264,13 @@ .sleep_id = TPS65917_EXTERNAL_REQSTR_ID_SMPS5, }, { + .name = "SMPS12", + .sname = "smps1-in", + .vsel_addr = TPS65917_SMPS1_VOLTAGE, + .ctrl_addr = TPS65917_SMPS1_CTRL, + .sleep_id = TPS65917_EXTERNAL_REQSTR_ID_SMPS12, + }, + { .name = "LDO1", .sname = "ldo1-in", .vsel_addr = TPS65917_LDO1_VOLTAGE, @@ -367,6 +374,7 @@ EXTERNAL_REQUESTOR_TPS65917(SMPS3, 1, 2), EXTERNAL_REQUESTOR_TPS65917(SMPS4, 1, 3), EXTERNAL_REQUESTOR_TPS65917(SMPS5, 1, 4), + EXTERNAL_REQUESTOR_TPS65917(SMPS12, 1, 5), EXTERNAL_REQUESTOR_TPS65917(LDO1, 2, 0), EXTERNAL_REQUESTOR_TPS65917(LDO2, 2, 1), EXTERNAL_REQUESTOR_TPS65917(LDO3, 2, 2), @@ -1305,7 +1313,8 @@ static int tps65917_smps_registration(struct palmas_pmic *pmic, */ desc = &pmic->desc[id]; desc->n_linear_ranges = 3; - if ((id == TPS65917_REG_SMPS2) && pmic->smps12) + if ((id == TPS65917_REG_SMPS2 || id == TPS65917_REG_SMPS1) && + pmic->smps12) continue; /* Initialise sleep/init values from platform data */ @@ -1427,6 +1436,7 @@ static int tps65917_smps_registration(struct palmas_pmic *pmic, { .name = "smps3", }, { .name = "smps4", }, { .name = "smps5", }, + { .name = "smps12",}, { .name = "ldo1", }, { .name = "ldo2", }, { .name = "ldo3", }, @@ -1455,7 +1465,7 @@ static int tps65917_smps_registration(struct palmas_pmic *pmic, static struct palmas_pmic_driver_data tps65917_ddata = { .smps_start = TPS65917_REG_SMPS1, - .smps_end = TPS65917_REG_SMPS5, + .smps_end = TPS65917_REG_SMPS12, .ldo_begin = TPS65917_REG_LDO1, .ldo_end = TPS65917_REG_LDO5, .max_reg = TPS65917_NUM_REGS, @@ -1643,8 +1653,10 @@ static int palmas_regulators_probe(struct platform_device *pdev) if (ret) return ret; - if (reg & PALMAS_SMPS_CTRL_SMPS12_SMPS123_EN) + if (reg & PALMAS_SMPS_CTRL_SMPS12_SMPS123_EN) { pmic->smps123 = 1; + pmic->smps12 = 1; + } if (reg & PALMAS_SMPS_CTRL_SMPS45_SMPS457_EN) pmic->smps457 = 1; diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 5c9a1d4..6dec438 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -250,6 +250,7 @@ enum tps65917_regulators { TPS65917_REG_SMPS3, TPS65917_REG_SMPS4, TPS65917_REG_SMPS5, + TPS65917_REG_SMPS12, /* LDO regulators */ TPS65917_REG_LDO1, TPS65917_REG_LDO2, @@ -317,6 +318,7 @@ enum tps65917_external_requestor_id { TPS65917_EXTERNAL_REQSTR_ID_SMPS3, TPS65917_EXTERNAL_REQSTR_ID_SMPS4, TPS65917_EXTERNAL_REQSTR_ID_SMPS5, + TPS65917_EXTERNAL_REQSTR_ID_SMPS12, TPS65917_EXTERNAL_REQSTR_ID_LDO1, TPS65917_EXTERNAL_REQSTR_ID_LDO2, TPS65917_EXTERNAL_REQSTR_ID_LDO3,