linux/drivers/clk
Mike Looijmans 4d3f36c5e9 clk-si544: Properly round requested frequency to nearest match
The si544 driver had a rounding problem that using the result of clk_round_rate
may set the clock to yet another rate, for example:
clk_round_rate(195000000) = 194999999
clk_round_rate(194999999) = 194999998

Clients would expect that after clk_set_rate(clk, freq2=clk_round_rate(clk, freq)) the
chip will be running at exactly freq2.

The problem was in the calculation of the feedback divider, it was always rounded
down instead of to the nearest possible VCO value.

After this change, the following holds true for any supported frequency:
actual_freq = clk_round_rate(clk, freq);
clk_set_rate(clk, actual_freq);
clk_round_rate(clk, actual_freq) == actual_freq && clk_get_rate(clk) == actual_freq

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Fixes: 953cc3e811 ("clk: Add driver for the si544 clock generator chip")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2018-06-01 23:24:52 -07:00
..
at91 clk: at91: pmc: Support backup for programmable clocks 2017-12-21 16:34:06 -08:00
axis
axs10x
bcm The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
berlin
davinci clk: davinci: add a reset lookup table for psc0 2018-04-06 13:37:19 -07:00
h8300 clk: h8300: pr_err() strings should end with newlines 2017-12-06 22:40:02 -08:00
hisilicon The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
imgtec
imx The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
ingenic clk: Add Ingenic jz4770 CGU driver 2018-01-18 22:05:55 +00:00
keystone clk: keystone: sci-clk: add support for dynamically probing clocks 2018-03-08 11:43:15 +02:00
loongson1
mediatek Merge branches 'clk-mediatek', 'clk-hisi', 'clk-allwinner', 'clk-ux500' and 'clk-renesas' into clk-next 2018-04-06 13:21:57 -07:00
meson clk: meson: Drop unused local variable and add static 2018-03-14 15:36:31 -07:00
microchip
mmp We have two changes to the core framework this time around. The first being a 2017-11-17 20:04:24 -08:00
mvebu clk: mvebu: armada-38x: add support for missing clocks 2018-03-19 13:53:57 -07:00
mxs
nxp clk: lpc32xx: Set name of regmap_config 2018-03-19 14:35:16 -07:00
pistachio
pxa clk: pxa: unbreak lookup of CLK_POUT 2017-12-28 10:43:30 -08:00
qcom The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
renesas clk: renesas: Updates for v4.17 (take two) 2018-03-23 09:40:52 -07:00
rockchip clk: rockchip: assign correct id for pclk_ddr and hclk_sd in rk3399 2018-03-23 09:09:19 +01:00
samsung clk: samsung: Mark a few things static 2018-03-16 09:23:17 -07:00
sirf We have two changes to the core framework this time around. The first being a 2017-11-17 20:04:24 -08:00
socfpga clk: socfpga: stratix10: add clock driver for Stratix10 platform 2018-04-06 10:12:35 -07:00
spear SPEAr: clk: pr_err() strings should end with newlines 2017-12-06 22:39:59 -08:00
sprd clk: sprd: add RTC gate for SC9860 2018-03-16 15:53:30 -07:00
st
sunxi The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
sunxi-ng The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
tegra clk: tegra: Fix pll_u rate configuration 2018-03-12 13:59:06 +01:00
ti The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
uniphier clk: uniphier: add additional ethernet clock lines for Pro4 2018-04-05 15:03:51 -07:00
ux500 clk: ux500: Drop AB8540/9540 support 2018-03-23 09:36:11 -07:00
versatile clk: versatile: Remove WARNs in ->round_rate() 2018-03-16 15:31:16 -07:00
x86
zte clk: move clock common macros out from vendor directories 2017-12-21 15:00:38 -08:00
zynq
clk-asm9260.c
clk-aspeed.c clk: aspeed: Prevent reset if clock is enabled 2018-03-15 11:13:49 -07:00
clk-axi-clkgen.c clk: axi-clkgen: Round closest in round_rate() and recalc_rate() 2017-12-21 18:07:53 -08:00
clk-axm5516.c
clk-bulk.c
clk-cdce706.c
clk-cdce925.c clk: cdce925: remove redundant check for non-null parent_name 2017-11-13 17:44:15 -08:00
clk-clps711x.c
clk-composite.c
clk-conf.c
clk-cs2000-cp.c clk: cs2000: set pm_ops in hibernate-compatible way 2018-04-06 11:22:44 -07:00
clk-devres.c
clk-divider.c clk: divider: read-only divider can propagate rate change 2018-03-12 15:10:26 -07:00
clk-efm32gg.c
clk-fixed-factor.c
clk-fixed-rate.c
clk-fractional-divider.c
clk-gate.c
clk-gemini.c
clk-gpio.c clk: clk-gpio: Allow GPIO to sleep in set/get_parent 2018-03-19 13:53:08 -07:00
clk-hi655x.c
clk-highbank.c
clk-hsdk-pll.c ARC: clk: fix spelling mistake: "configurarion" -> "configuration" 2017-11-13 17:44:26 -08:00
clk-max77686.c
clk-moxart.c
clk-multiplier.c
clk-mux.c clk: mux: add helper function for index/value translation 2018-03-12 15:10:23 -07:00
clk-nomadik.c
clk-nspire.c
clk-oxnas.c
clk-palmas.c
clk-pwm.c
clk-qoriq.c clk: qoriq: add more divider clocks support 2017-12-21 15:57:28 -08:00
clk-rk808.c
clk-s2mps11.c
clk-scmi.c clk: scmi: use devm_of_clk_add_hw_provider() API and drop scmi_clocks_remove 2018-03-20 16:23:26 +00:00
clk-scpi.c
clk-si514.c
clk-si544.c clk-si544: Properly round requested frequency to nearest match 2018-06-01 23:24:52 -07:00
clk-si570.c
clk-si5351.c clk: si5351: _si5351_clkout_reset_pll() can be static 2017-12-28 10:49:48 -08:00
clk-si5351.h
clk-stm32f4.c clk: stm32: Add clk entry for SDMMC2 on stm32F769 2018-03-19 13:46:07 -07:00
clk-stm32h7.c clk: stm32-h7: fix copyright 2017-12-06 23:07:34 -08:00
clk-stm32mp1.c clk: stm32mp1: add Debug clocks 2018-03-11 15:40:34 -07:00
clk-tango4.c
clk-twl6040.c
clk-u300.c clk: clk-u300: Fix a typo in two comment lines 2017-11-13 17:39:43 -08:00
clk-versaclock5.c
clk-vt8500.c
clk-wm831x.c
clk-xgene.c clk: clk-xgene: Adjust six checks for null pointers 2017-11-13 17:40:03 -08:00
clk.c Merge branches 'clk-mvebu', 'clk-phase', 'clk-nxp', 'clk-mtk2712' and 'clk-qcom-rpmcc' into clk-next 2018-04-06 13:21:52 -07:00
clk.h clk: Move __clk_{get,put}() into private clk.h API 2018-01-04 15:13:29 -08:00
clkdev.c clk: Prepare to remove asm-generic/clkdev.h 2018-01-02 16:12:00 -08:00
Kconfig The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
Makefile The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00