]> git.baikalelectronics.ru Git - uboot.git/commit
serial: mtk: add support for using dynamic baud clock souce
authorWeijie Gao <weijie.gao@mediatek.com>
Fri, 9 Sep 2022 11:59:31 +0000 (19:59 +0800)
committerTom Rini <trini@konsulko.com>
Fri, 23 Sep 2022 19:09:15 +0000 (15:09 -0400)
commit571093a9b50f7e4b967a1e592cb883a53d1fee67
treede07f246f735beac5e7747ea96dfd58a72a06f18
parent9f88374cedbe2288aec1a67bbf657bf507327e35
serial: mtk: add support for using dynamic baud clock souce

The baud clock on some platform may change due to assigned-clock-parent
set in DT. In current flow the baud clock is only retrieved during probe
stage. If the parent of the source clock changes after probe stage, the
setbrg will set wrong baudrate.

To get the right clock rate, this patch records the baud clk struct to the
driver's priv, and changes the driver's flow to get the clock rate before
calling _mtk_serial_setbrg().

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
drivers/serial/serial_mtk.c