Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4758114ooa; Tue, 14 Aug 2018 10:08:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyVLUorazOEuxdsf1vTPLm8Wl300eL8HIiVokd/GJrzzn7xKFAfIH96seMga3wEkWuGycku X-Received: by 2002:a17:902:bf06:: with SMTP id bi6-v6mr21492042plb.76.1534266500476; Tue, 14 Aug 2018 10:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534266500; cv=none; d=google.com; s=arc-20160816; b=EgksDi+A8sxCTHEgykHnSUXsrMRJnOII54zD4Wy8r/SbRFBk092wsVEVsvAddxByMf bSPeTN6vLyavw6cUfBTtnrFrE9ykcyBJyHx6UEuYTzZEV2Ageggvlj/DNyjHNfd44kcl XDunr33/N0dPNG/l7VBYB22SdOGejQwlCG4ObZD0Ns6jiN6t2PIKY3e6G+oXPEUbJtVB Zm3gby69cuOmNRAndlWoTsPSNSf0n+u721t2BXogzrza8qF4cYoaxFbdX0SUimmBEaF5 qyNAMGsU+YLwD4KL1bKR5XpfjbWSVENJfsRKzrfiilB++PjAgL/udGmVDieDR7KGhxse MgPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=sGksIB8cizHaKApnUuX97vs90VO3iPXhSR8JaN7x2IY=; b=o50pMrUL4aqTcluudYgrbGwXzOCq1kzJrQmHKABR5l6YswK/v6VaWbsu5jSuAFCTUK lSJ+gSiEG5a1f3LyWjWwFmUBf1T0BGE5E1KorNg/lJ9BKuJCi2+8lzOpdaS78VlK9w8Y 6pH3xmP6z39t1nx3siBksNFIN7dj5rfMzVMqSDmgS8/gNgXBv+cxiTJgcMXEViorvbeE 7R7jzwG/L7RQBOHOjUP40fxD1R30lpRd35UZ/3J+BL2DxEO2MP6pM7sN2bCj5fbdrL4B HwMYlfU1+L+FUNOU3kU1bWrajd1o22xOwK2wMjHi8XWx/eHyMnXD5MzH4QWNRdyC5dt4 efag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jVNUuhuL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26-v6si20714249pgb.349.2018.08.14.10.08.05; Tue, 14 Aug 2018 10:08:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jVNUuhuL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387663AbeHNTy5 (ORCPT + 99 others); Tue, 14 Aug 2018 15:54:57 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:40689 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387621AbeHNTy4 (ORCPT ); Tue, 14 Aug 2018 15:54:56 -0400 Received: by mail-pl0-f68.google.com with SMTP id s17-v6so8561330plp.7 for ; Tue, 14 Aug 2018 10:06:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sGksIB8cizHaKApnUuX97vs90VO3iPXhSR8JaN7x2IY=; b=jVNUuhuLaWAUk3mi7QZkJiZY6h5l7ESWMHbmr57casDI1YZPMFj/AhbQ9IUXs4rAfF z5txz22DhcqC3J/D+h566gKxXRo+kgsz58HycewKR1jwrBWWUEVvyuZm8l7KwHno/75P 5n76nx20yMVukneKSO2SeJAVkXU5f1W9E4M9c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sGksIB8cizHaKApnUuX97vs90VO3iPXhSR8JaN7x2IY=; b=tmEkEBjE+EbI00TDvnbjEEcT5F1uKclP3RCk3EwS0/OTFtp43Yzna6V5r6mr5mHRa9 f555MY86+SHSrfRvnYy2QB7ZDzsrB1rNAHaUk9U+feT3sZMQ3qycYOriv6RZ7b602egP TqRe6jWRmFdI7ixWN5sjcHUZhZiGRdbX2HCS1u25yB/Ml07Ihk85m3eRwnCb/FGEHQAe qtcV7PWgeX0Ks03Ciy2UsJXVBmodm3ieVgNzeBYomYQnqgb1QZTnlf1oDcjTFbAj2L7s rrfWmEjHexmc5FxiOZvbDqj5SdaEpCkj6/8wvw9wQH2d4qjWRZoH58ReZiQIediuZSNT 6e8Q== X-Gm-Message-State: AOUpUlGuMF+g5d+cE4deWJFf/1DDYfQLMY+ix2Bw9tyttn1thNOBhn8Z oqaeqbgiVrk3nB0t1drGVuilig== X-Received: by 2002:a17:902:8f8c:: with SMTP id z12-v6mr20890675plo.4.1534266416567; Tue, 14 Aug 2018 10:06:56 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:c8e0:70d7:4be7:a36]) by smtp.gmail.com with ESMTPSA id d19-v6sm67940763pfe.42.2018.08.14.10.06.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 10:06:55 -0700 (PDT) From: Douglas Anderson To: broonie@kernel.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, collinsd@codeaurora.org, swboyd@chromium.org, Douglas Anderson , Liam Girdwood , linux-kernel@vger.kernel.org Subject: [PATCH 3/4] regulator: core: Add consumer-requested load in regulator_summary Date: Tue, 14 Aug 2018 10:06:16 -0700 Message-Id: <20180814170617.100087-4-dianders@chromium.org> X-Mailer: git-send-email 2.18.0.865.gffc8e1a3cd6-goog In-Reply-To: <20180814170617.100087-1-dianders@chromium.org> References: <20180814170617.100087-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's handy to see the load requested by a regulator consumer in the regulator_summary. Add it. Since this patch comes after the patch ("regulator: core: If consumers don't call regulator_set_load() assume max") we'll also differentiate between the case where a consumer hasn't called regulator_set_load() and the case where a consumer called it but the load is currently 0 mA. Signed-off-by: Douglas Anderson --- drivers/regulator/core.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index b8b8048efbdd..23f64faa6961 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4709,9 +4709,16 @@ static void regulator_summary_show_subtree(struct seq_file *s, switch (rdev->desc->type) { case REGULATOR_VOLTAGE: - seq_printf(s, "%45dmV %5dmV", - consumer->voltage[PM_SUSPEND_ON].min_uV / 1000, - consumer->voltage[PM_SUSPEND_ON].max_uV / 1000); + if (consumer->uA_load_set) { + seq_printf(s, "%37dmA %5dmV %5dmV", + consumer->uA_load / 1000, + consumer->voltage[PM_SUSPEND_ON].min_uV / 1000, + consumer->voltage[PM_SUSPEND_ON].max_uV / 1000); + } else { + seq_printf(s, "%45dmV %5dmV", + consumer->voltage[PM_SUSPEND_ON].min_uV / 1000, + consumer->voltage[PM_SUSPEND_ON].max_uV / 1000); + } break; case REGULATOR_CURRENT: break; -- 2.18.0.865.gffc8e1a3cd6-goog