Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: 8250_of: manage bus clock in suspend/resume

Save the bus clock pointer in the of_serial_info structure, and use
that to disable the bus clock on suspend and re-enable it on resume.

Signed-off-by: Alex Elder <elder@riscstar.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Reviewed-by: Yixun Lan <dlan@gentoo.org>
Link: https://lore.kernel.org/r/20250411203828.1491595-4-elder@riscstar.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alex Elder and committed by
Greg Kroah-Hartman
926040da 66f5f70c

+4
+4
drivers/tty/serial/8250/8250_of.c
··· 24 24 25 25 struct of_serial_info { 26 26 struct clk *clk; 27 + struct clk *bus_clk; 27 28 struct reset_control *rst; 28 29 int type; 29 30 int line; ··· 139 138 goto err_pmruntime; 140 139 } 141 140 141 + info->bus_clk = bus_clk; 142 142 port->uartclk = clk_get_rate(info->clk); 143 143 } 144 144 /* If current-speed was set, then try not to change it. */ ··· 301 299 if (!uart_console(port) || console_suspend_enabled) { 302 300 pm_runtime_put_sync(dev); 303 301 clk_disable_unprepare(info->clk); 302 + clk_disable_unprepare(info->bus_clk); 304 303 } 305 304 return 0; 306 305 } ··· 314 311 315 312 if (!uart_console(port) || console_suspend_enabled) { 316 313 pm_runtime_get_sync(dev); 314 + clk_prepare_enable(info->bus_clk); 317 315 clk_prepare_enable(info->clk); 318 316 } 319 317