From patchwork Sat Jun 4 19:32:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12869655 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CB6FC43334 for ; Sat, 4 Jun 2022 19:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241425AbiFDTei (ORCPT ); Sat, 4 Jun 2022 15:34:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241493AbiFDTeb (ORCPT ); Sat, 4 Jun 2022 15:34:31 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5025C5133D; Sat, 4 Jun 2022 12:33:07 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id b8so13961278edf.11; Sat, 04 Jun 2022 12:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0yvG1yU1Izerfn366VcPnkn//qEws7ZJJNVpImxvz2c=; b=RAyzoTeC6BHPdQhVeOefnDlmy+whZ8+lNtIcpNxX8Eb8CsGIhgDDNkNr7NZs9oaf2p 9LWlNLAT5AOpNcoFlwqnSY9YRGPFF8uENtrfru4kF9CuJTkE/dLdlSQWaN33g1A+OZPi 9ZReGxqpDpj2XpRZqAuolAPGu8yxR0aZ3PE0O2pyqO4AT4djpe+0QDAGnsZTq6V8BmIO TzqXUHfi/qV+LeRr6cf3n1eAmJdVwIdA67vPdhpCmKfvY0kgDTmInP90ut9VwS8PPBfP C95gCVJ6y57YodW2W5DLqGYeGwEcSxeI/DKvwFOsyUldEIjJHZga+tZZIkaY3LUDdqKG y2Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0yvG1yU1Izerfn366VcPnkn//qEws7ZJJNVpImxvz2c=; b=jeOwKYxaFB0i2o6zsx4NJNiIkG40is5jVa8DBnOiOCn1jIDzaY6sdRxv02uZwTmRNk xOJS0YJaXvD4HxNFCtUPqfslZuFR6VfQoUrLl9cqZZuunhBrw9/rJIl9Ae/IFZBnW2lb e4EUxSTqvEljZTVSPVip3/Xeqd3jWwCAOypM/yCblzJw49iFwpJbQiEEx6NIDqdXJTX5 6T6Qm4uNw54EuvOQKaIU9kg1e9Vh7keD+JC8Pn0vQMDHxzKerDu063WzWq7aIWG8frWc uLa69dm1WINuA01CBJNmW8ZwIIui36KqLTGm4EbC8cLL196U6+Sc2nQypkdGbf335+Qg 3vhw== X-Gm-Message-State: AOAM5305Ho8FDC/ppW1hzmOYYDZ4d7I4/Tdqg5+IgspO59VpCzRqpmZB mRVOH/LbJUNA3s9eYlN8T74= X-Google-Smtp-Source: ABdhPJyeXTH8n96aCRQW1Vq7dQP+rgJhpE9nfCLlEtGyAXv8J8sQFhG2HeeBQZ5KQKUw2UghdfPSOA== X-Received: by 2002:aa7:da06:0:b0:42d:ca38:84ad with SMTP id r6-20020aa7da06000000b0042dca3884admr17886825eds.125.1654371182785; Sat, 04 Jun 2022 12:33:02 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-43.zg.cable.xnet.hr. [94.253.165.43]) by smtp.googlemail.com with ESMTPSA id fi26-20020a170906da1a00b00707d11fd421sm4133802ejb.107.2022.06.04.12.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jun 2022 12:33:02 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH 1/2] regulator: qcom_smd: add get_voltage to MP5496 Date: Sat, 4 Jun 2022 21:32:59 +0200 Message-Id: <20220604193300.125758-1-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add the get_voltage OP to MP5496 ops using the generic rpm_reg_get_voltage. Signed-off-by: Robert Marko --- drivers/regulator/qcom_smd-regulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index 8490aa8eecb1..5ec68250e79d 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c @@ -205,6 +205,7 @@ static const struct regulator_ops rpm_mp5496_ops = { .is_enabled = rpm_reg_is_enabled, .list_voltage = regulator_list_voltage_linear_range, + .get_voltage = rpm_reg_get_voltage, .set_voltage = rpm_reg_set_voltage, }; From patchwork Sat Jun 4 19:33:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12869656 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C812CCA47F for ; Sat, 4 Jun 2022 19:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241076AbiFDTej (ORCPT ); Sat, 4 Jun 2022 15:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241184AbiFDTeb (ORCPT ); Sat, 4 Jun 2022 15:34:31 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68473515B2; Sat, 4 Jun 2022 12:33:08 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id v25so14002169eda.6; Sat, 04 Jun 2022 12:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WxKcUIQwb5z9dv1oVEQrVZOBlfuJnhpz8hZ/k9iF5G4=; b=RUkawpieX2giKpETRhUFUtrwfwddVt81cvpKoiD7n0vafRc2vU839f2+qW4eXQkusS BB7Gz5uSBLKcKdIzrlbqcKjGKaldBKbCaBHeIpCJmPTdqrCzPZRSSIdSwRaGCew61YVu e5vDU+JOloXKGci6Hib7fZDpowgDe6z16ymJtWV+iy7l50aAH147DTFlNEbvmxOpnR2k 7XOzyqcLgeaOFQ+77kEibkk1q3l0xH+Wgi/EOTiKmZ2OhyORZpPnp2ZUnqQ8N2f1udtA 7XFel9R0kYVP8P6D7UHqXX7IO/4SG1pA2Jcqcg5ayHhYmatXjgFv8Zt1V5fDta0+XBlk IoHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WxKcUIQwb5z9dv1oVEQrVZOBlfuJnhpz8hZ/k9iF5G4=; b=43KASJ2DXCKLQrxf7Nuz1uOUlsD/O2oOje0uxybxtTi3uYDhtszFCBqV8uKESi1kAB QaMqhWorHxicwt0qhWxgPz5wksvNF7sa8E2v4/t0dNg/kIAGqpWuMX60Zbr6YSYfjA0H ao6Fm6KxYoR9Qss9bcLezRki15a8yFC2nI3uLva1V1QUVuOjMCjhF0kXcdDGwpY2BX66 bGs/X5qlidaPzCNFamPpajjtIKW3mbDkYg4JHPkdBSx5zFPyLuOadTQna+Hc53/+AMLT CjU3mHzgiOt0283BnwheD8UWXWuxrLR1mHmrRpwn4FlQpJzkZONyF2d8qRBIqxNPzUZR RU/Q== X-Gm-Message-State: AOAM532m8z43bn/BFdeKfV2aHSviJegRra6zw/0bUg5x3t7LJyTMRPdV z/c9e/hlOMHolS0PxTnB0Wea373qUEgBfw== X-Google-Smtp-Source: ABdhPJw+cz0ALmzikKXwM7MmQi1zQ+anjfcso0JLAyz5teJkI3dlw2NTkVSJXNHmstsydbZvHcTzwg== X-Received: by 2002:a05:6402:13d9:b0:42d:c97e:f9cf with SMTP id a25-20020a05640213d900b0042dc97ef9cfmr17406055edx.271.1654371183842; Sat, 04 Jun 2022 12:33:03 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-43.zg.cable.xnet.hr. [94.253.165.43]) by smtp.googlemail.com with ESMTPSA id fi26-20020a170906da1a00b00707d11fd421sm4133802ejb.107.2022.06.04.12.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jun 2022 12:33:03 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH 2/2] regulator: qcom_smd: correct MP5496 ranges Date: Sat, 4 Jun 2022 21:33:00 +0200 Message-Id: <20220604193300.125758-2-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220604193300.125758-1-robimarko@gmail.com> References: <20220604193300.125758-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Currently set MP5496 Buck and LDO ranges dont match its datasheet[1]. According to the datasheet: Buck range is 0.6-2.1875V with a 12.5mV step LDO range is 0.8-3.975V with a 25mV step. So, correct the ranges according to the datasheet[1]. [1] https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP5496GR/document_id/6906/ Signed-off-by: Robert Marko --- drivers/regulator/qcom_smd-regulator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index 5ec68250e79d..6c69359b3ef2 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c @@ -724,19 +724,19 @@ static const struct regulator_desc pms405_pldo600 = { static const struct regulator_desc mp5496_smpa2 = { .linear_ranges = (struct linear_range[]) { - REGULATOR_LINEAR_RANGE(725000, 0, 27, 12500), + REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500), }, .n_linear_ranges = 1, - .n_voltages = 28, + .n_voltages = 128, .ops = &rpm_mp5496_ops, }; static const struct regulator_desc mp5496_ldoa2 = { .linear_ranges = (struct linear_range[]) { - REGULATOR_LINEAR_RANGE(1800000, 0, 60, 25000), + REGULATOR_LINEAR_RANGE(800000, 0, 127, 25000), }, .n_linear_ranges = 1, - .n_voltages = 61, + .n_voltages = 128, .ops = &rpm_mp5496_ops, };