From patchwork Sun May 15 20:31:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 572809 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 2EC43C433F5 for ; Sun, 15 May 2022 20:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236745AbiEOUb3 (ORCPT ); Sun, 15 May 2022 16:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233179AbiEOUbZ (ORCPT ); Sun, 15 May 2022 16:31:25 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB095FB5; Sun, 15 May 2022 13:31:23 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id y21so15979028edo.2; Sun, 15 May 2022 13:31:23 -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=oIDUTK5KnimKV7JPutWUmQpjQBhC0JH0W89/0KDYnjU=; b=JPX+v4vULFUBp68FIay0x+aQNSp90Bl4RKUV5uiaMUeZLnWH6Rrd4mqjDDt6R/HBAd UWcOCQeRoPHZ8hYIycyTKf9vssyyUGae6CHYB7WObBe0trf8+e8pzL1f6yHLGoU+ZU2h 5bTfxbOOPyUcYxdPUtuE62ohQZU8jAcG0rWSam6EpW7/1NiR0uHnG6LfU542eGys1KjG yek5OvDviVsOE+0X875PU64L5UEp98fxT1abvOwfCEu2PH8nGpzgP7RHSNqfqyGY6jcz FXWji9zfC0hHpgZteZ6wKFutF7zMNkGbkt+MopgoKPTscEgcW9aFtxLghRHV/W/vbttZ HXBQ== 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=oIDUTK5KnimKV7JPutWUmQpjQBhC0JH0W89/0KDYnjU=; b=xzYFdlBx6uyssX6cIPI79jAscpm6wh7bGwFB2X2RfphtZEZnCrsf6ZXlH7es5OPgdl G1JBD1os/mG/SYbysKtDOVXeBAxrZvqz1EOXeElafR7LX+9F44KVQqjf37ce79JUztQK ozMdVRzjECxKUTA7fpgyt4HT2LaURAiJe4Y+C9YsvpotbZoavbFlcSVFrerekPdUqMu8 DwWU45R9WbXW2taaFL6Yk1Ew5VQ4gfkjpipHQ6wr03bZ1SYAbvrwOmmHQ54FuKxZwij4 ujV6OShKh8K2yNl+UHo4IGrFLT8G0V39NIKaIVMETL9B3NsczlpUrHJdInacQMUE5DdB aYjg== X-Gm-Message-State: AOAM532kS9KsnJCjAE4yTJ6bevcgAEnyO4n+364UuRDQXsXHwJ4MJWcn Ys/v4bEO4T2Jn6EQDHFD+Ow= X-Google-Smtp-Source: ABdhPJzhYQx51/jgjxFRkreUSKfXrtPv1emyMvjQDq7CKL4SZgBgjJBcRXXxZ0bl/lN2DGl/wK0ZZg== X-Received: by 2002:a05:6402:2926:b0:42a:ab8a:edf2 with SMTP id ee38-20020a056402292600b0042aab8aedf2mr4363780edb.190.1652646682298; Sun, 15 May 2022 13:31:22 -0700 (PDT) Received: from fedora.robimarko.hr (dh207-98-105.xnet.hr. [88.207.98.105]) by smtp.googlemail.com with ESMTPSA id ze16-20020a170906ef9000b006f3ef214e4esm2944884ejb.180.2022.05.15.13.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 May 2022 13:31:21 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Robert Marko Subject: [PATCH 2/6] regulator: qcom_spmi: add support for HT_P150 Date: Sun, 15 May 2022 22:31:14 +0200 Message-Id: <20220515203118.474684-2-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220515203118.474684-1-robimarko@gmail.com> References: <20220515203118.474684-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org HT_P150 is a LDO PMOS regulator based on LV P150 using HFS430 layout found in PMP8074 and PMS405 PMIC-s. Both PMP8074 and PMS405 define the programmable range as 1.616V to 3.304V but the actual MAX output voltage depends on the exact LDO in each of the PMIC-s. It has a max current of 150mA, voltage step of 8mV. Signed-off-by: Robert Marko --- drivers/regulator/qcom_spmi-regulator.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c index 02bfce981150..38bbc70241ae 100644 --- a/drivers/regulator/qcom_spmi-regulator.c +++ b/drivers/regulator/qcom_spmi-regulator.c @@ -164,6 +164,7 @@ enum spmi_regulator_subtype { SPMI_REGULATOR_SUBTYPE_ULT_HF_CTL3 = 0x0f, SPMI_REGULATOR_SUBTYPE_ULT_HF_CTL4 = 0x10, SPMI_REGULATOR_SUBTYPE_HFS430 = 0x0a, + SPMI_REGULATOR_SUBTYPE_HT_P150 = 0x35, }; enum spmi_common_regulator_registers { @@ -544,6 +545,10 @@ static struct spmi_voltage_range hfs430_ranges[] = { SPMI_VOLTAGE_RANGE(0, 320000, 320000, 2040000, 2040000, 8000), }; +static struct spmi_voltage_range ht_p150_ranges[] = { + SPMI_VOLTAGE_RANGE(0, 1616000, 1616000, 3304000, 3304000, 8000), +}; + static DEFINE_SPMI_SET_POINTS(pldo); static DEFINE_SPMI_SET_POINTS(nldo1); static DEFINE_SPMI_SET_POINTS(nldo2); @@ -564,6 +569,7 @@ static DEFINE_SPMI_SET_POINTS(nldo660); static DEFINE_SPMI_SET_POINTS(ht_lvpldo); static DEFINE_SPMI_SET_POINTS(ht_nldo); static DEFINE_SPMI_SET_POINTS(hfs430); +static DEFINE_SPMI_SET_POINTS(ht_p150); static inline int spmi_vreg_read(struct spmi_regulator *vreg, u16 addr, u8 *buf, int len) @@ -1458,6 +1464,7 @@ static const struct regulator_ops spmi_hfs430_ops = { static const struct spmi_regulator_mapping supported_regulators[] = { /* type subtype dig_min dig_max ltype ops setpoints hpm_min */ + SPMI_VREG(LDO, HT_P150, 0, INF, HFS430, hfs430, ht_p150, 10000), SPMI_VREG(BUCK, GP_CTL, 0, INF, SMPS, smps, smps, 100000), SPMI_VREG(BUCK, HFS430, 0, INF, HFS430, hfs430, hfs430, 10000), SPMI_VREG(LDO, N300, 0, INF, LDO, ldo, nldo1, 10000),