1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __MACH_SUNXI_CLK_FACTORS_H
3 #define __MACH_SUNXI_CLK_FACTORS_H
5 #include <linux/clk-provider.h>
6 #include <linux/spinlock.h>
8 #define SUNXI_FACTORS_NOT_APPLICABLE (0)
10 struct clk_factors_config
{
22 struct factors_request
{
24 unsigned long parent_rate
;
36 const struct clk_factors_config
*table
;
37 void (*getter
)(struct factors_request
*req
);
38 void (*recalc
)(struct factors_request
*req
);
45 const struct clk_factors_config
*config
;
46 void (*get_factors
)(struct factors_request
*req
);
47 void (*recalc
)(struct factors_request
*req
);
51 struct clk_gate
*gate
;
54 struct clk
*sunxi_factors_register(struct device_node
*node
,
55 const struct factors_data
*data
,
58 struct clk
*sunxi_factors_register_critical(struct device_node
*node
,
59 const struct factors_data
*data
,
63 void sunxi_factors_unregister(struct device_node
*node
, struct clk
*clk
);