clk: rockchip: rk3328: support driver build as tristate module

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ie87e3c1acfe9a1f84b0b70d995fb1c85433cd998
This commit is contained in:
Elaine Zhang
2020-07-16 17:40:49 +08:00
committed by Tao Huang
parent 3fe07b5ab6
commit 8c5d7c5d0f
2 changed files with 31 additions and 1 deletions

View File

@@ -73,7 +73,7 @@ config CLK_RK3308
Build the driver for RK3308 Clock Driver.
config CLK_RK3328
bool "Rockchip RK3328 clock controller support"
tristate "Rockchip RK3328 clock controller support"
depends on ARM64 || COMPILE_TEST
default y
help

View File

@@ -6,8 +6,10 @@
#include <linux/clk-provider.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/syscore_ops.h>
#include <dt-bindings/clock/rk3328-cru.h>
#include "clk.h"
@@ -921,3 +923,31 @@ static void __init rk3328_clk_init(struct device_node *np)
rockchip_clk_of_add_provider(np, ctx);
}
CLK_OF_DECLARE(rk3328_cru, "rockchip,rk3328-cru", rk3328_clk_init);
static int __init clk_rk3328_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
rk3328_clk_init(np);
return 0;
}
static const struct of_device_id clk_rk3328_match_table[] = {
{
.compatible = "rockchip,rk3328-cru",
},
{ }
};
MODULE_DEVICE_TABLE(of, clk_rk3328_match_table);
static struct platform_driver clk_rk3328_driver = {
.driver = {
.name = "clk-rk3328",
.of_match_table = clk_rk3328_match_table,
},
};
builtin_platform_driver_probe(clk_rk3328_driver, clk_rk3328_probe);
MODULE_DESCRIPTION("Rockchip RK3328 Clock Driver");
MODULE_LICENSE("GPL");