ANDROID: fix bad revert of "FROMLIST: pwm: Convert period and duty cycle to u64"

This fixes a bad revert of a FROMLIST patch which got upstreamed in a
slightly different form.

This makes the code match upstream.

Fixes: fd0cd97281 ("Revert "FROMLIST: pwm: Convert period and duty cycle to u64"")
Change-Id: Ic5e7289d9cbf2c93e0982d02c7d3a79ebffa06b8
Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
Eric Biggers 2020-07-13 19:44:25 -07:00
parent 183a328739
commit 44a98b30ed
2 changed files with 5 additions and 6 deletions

View File

@ -1929,11 +1929,10 @@ static int pwm_setup_backlight(struct intel_connector *connector,
return retval;
}
panel->backlight.min = 0; /* 0% */
panel->backlight.max = 100; /* 100% */
panel->backlight.level = DIV_ROUND_UP(
pwm_get_duty_cycle(panel->backlight.pwm) * 100,
CRC_PMIC_PWM_PERIOD_NS);
level = DIV_ROUND_UP(pwm_get_duty_cycle(panel->backlight.pwm) * 100,
CRC_PMIC_PWM_PERIOD_NS);
panel->backlight.level =
intel_panel_compute_brightness(connector, level);
panel->backlight.enabled = panel->backlight.level != 0;
drm_info(&dev_priv->drm, "Using %s PWM for LCD backlight control\n",

View File

@ -241,7 +241,7 @@ static int ir_rx51_probe(struct platform_device *dev)
}
/* Use default, in case userspace does not set the carrier */
ir_rx51.freq = DIV_ROUND_CLOSEST(pwm_get_period(pwm), NSEC_PER_SEC);
ir_rx51.freq = DIV_ROUND_CLOSEST_ULL(pwm_get_period(pwm), NSEC_PER_SEC);
pwm_put(pwm);
hrtimer_init(&ir_rx51.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);