mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Roland Hieber <r.hieber@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Roland Hieber <r.hieber@pengutronix.de>
Subject: [PATCH v3 13/14] ARM: MXS: mxs_power_status: align output
Date: Mon, 13 Aug 2018 15:02:59 +0200	[thread overview]
Message-ID: <20180813130300.32497-14-r.hieber@pengutronix.de> (raw)
In-Reply-To: <20180813130300.32497-1-r.hieber@pengutronix.de>

Exemplary previous behaviour:

  vddio:  3100mV (BO -200mV), Linreg enabled, Linreg offset: -1, FET enabled
  vdda:   1800mV (BO -175mV), Linreg disabled, Linreg offset: -1, FET enabled
  vddd:   1200mV (BO -175mV), Linreg enabled, Linreg offset: -1, FET disabled
  vddmem: 1500mV (BO -25mV), Linreg disabled

After this patch this looks much cleaner:

  vddio:  3100mV (BO -200mV), Linreg  enabled, Linreg offset: -1, FET  enabled
  vdda:   1800mV (BO -175mV), Linreg disabled, Linreg offset: -1, FET  enabled
  vddd:   1200mV (BO -175mV), Linreg  enabled, Linreg offset: -1, FET disabled
  vddmem: 1500mV (BO - 25mV), Linreg disabled

Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
---
 arch/arm/mach-mxs/power-init.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-mxs/power-init.c b/arch/arm/mach-mxs/power-init.c
index b3b0db666f..ca7c349d7f 100644
--- a/arch/arm/mach-mxs/power-init.c
+++ b/arch/arm/mach-mxs/power-init.c
@@ -39,28 +39,28 @@ static void mxs_power_status(void)
 
 #define __REG_BITS(value, fieldname)  (((value) & fieldname##_MASK) >> fieldname##_OFFSET)
 
-	printf("vddio:  %dmV (BO -%dmV), Linreg enabled, Linreg offset: %d, FET %sabled\n",
+	printf("vddio:  %4dmV (BO -%3dmV), Linreg  enabled, Linreg offset: %1d, FET %sabled\n",
 			__REG_BITS(vddio, POWER_VDDIOCTRL_TRG) * 50 + 2800,
 			__REG_BITS(vddio, POWER_VDDIOCTRL_BO_OFFSET) * 50,
 			linregofs[__REG_BITS(vddio, POWER_VDDIOCTRL_LINREG_OFFSET)],
-			(vddio & POWER_VDDIOCTRL_DISABLE_FET) ? "dis" : "en");
-	printf("vdda:   %dmV (BO -%dmV), Linreg %sabled, Linreg offset: %d, FET %sabled\n",
+			(vddio & POWER_VDDIOCTRL_DISABLE_FET) ? "dis" : " en");
+	printf("vdda:   %4dmV (BO -%3dmV), Linreg %sabled, Linreg offset: %1d, FET %sabled\n",
 			__REG_BITS(vdda, POWER_VDDACTRL_TRG) * 25 + 1500,
 			__REG_BITS(vdda, POWER_VDDACTRL_BO_OFFSET) * 25,
-			(vdda & POWER_VDDACTRL_ENABLE_LINREG) ? "en" : "dis",
+			(vdda & POWER_VDDACTRL_ENABLE_LINREG) ? " en" : "dis",
 			linregofs[__REG_BITS(vdda, POWER_VDDACTRL_LINREG_OFFSET)],
-			(vdda & POWER_VDDACTRL_DISABLE_FET) ? "dis" : "en");
-	printf("vddd:   %dmV (BO -%dmV), Linreg %sabled, Linreg offset: %d, FET %sabled\n",
+			(vdda & POWER_VDDACTRL_DISABLE_FET) ? "dis" : " en");
+	printf("vddd:   %4dmV (BO -%3dmV), Linreg %sabled, Linreg offset: %1d, FET %sabled\n",
 			__REG_BITS(vddd, POWER_VDDDCTRL_TRG) * 25 + 800,
 			__REG_BITS(vddd, POWER_VDDDCTRL_BO_OFFSET) * 25,
-			(vddd & POWER_VDDDCTRL_ENABLE_LINREG) ? "en" : "dis",
+			(vddd & POWER_VDDDCTRL_ENABLE_LINREG) ? " en" : "dis",
 			linregofs[__REG_BITS(vddd, POWER_VDDDCTRL_LINREG_OFFSET)],
-			(vddd & POWER_VDDDCTRL_DISABLE_FET) ? "dis" : "en");
-	printf("vddmem: %dmV (BO -%dmV), Linreg %sabled\n",
+			(vddd & POWER_VDDDCTRL_DISABLE_FET) ? "dis" : " en");
+	printf("vddmem: %4dmV (BO -%3dmV), Linreg %sabled\n",
 			__REG_BITS(vddmem, POWER_VDDMEMCTRL_TRG) * 25 + 1100,
 			/* Note: this area is reserved on i.MX23, yielding 0: */
 			__REG_BITS(vddmem, MX28_POWER_VDDMEMCTRL_BO_OFFSET) * 25,
-			(vddmem & POWER_VDDMEMCTRL_ENABLE_LINREG) ? "en" : "dis");
+			(vddmem & POWER_VDDMEMCTRL_ENABLE_LINREG) ? " en" : "dis");
 }
 
 /*
-- 
2.18.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-08-13 13:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13 13:02 [PATCH v3 00/14] MXS low-level improvements Roland Hieber
2018-08-13 13:02 ` [PATCH v3 01/14] scripts: mxsimage: Allow unencrypted images Roland Hieber
2018-08-13 13:02 ` [PATCH v3 02/14] images: MXS: allow generation of unencrypted bootstreams Roland Hieber
2018-08-13 13:02 ` [PATCH v3 03/14] ARM: MXS: i.MX28: allow setup of low-voltage SDRAM Roland Hieber
2018-08-13 13:02 ` [PATCH v3 04/14] ARM: MXS: allow configuration of EMI clock prescaler Roland Hieber
2018-08-13 13:02 ` [PATCH v3 05/14] ARM: i.MX28: Add memory size detection Roland Hieber
2018-08-13 13:02 ` [PATCH v3 06/14] ARM: i.MX23: " Roland Hieber
2018-08-13 13:02 ` [PATCH v3 07/14] ARM: MXS: refactor mx2*_power_init source configuration Roland Hieber
2018-08-13 13:02 ` [PATCH v3 08/14] ARM: MXS: allow starting from battery input without 4P2 source enabled Roland Hieber
2018-08-13 13:02 ` [PATCH v3 09/14] ARM: MXS: make power levels configurable in mx2*_power_init Roland Hieber
2018-08-13 13:02 ` [PATCH v3 10/14] ARM: MXS: fix VDDx brownout setup logic Roland Hieber
2018-08-13 13:02 ` [PATCH v3 11/14] ARM: MXS: make VDDx brownout setup more understandable Roland Hieber
2018-08-13 13:02 ` [PATCH v3 12/14] ARM: MXS: mxs_power_status: use less magic values Roland Hieber
2018-08-13 13:02 ` Roland Hieber [this message]
2018-08-13 13:03 ` [PATCH v3 14/14] Documentation: MXS: general update and improvements Roland Hieber
2018-08-14  6:55 ` [PATCH v3 00/14] MXS low-level improvements Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180813130300.32497-14-r.hieber@pengutronix.de \
    --to=r.hieber@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox