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: 12936447 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 9CCAEC25B06 for ; Thu, 4 Aug 2022 14:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240075AbiHDOjv (ORCPT ); Thu, 4 Aug 2022 10:39:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240002AbiHDOja (ORCPT ); Thu, 4 Aug 2022 10:39:30 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E79174E623 for ; Thu, 4 Aug 2022 07:39:26 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id e8-20020a17090a280800b001f2fef7886eso5849918pjd.3 for ; Thu, 04 Aug 2022 07:39:26 -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=V0S/G9fkUZLCC6H6Ti9OhWc4F1dSCYiPxRLiAkVbBx4upbLIo/1ms9RM9sRFRvkVYb 5tVxSUnxuz8DiQ6QZeAyP+h6j2Yrayw2G6SxKMrA/SvyI3812zxIpFiTQl9As7T+LqAv mAarizE8QAzSacsZ7gpDj+epBkk/L/21rKHBhD7uYj1ZzWRCtHXLP86j8PGCfcyhz51D OhFFXdcLDerJlLCN98NMqwdGMSMze4/ZzVFGgL26oZtQh0tN9Aj4hBQw/o+yw0EMPKFT 1P++msrCHNSqp/hUS2jZ1Ms9wHMIzTr8SLO6M8E3SDFnF1g0vWIj3kufGosyVWyILN+I tV5g== X-Gm-Message-State: ACgBeo1b3qN5fX4YHUx7vgCfXPabDLlzL8PhYOTP0mV6Wj2plMvF4g5r 1zksVX3fOixmN6A+eZyV1zFUUg== 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 Cc: Mark Brown , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Douglas Anderson , Daniel Vetter , David Airlie , Jonathan Marek , Rajeev Nandan , Sean Paul , Stephen Boyd , Vinod Koul , Vladimir Lypak , linux-kernel@vger.kernel.org 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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; }