[PATCH v3 0/2] clk: fractional-divider: Improve approximation when zero based

From: Frank Oltmanns
Date: Wed Jun 14 2023 - 14:55:45 EST


I stumpled upon this, when familiarizing myself with clk drivers.
Unfortunately, I have no boards to test this patch. It seems the only
user of this flag in mainline is drivers/clk/imx/clk-composite-7ulp.c,
therefore I'm cc-ing
get_maintainers.pl --git-blame -f drivers/clk/imx/clk-composite-7ulp.c
in the hopes of a wider audience.

V2: https://lore.kernel.org/lkml/20230613083626.227476-1-frank@xxxxxxxxxxxx/
V1: https://lore.kernel.org/lkml/20230529133433.56215-1-frank@xxxxxxxxxxxx/

Changes since V2:
- Completely reworked the test cases
- Moved tests to separate file as per Stephen's request
- Move each edge case into their individual test case as per
Stephen's request
- Test clk_fd_round_rate instead of
clk_fractional_divider_general_approximation as testing the latter
broke builds

Changes since V1:
- Added test case as requested by Stephen Boyd
- Fixed commit message as the Cc: was missing a closing bracket, so that the
original mail unfortunately did not go out to A. s. Dong.

Thank you for considering this contribution,
Frank

Frank Oltmanns (2):
clk: fractional-divider: Improve approximation when zero based
clk: fractional-divider: tests: Add test suite for edge cases

drivers/clk/.kunitconfig | 1 +
drivers/clk/Kconfig | 7 +
drivers/clk/Makefile | 1 +
drivers/clk/clk-fractional-divider.c | 26 ++-
drivers/clk/clk-fractional-divider_test.c | 196 ++++++++++++++++++++++
5 files changed, 224 insertions(+), 7 deletions(-)
create mode 100644 drivers/clk/clk-fractional-divider_test.c

--
2.41.0