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

Commit b2e39dc0 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Stephen Boyd
Browse files

clk: at91: allow clock registration from C code



Remove static keyword to allow functions to be used from other units. Also
move some struct and function declarations to pmc.h

Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
[sboyd@kernel.org: Include pmc.h]
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent c1e4580a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ static void clk_generated_startup(struct clk_generated *gck)
					>> AT91_PMC_PCR_GCKDIV_OFFSET;
}

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock,
			    const char *name, const char **parent_names,
			    u8 num_parents, u8 id, bool pll_audio,
+3 −1
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@

#include <soc/at91/atmel-sfr.h>

#include "pmc.h"

#define	I2S_BUS_NR	2

struct clk_i2s_mux {
@@ -48,7 +50,7 @@ static const struct clk_ops clk_i2s_mux_ops = {
	.determine_rate = __clk_mux_determine_rate,
};

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_i2s_mux_register(struct regmap *regmap, const char *name,
			  const char * const *parent_names,
			  unsigned int num_parents, u8 bus_id)
+4 −4
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ static const struct clk_ops main_osc_ops = {
	.is_prepared = clk_main_osc_is_prepared,
};

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_register_main_osc(struct regmap *regmap,
			   const char *name,
			   const char *parent_name,
@@ -275,7 +275,7 @@ static const struct clk_ops main_rc_osc_ops = {
	.recalc_accuracy = clk_main_rc_osc_recalc_accuracy,
};

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_register_main_rc_osc(struct regmap *regmap,
			      const char *name,
			      u32 frequency, u32 accuracy)
@@ -403,7 +403,7 @@ static const struct clk_ops rm9200_main_ops = {
	.recalc_rate = clk_rm9200_main_recalc_rate,
};

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_register_rm9200_main(struct regmap *regmap,
			      const char *name,
			      const char *parent_name)
@@ -541,7 +541,7 @@ static const struct clk_ops sam9x5_main_ops = {
	.get_parent = clk_sam9x5_main_get_parent,
};

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_register_sam9x5_main(struct regmap *regmap,
			      const char *name,
			      const char **parent_names,
+3 −14
Original line number Diff line number Diff line
@@ -24,17 +24,6 @@
#define MASTER_DIV_SHIFT	8
#define MASTER_DIV_MASK		0x3

struct clk_master_characteristics {
	struct clk_range output;
	u32 divisors[4];
	u8 have_div3_pres;
};

struct clk_master_layout {
	u32 mask;
	u8 pres_shift;
};

#define to_clk_master(hw) container_of(hw, struct clk_master, hw)

struct clk_master {
@@ -120,7 +109,7 @@ static const struct clk_ops master_ops = {
	.get_parent = clk_master_get_parent,
};

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_register_master(struct regmap *regmap,
		const char *name, int num_parents,
		const char **parent_names,
@@ -161,12 +150,12 @@ at91_clk_register_master(struct regmap *regmap,
}


static const struct clk_master_layout at91rm9200_master_layout = {
const struct clk_master_layout at91rm9200_master_layout = {
	.mask = 0x31F,
	.pres_shift = 2,
};

static const struct clk_master_layout at91sam9x5_master_layout = {
const struct clk_master_layout at91sam9x5_master_layout = {
	.mask = 0x373,
	.pres_shift = 4,
};
+2 −2
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ static const struct clk_ops peripheral_ops = {
	.is_enabled = clk_peripheral_is_enabled,
};

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_register_peripheral(struct regmap *regmap, const char *name,
			     const char *parent_name, u32 id)
{
@@ -331,7 +331,7 @@ static const struct clk_ops sam9x5_peripheral_ops = {
	.set_rate = clk_sam9x5_peripheral_set_rate,
};

static struct clk_hw * __init
struct clk_hw * __init
at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
				    const char *name, const char *parent_name,
				    u32 id, const struct clk_range *range)
Loading