From patchwork Thu Aug 4 14:38:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12936451 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 F114EC19F2A for ; Thu, 4 Aug 2022 14:40:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8227999E29; Thu, 4 Aug 2022 14:39:48 +0000 (UTC) Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8063C99473 for ; Thu, 4 Aug 2022 14:39:27 +0000 (UTC) Received: by mail-pl1-x636.google.com with SMTP id x23so44566pll.7 for ; Thu, 04 Aug 2022 07:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=TIL4a15Tear7wqoyrS0QJFyJN6mV7W482wt1Z99mhWE=; b=ifuF0R5Bm5ESJe+THOczxbs9o+TODhu42iDzd7OZtQ+eADUwBlb4PID/+60b15Tnde 8sygYfuzlbi0T9PjGKep+CG1vcBq8VPN+hj7yfUeeJgEx5Y8zdMsb7QMUSwGYfigJ9cd zoOjLxet1NYfx/YPF3PwEv0hk31xJpYQFVJD8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=TIL4a15Tear7wqoyrS0QJFyJN6mV7W482wt1Z99mhWE=; b=wVfnn3uo4bccjwDwaPkDnkAiXWUr1vkVi55Kxp4tF8BT/IN7btAAGDrNiUXra43fVx JXhWLybJRmzK3k+zkr7bRC6JraOX5J6i2sBOuKVFMH3vF+YHISuYAamu15gGTlIFsfQV UXTjO/5wuhCQ2TKkQBix5B8iwZ+aIvVY2CA11F+AffRiGybwCinKIOviAh5lzW4FMBKa fD5dVXCW2j0H3PEyDSAFW349m/lm4kgNBk1myBvgcZbBOoHhpJegc14O+TDWjleZvpvK CNjABdrZ8a0U7mbcAfve42KuJlUzwQ3ehhB5QT8yX6RMcGAddCGJk2XniFkixwHPtwET mptg== X-Gm-Message-State: ACgBeo1r1HsNZG20oOrARW2TksToz/piJyZsbz46aJxv4PpA7fb5SC86 a9GjmEalPLqvi5xuJh0pOS9Xjw== X-Google-Smtp-Source: AA6agR4Dlj4ARF0GtPX1pdHejOAKxewL+VkYltn+zaqj/m3u8XwAM4OgPNOgmQgqDKQq01Dc+zhnrA== X-Received: by 2002:a17:90b:1d8e:b0:1f5:525d:4d90 with SMTP id pf14-20020a17090b1d8e00b001f5525d4d90mr7168029pjb.126.1659623966333; Thu, 04 Aug 2022 07:39:26 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:aa71:2553:6f54:5cb1]) by smtp.gmail.com with ESMTPSA id h7-20020a170902680700b0016a111c83cdsm1075071plk.119.2022.08.04.07.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:39:25 -0700 (PDT) From: Douglas Anderson To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov Subject: [PATCH v4 4/6] drm/msm/dsi: Use the new regulator bulk feature to specify the load Date: Thu, 4 Aug 2022 07:38:51 -0700 Message-Id: <20220804073608.v4.4.I7b3c72949883846badb073cfeae985c55239da1d@changeid> X-Mailer: git-send-email 2.37.1.455.g008518b4e5-goog In-Reply-To: <20220804143854.1544395-1-dianders@chromium.org> References: <20220804143854.1544395-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul , Jonathan Marek , David Airlie , linux-arm-msm@vger.kernel.org, Vladimir Lypak , Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd , Vinod Koul , Mark Brown , Rajeev Nandan , freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" As of commit 6eabfc018e8d ("regulator: core: Allow specifying an initial load w/ the bulk API") we can now specify the initial load in the bulk data rather than having to manually call regulator_set_load() on each regulator. Let's use it. Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- (no changes since v3) Changes in v3: - Update commit message to point at the git hash of the regulator change. Changes in v2: - ("Use the new regulator bulk feature to specify the load") new for v2. drivers/gpu/drm/msm/dsi/dsi_host.c | 13 +++---------- drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 13 +++---------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 9df278d39559..a0a1b6d61d05 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -260,8 +260,10 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host) int num = msm_host->cfg_hnd->cfg->reg_cfg.num; int i, ret; - for (i = 0; i < num; i++) + for (i = 0; i < num; i++) { s[i].supply = regs[i].name; + s[i].init_load_uA = regs[i].enable_load; + } ret = devm_regulator_bulk_get(&msm_host->pdev->dev, num, s); if (ret < 0) { @@ -270,15 +272,6 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host) return ret; } - for (i = 0; i < num; i++) { - if (regs[i].enable_load >= 0) { - ret = regulator_set_load(s[i].consumer, - regs[i].enable_load); - if (ret < 0) - return ret; - } - } - return 0; } diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c index 7c105120d73e..efb6b1726cdb 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c @@ -515,8 +515,10 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy) int num = phy->cfg->reg_cfg.num; int i, ret; - for (i = 0; i < num; i++) + for (i = 0; i < num; i++) { s[i].supply = regs[i].name; + s[i].init_load_uA = regs[i].enable_load; + } ret = devm_regulator_bulk_get(dev, num, s); if (ret < 0) { @@ -529,15 +531,6 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy) return ret; } - for (i = 0; i < num; i++) { - if (regs[i].enable_load >= 0) { - ret = regulator_set_load(s[i].consumer, - regs[i].enable_load); - if (ret < 0) - return ret; - } - } - return 0; }