]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
i2c: rtl9300: introduce clk struct for upcoming rtl9607 support
authorRustam Adilov <adilov@disroot.org>
Wed, 1 Apr 2026 18:06:46 +0000 (23:06 +0500)
committerAndi Shyti <andi.shyti@kernel.org>
Wed, 1 Apr 2026 22:09:27 +0000 (00:09 +0200)
commitf60d27926c9e2d547200fb0d26f61eec9b8291a6
tree8995c317949d6d63f8d63410fd04d4541d5a0024
parent1211ce1e11d23ec05d80a85b7187baa6abed3232
i2c: rtl9300: introduce clk struct for upcoming rtl9607 support

In RTL9607C i2c controller, there is 10 bit CLK_DIV field for
setting the clock of i2c interface which depends on the rate
of i2c clk (which seems be fixed to 62.5MHz according to Realtek SDK).

Introduce the clk struct and the respective F_CLK_DIV and clk_div
which are going to be used in the upcoming patch for rtl9607c i2c
controller support addition.

devm_clk_get_optional_enabled() function was used for cleaner code
as it automatically returns NULL if the clk is not present, which is
going to be the case for RTL9300 and RTL9310 i2c controllers.

Signed-off-by: Rustam Adilov <adilov@disroot.org>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260401180648.337834-7-adilov@disroot.org
drivers/i2c/busses/i2c-rtl9300.c