clk: imx: add clk-gpr-mux driver
authorOleksij Rempel <o.rempel@pengutronix.de>
Tue, 31 Jan 2023 08:46:24 +0000 (09:46 +0100)
committerAbel Vesa <abel.vesa@linaro.org>
Tue, 31 Jan 2023 12:45:01 +0000 (14:45 +0200)
commitee394f636ad3cf0793042db049796147f708d483
tree69c7a8ceebdbb045fcc3918da9d0890b09233664
parent8864eac5511b061753133213c8e4dcbb85933892
clk: imx: add clk-gpr-mux driver

Almost(?) every i.MX variant has clk mux for ethernet (rgmii/rmii) reference
clock located in the GPR1 register. So far this clk is configured in
different ways:
- mach-imx6q is doing mux configuration based on ptp vs enet_ref clk
  comparison.
- mach-imx7d is setting mux to PAD for all boards
- mach-imx6ul is setting mux to internal clock for all boards.

Since we have imx7d and imx6ul board variants which do not work with
configurations forced by kernel mach code, we need to implement this clk
mux properly as part of the clk framework. Which is done by this patch.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230131084642.709385-2-o.rempel@pengutronix.de
drivers/clk/imx/Makefile
drivers/clk/imx/clk-gpr-mux.c [new file with mode: 0644]
drivers/clk/imx/clk.h