mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
clk: rockchip: rk3228: support driver build as tristate module
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Change-Id: I3757624b6b4531eff488c8a9ed6f73da21648f4e
This commit is contained in:
@@ -52,7 +52,7 @@ config CLK_RK3188
|
||||
Build the driver for RK3188 Clock Driver.
|
||||
|
||||
config CLK_RK322X
|
||||
bool "Rockchip RK322x clock controller support"
|
||||
tristate "Rockchip RK322x clock controller support"
|
||||
depends on ARM || COMPILE_TEST
|
||||
default y
|
||||
help
|
||||
|
||||
@@ -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/rk3228-cru.h>
|
||||
#include "clk.h"
|
||||
@@ -740,3 +742,31 @@ static void __init rk3228_clk_init(struct device_node *np)
|
||||
}
|
||||
}
|
||||
CLK_OF_DECLARE(rk3228_cru, "rockchip,rk3228-cru", rk3228_clk_init);
|
||||
|
||||
static int __init clk_rk3228_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
|
||||
rk3228_clk_init(np);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id clk_rk3228_match_table[] = {
|
||||
{
|
||||
.compatible = "rockchip,rk3228-cru",
|
||||
},
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, clk_rk3228_match_table);
|
||||
|
||||
static struct platform_driver clk_rk3228_driver = {
|
||||
.driver = {
|
||||
.name = "clk-rk3228",
|
||||
.of_match_table = clk_rk3228_match_table,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver_probe(clk_rk3228_driver, clk_rk3228_probe);
|
||||
|
||||
MODULE_DESCRIPTION("Rockchip RK3228 Clock Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
Reference in New Issue
Block a user