1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2016 Socionext Inc.
4 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 #include <linux/clk-provider.h>
8 #include <linux/device.h>
10 #include "clk-uniphier.h"
12 struct clk_hw
*uniphier_clk_register_fixed_rate(struct device
*dev
,
14 const struct uniphier_clk_fixed_rate_data
*data
)
16 struct clk_fixed_rate
*fixed
;
17 struct clk_init_data init
;
20 /* allocate fixed-rate clock */
21 fixed
= devm_kzalloc(dev
, sizeof(*fixed
), GFP_KERNEL
);
23 return ERR_PTR(-ENOMEM
);
26 init
.ops
= &clk_fixed_rate_ops
;
27 init
.parent_names
= NULL
;
30 fixed
->fixed_rate
= data
->fixed_rate
;
31 fixed
->hw
.init
= &init
;
33 ret
= devm_clk_hw_register(dev
, &fixed
->hw
);