aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-loongson.c
Commit message (Collapse)AuthorAgeFilesLines
* pwm: loongson: Fix an error code in probe()Dan Carpenter2025-04-171-1/+1
| | | | | | | | | | | There is a copy and paste bug so we accidentally returned PTR_ERR(ddata->clk) instead of "ret". Fixes: 2b62c89448dd ("pwm: Add Loongson PWM controller support") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Binbin Zhou <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
* pwm: loongson: Fix u32 overflow in waveform calculationUwe Kleine-König2025-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | mul_u64_u64_div_u64() returns an u64 that might be bigger than U32_MAX. To properly handle this case it must not be directly assigned to an u32 value. Use a wider type for duty and period to make the idiom: duty = mul_u64_u64_div_u64(...) if (duty > U32_MAX) duty = U32_MAX; actually work as intended. Reported-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 2b62c89448dd ("pwm: Add Loongson PWM controller support") Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Binbin Zhou <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
* pwm: Add Loongson PWM controller supportBinbin Zhou2025-04-141-0/+290
This commit adds a generic PWM framework driver for the PWM controller found on Loongson family chips. Acked-by: Huacai Chen <[email protected]> Co-developed-by: Juxin Gao <[email protected]> Signed-off-by: Juxin Gao <[email protected]> Signed-off-by: Binbin Zhou <[email protected]> Link: https://lore.kernel.org/r/76050a903a8015422fb9261ad88c7d9cc2edbbd8.1743403075.git.zhoubinbin@loongson.cn Signed-off-by: Uwe Kleine-König <[email protected]>