Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9e63088 authored by Tero Kristo's avatar Tero Kristo
Browse files

clk: ti: remove exported ll_ops struct, instead add an API for registration



We should avoid exporting data from drivers, instead use an API for
registering the clock low level operations.

Signed-off-by: default avatarTero Kristo <t-kristo@ti.com>
parent 9e11814a
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -112,6 +112,19 @@ static struct ti_clk_ll_ops omap_clk_ll_ops = {
	.cm_split_idlest_reg = cm_split_idlest_reg,
	.cm_split_idlest_reg = cm_split_idlest_reg,
};
};


/**
 * omap2_clk_setup_ll_ops - setup clock driver low-level ops
 *
 * Sets up clock driver low-level platform ops. These are needed
 * for register accesses and various other misc platform operations.
 * Returns 0 on success, -EBUSY if low level ops have been registered
 * already.
 */
int __init omap2_clk_setup_ll_ops(void)
{
	return ti_clk_setup_ll_ops(&omap_clk_ll_ops);
}

/**
/**
 * omap2_clk_provider_init - initialize a clock provider
 * omap2_clk_provider_init - initialize a clock provider
 * @match_table: DT device table to match for devices to init
 * @match_table: DT device table to match for devices to init
@@ -130,8 +143,6 @@ int __init omap2_clk_provider_init(struct device_node *np, int index,
{
{
	struct clk_iomap *io;
	struct clk_iomap *io;


	ti_clk_ll_ops = &omap_clk_ll_ops;

	io = kzalloc(sizeof(*io), GFP_KERNEL);
	io = kzalloc(sizeof(*io), GFP_KERNEL);


	io->regmap = syscon;
	io->regmap = syscon;
@@ -155,8 +166,6 @@ void __init omap2_clk_legacy_provider_init(int index, void __iomem *mem)
{
{
	struct clk_iomap *io;
	struct clk_iomap *io;


	ti_clk_ll_ops = &omap_clk_ll_ops;

	io = memblock_virt_alloc(sizeof(*io), 0);
	io = memblock_virt_alloc(sizeof(*io), 0);


	io->mem = mem;
	io->mem = mem;
+1 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,7 @@ struct regmap;
int __init omap2_clk_provider_init(struct device_node *np, int index,
int __init omap2_clk_provider_init(struct device_node *np, int index,
				   struct regmap *syscon, void __iomem *mem);
				   struct regmap *syscon, void __iomem *mem);
void __init omap2_clk_legacy_provider_init(int index, void __iomem *mem);
void __init omap2_clk_legacy_provider_init(int index, void __iomem *mem);
int __init omap2_clk_setup_ll_ops(void);


void __init ti_clk_init_features(void);
void __init ti_clk_init_features(void);
#endif
#endif
+2 −0
Original line number Original line Diff line number Diff line
@@ -722,6 +722,8 @@ int __init omap_clk_init(void)


	ti_clk_init_features();
	ti_clk_init_features();


	omap2_clk_setup_ll_ops();

	if (of_have_populated_dt()) {
	if (of_have_populated_dt()) {
		ret = omap_control_init();
		ret = omap_control_init();
		if (ret)
		if (ret)
+21 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,27 @@ static struct device_node *clocks_node_ptr[CLK_MAX_MEMMAPS];


struct ti_clk_features ti_clk_features;
struct ti_clk_features ti_clk_features;


/**
 * ti_clk_setup_ll_ops - setup low level clock operations
 * @ops: low level clock ops descriptor
 *
 * Sets up low level clock operations for TI clock driver. This is used
 * to provide various callbacks for the clock driver towards platform
 * specific code. Returns 0 on success, -EBUSY if ll_ops have been
 * registered already.
 */
int ti_clk_setup_ll_ops(struct ti_clk_ll_ops *ops)
{
	if (ti_clk_ll_ops) {
		pr_err("Attempt to register ll_ops multiple times.\n");
		return -EBUSY;
	}

	ti_clk_ll_ops = ops;

	return 0;
}

/**
/**
 * ti_dt_clocks_register - register DT alias clocks during boot
 * ti_dt_clocks_register - register DT alias clocks during boot
 * @oclks: list of clocks to register
 * @oclks: list of clocks to register
+2 −0
Original line number Original line Diff line number Diff line
@@ -280,4 +280,6 @@ long omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw,
					unsigned long *best_parent_rate,
					unsigned long *best_parent_rate,
					struct clk_hw **best_parent_clk);
					struct clk_hw **best_parent_clk);


extern struct ti_clk_ll_ops *ti_clk_ll_ops;

#endif
#endif
Loading