summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoy Cho <joy.cho@hardkernel.com>2020-10-21 11:05:44 +0300
committerJoy Cho <joy.cho@hardkernel.com>2020-12-02 10:32:06 +0300
commita029d7e75b278b7c713da0fa16498017db1e50c0 (patch)
tree5ca60d95c5a026cf3f6fef6eadee7a1bb3201d11
parent1dd01a6e6bdbf1a652743fb0e0a98268ad27746b (diff)
downloadu-boot-a029d7e75b278b7c713da0fa16498017db1e50c0.tar.xz
cmd/odroidtest: Fix backlight duty calculation error
Change-Id: I6cc5df6b9815a10c6166ec44e4188b644c7b168f
-rw-r--r--cmd/odroidtest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/odroidtest.c b/cmd/odroidtest.c
index 7e0055f9eb..018b3e7548 100644
--- a/cmd/odroidtest.c
+++ b/cmd/odroidtest.c
@@ -555,9 +555,9 @@ static int do_odroidtest_backlight(cmd_tbl_t * cmdtp, int flag,
while (1) {
period_ns = 25000;
#ifdef CONFIG_TARGET_ODROIDGO3
- duty_ns = period_ns * (active[loop] / 100) * (BL_OGA_MAX_LEVEL / BL_MAX_LEVEL);
+ duty_ns = period_ns * active[loop] / 100 * BL_OGA_MAX_LEVEL / BL_MAX_LEVEL;
#else
- duty_ns = period_ns * (active[loop] / 100);
+ duty_ns = period_ns * active[loop] / 100;
#endif
printf("active percentage %d, duty_ns %d\n", active[loop], duty_ns);
lcd_printf(0, 8 + yoffs, 1, "PERCENTAGE : %d %", active[loop]);
@@ -595,7 +595,7 @@ static int do_odroidtest_backlight(cmd_tbl_t * cmdtp, int flag,
#ifdef CONFIG_TARGET_ODROIDGO3
/* set backlight as default */
- duty_ns = period_ns * (BL_OGA_DEFAULT_LEVEL / BL_MAX_LEVEL);
+ duty_ns = period_ns * BL_OGA_DEFAULT_LEVEL / BL_MAX_LEVEL;
pwm_set_config(dev, 1, period_ns, duty_ns);
#else
/* set backlight as max */