mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
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:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user