Skip to content
Commit b05d3946 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Johan Hovold
Browse files

leds: qcom-lpg: Fix PWM period limits

The introduction of high resolution PWM support changed the order of the
operations in the calculation of min and max period. The result in both
divisions is in most cases a truncation to 0, which limits the period to
the range of [0, 0].

Both numerators (and denominators) are within 64 bits, so the whole
expression can be put directly into the div64_u64, instead of doing it
partially.

Fixes: b00d2ed3

 ("leds: rgb: leds-qcom-lpg: Add support for high resolution PWM")
Reviewed-by: default avatarCaleb Connolly <caleb.connolly@linaro.org>
Tested-by: default avatarSteev Klimaszewski <steev@kali.org>
Signed-off-by: default avatarBjorn Andersson <quic_bjorande@quicinc.com>
Acked-by: default avatarLee Jones <lee@kernel.org>
Tested-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
Link: https://lore.kernel.org/r/20230515162604.649203-1-quic_bjorande@quicinc.com


Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 7877cb91
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment