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

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ie65251277283e3770b05107b35c5516386d88a64
This commit is contained in:
Elaine Zhang
2020-07-16 17:41:43 +08:00
committed by Tao Huang
parent 24f8496691
commit b218253046
2 changed files with 31 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ config CLK_PX30
Build the driver for PX30 Clock Driver.
config CLK_RV110X
bool "Rockchip RV110x clock controller support"
tristate "Rockchip RV110x clock controller support"
depends on ARM || COMPILE_TEST
default y
help

View File

@@ -7,8 +7,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/rv1108-cru.h>
#include "clk.h"
@@ -840,3 +842,31 @@ static void __init rv1108_clk_init(struct device_node *np)
}
}
CLK_OF_DECLARE(rv1108_cru, "rockchip,rv1108-cru", rv1108_clk_init);
static int __init clk_rv1108_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
rv1108_clk_init(np);
return 0;
}
static const struct of_device_id clk_rv1108_match_table[] = {
{
.compatible = "rockchip,rv1108-cru",
},
{ }
};
MODULE_DEVICE_TABLE(of, clk_rv1108_match_table);
static struct platform_driver clk_rv1108_driver = {
.driver = {
.name = "clk-rv1108",
.of_match_table = clk_rv1108_match_table,
},
};
builtin_platform_driver_probe(clk_rv1108_driver, clk_rv1108_probe);
MODULE_DESCRIPTION("Rockchip RV1108 Clock Driver");
MODULE_LICENSE("GPL");