From patchwork Mon Aug 12 13:52:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Simion X-Patchwork-Id: 13760635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6C52C52D7F for ; Mon, 12 Aug 2024 13:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9vi4EsYjpMn+Ap0dN02XaX7wLVnGRXnmI1NCOiVERek=; b=vuDrIGJYgSqFJId5hevcc3+JjA dOvpv2HMAUZsyt/8+cBfKPzdo94BTNDRTNltt+HfEasrymAd4JIsFmncF0gFCGAO9qlNzmfZQTiIc D4n1jtEr/nBO7RcBL/2TN95Q6x4pOe96O1O5N1uWFF5JN8EMiQWC0ptOjhUZSWT9eOPBnTJiS000d A3MkPQLzi4NJpbdcLVN214pnL5Bwy8T3WVHC2PB4BXFvxBKnRC37tuT8qWZH37oKRJ4dfW9Uu5Iob 4IaAfRUMmVUpSfiuK+iijI80mw++aFd0iUf+tO0vRsbXf1K8YmWHU6yf1fvY6UUe9cuVvDX8snwPV pyEUq2yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVUy-00000000Unj-2Msg; Mon, 12 Aug 2024 13:54:12 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdVTl-00000000UPH-2Rzb for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 13:52:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1723470777; x=1755006777; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ykeS6VoIwd0uuNUslgahaQuM8F5Z+YJ644IDPqbNm04=; b=PUKuBU8rwxX5LZBOf4MoSMiUfKmgsseB1tN3LrvSy1Qo15TIrGVTEOXq 5EGGriraY0P26HMUzcVI5fkFVHpRE/oJ4hkUdA+9Mu3FalOtqhFQYY1OP cl81SFhyLB0t2rj7pqRut2sKfBf/nc5iPQrqrQe2M7XuGNsWnG8s/TEg7 x/Vx0hqTNO97vxJ6J93rzm/oP3xnunHDh5G1ZpHH5OAX+bWJ0Qd7Z6/Ea 0sUq01ASgGqWk1HzJ2o1gEVV1K5ZmC287bM3yCfwZnEkcYRolHrKQbj9c yQrSMBA64U3c7wI8zFOXWOgJ3tBtRPaBt5yIOlylzVNmLUIKq/dMfQkd7 g==; X-CSE-ConnectionGUID: s4TBmy++Rr+nQ8F2ugpKvw== X-CSE-MsgGUID: a4vGk6CoTiGArcdctt08SA== X-IronPort-AV: E=Sophos;i="6.09,283,1716274800"; d="scan'208";a="261298073" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 12 Aug 2024 06:52:54 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 12 Aug 2024 06:52:40 -0700 Received: from ROB-ULT-M76677.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 12 Aug 2024 06:52:38 -0700 From: Andrei Simion To: , , , , , , , CC: , , , Andrei Simion , Mihai Sain Subject: [PATCH v2 1/7] regulator: mcp16502: Add supplier for regulators Date: Mon, 12 Aug 2024 16:52:25 +0300 Message-ID: <20240812135231.43744-2-andrei.simion@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240812135231.43744-1-andrei.simion@microchip.com> References: <20240812135231.43744-1-andrei.simion@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240812_065257_656236_F5900FB8 X-CRM114-Status: GOOD ( 11.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Based on the datasheet [1] (Block Diagram) PVIN[1-4] and LVIN represent the input voltage supply for each BUCKs respective LDOs. Update the driver to align with the datasheet [1]. [1]: https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP16502-Data-Sheet-DS20006275.pdf Co-developed-by: Mihai Sain Signed-off-by: Mihai Sain Signed-off-by: Andrei Simion --- v1 -> v2: - no update --- drivers/regulator/mcp16502.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/mcp16502.c b/drivers/regulator/mcp16502.c index 5de9d4fa5113..b34ae0bbba6f 100644 --- a/drivers/regulator/mcp16502.c +++ b/drivers/regulator/mcp16502.c @@ -107,9 +107,10 @@ static unsigned int mcp16502_of_map_mode(unsigned int mode) return REGULATOR_MODE_INVALID; } -#define MCP16502_REGULATOR(_name, _id, _ranges, _ops, _ramp_table) \ +#define MCP16502_REGULATOR(_name, _id, _sn, _ranges, _ops, _ramp_table) \ [_id] = { \ .name = _name, \ + .supply_name = #_sn, \ .regulators_node = "regulators", \ .id = _id, \ .ops = &(_ops), \ @@ -467,18 +468,18 @@ static const struct linear_range b234_ranges[] = { }; static const struct regulator_desc mcp16502_desc[] = { - /* MCP16502_REGULATOR(_name, _id, ranges, regulator_ops, ramp_table) */ - MCP16502_REGULATOR("VDD_IO", BUCK1, b1l12_ranges, mcp16502_buck_ops, + /* MCP16502_REGULATOR(_name, _id, _sn, _ranges, _ops, _ramp_table) */ + MCP16502_REGULATOR("VDD_IO", BUCK1, pvin1, b1l12_ranges, mcp16502_buck_ops, mcp16502_ramp_b1l12), - MCP16502_REGULATOR("VDD_DDR", BUCK2, b234_ranges, mcp16502_buck_ops, + MCP16502_REGULATOR("VDD_DDR", BUCK2, pvin2, b234_ranges, mcp16502_buck_ops, mcp16502_ramp_b234), - MCP16502_REGULATOR("VDD_CORE", BUCK3, b234_ranges, mcp16502_buck_ops, + MCP16502_REGULATOR("VDD_CORE", BUCK3, pvin3, b234_ranges, mcp16502_buck_ops, mcp16502_ramp_b234), - MCP16502_REGULATOR("VDD_OTHER", BUCK4, b234_ranges, mcp16502_buck_ops, + MCP16502_REGULATOR("VDD_OTHER", BUCK4, pvin4, b234_ranges, mcp16502_buck_ops, mcp16502_ramp_b234), - MCP16502_REGULATOR("LDO1", LDO1, b1l12_ranges, mcp16502_ldo_ops, + MCP16502_REGULATOR("LDO1", LDO1, lvin, b1l12_ranges, mcp16502_ldo_ops, mcp16502_ramp_b1l12), - MCP16502_REGULATOR("LDO2", LDO2, b1l12_ranges, mcp16502_ldo_ops, + MCP16502_REGULATOR("LDO2", LDO2, lvin, b1l12_ranges, mcp16502_ldo_ops, mcp16502_ramp_b1l12) };