mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
clk: rockchip: rk3036: support driver build as tristate module
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Change-Id: I281ae6074a52e01832b357363b92191efadecff9
This commit is contained in:
@@ -31,7 +31,7 @@ config CLK_RK1808
|
||||
Build the driver for RK1808 Clock Driver.
|
||||
|
||||
config CLK_RK3036
|
||||
bool "Rockchip RK3036 clock controller support"
|
||||
tristate "Rockchip RK3036 clock controller support"
|
||||
depends on ARM || COMPILE_TEST
|
||||
default y
|
||||
help
|
||||
|
||||
@@ -9,8 +9,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/rk3036-cru.h>
|
||||
#include "clk.h"
|
||||
@@ -505,3 +507,31 @@ static void __init rk3036_clk_init(struct device_node *np)
|
||||
}
|
||||
}
|
||||
CLK_OF_DECLARE(rk3036_cru, "rockchip,rk3036-cru", rk3036_clk_init);
|
||||
|
||||
static int __init clk_rk3036_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
|
||||
rk3036_clk_init(np);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id clk_rk3036_match_table[] = {
|
||||
{
|
||||
.compatible = "rockchip,rk3036-cru",
|
||||
},
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, clk_rk3036_match_table);
|
||||
|
||||
static struct platform_driver clk_rk3036_driver = {
|
||||
.driver = {
|
||||
.name = "clk-rk3036",
|
||||
.of_match_table = clk_rk3036_match_table,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver_probe(clk_rk3036_driver, clk_rk3036_probe);
|
||||
|
||||
MODULE_DESCRIPTION("Rockchip RK3036 Clock Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
Reference in New Issue
Block a user