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

Commit d1755e35 authored by Sascha Hauer's avatar Sascha Hauer
Browse files

[ARM] MXC: add clkdev support



This patch only adds general clkdev support without actually switching
any MXC architecture to clkdev.

Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent e65fb009
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -47,6 +47,11 @@ static DEFINE_MUTEX(clocks_mutex);
 * Standard clock functions defined in include/linux/clk.h
 * Standard clock functions defined in include/linux/clk.h
 *-------------------------------------------------------------------------*/
 *-------------------------------------------------------------------------*/


/*
 * All the code inside #ifndef CONFIG_COMMON_CLKDEV can be removed once all
 * MXC architectures have switched to using clkdev.
 */
#ifndef CONFIG_COMMON_CLKDEV
/*
/*
 * Retrieve a clock by name.
 * Retrieve a clock by name.
 *
 *
@@ -110,6 +115,7 @@ struct clk *clk_get(struct device *dev, const char *id)
	return clk;
	return clk;
}
}
EXPORT_SYMBOL(clk_get);
EXPORT_SYMBOL(clk_get);
#endif


static void __clk_disable(struct clk *clk)
static void __clk_disable(struct clk *clk)
{
{
@@ -187,6 +193,7 @@ unsigned long clk_get_rate(struct clk *clk)
}
}
EXPORT_SYMBOL(clk_get_rate);
EXPORT_SYMBOL(clk_get_rate);


#ifndef CONFIG_COMMON_CLKDEV
/* Decrement the clock's module reference count */
/* Decrement the clock's module reference count */
void clk_put(struct clk *clk)
void clk_put(struct clk *clk)
{
{
@@ -194,6 +201,7 @@ void clk_put(struct clk *clk)
		module_put(clk->owner);
		module_put(clk->owner);
}
}
EXPORT_SYMBOL(clk_put);
EXPORT_SYMBOL(clk_put);
#endif


/* Round the requested clock rate to the nearest supported
/* Round the requested clock rate to the nearest supported
 * rate that is less than or equal to the requested rate.
 * rate that is less than or equal to the requested rate.
@@ -257,6 +265,7 @@ struct clk *clk_get_parent(struct clk *clk)
}
}
EXPORT_SYMBOL(clk_get_parent);
EXPORT_SYMBOL(clk_get_parent);


#ifndef CONFIG_COMMON_CLKDEV
/*
/*
 * Add a new clock to the clock tree.
 * Add a new clock to the clock tree.
 */
 */
@@ -327,6 +336,7 @@ static int __init mxc_setup_proc_entry(void)
}
}


late_initcall(mxc_setup_proc_entry);
late_initcall(mxc_setup_proc_entry);
#endif /* CONFIG_PROC_FS */
#endif
#endif


/*
/*
+7 −0
Original line number Original line Diff line number Diff line
#ifndef __ASM_MACH_CLKDEV_H
#define __ASM_MACH_CLKDEV_H

#define __clk_get(clk) ({ 1; })
#define __clk_put(clk) do { } while (0)

#endif
+4 −0
Original line number Original line Diff line number Diff line
@@ -26,9 +26,13 @@
struct module;
struct module;


struct clk {
struct clk {
#ifndef CONFIG_COMMON_CLKDEV
	/* As soon as i.MX1 and i.MX31 switched to clkdev, this
	 * block can go away */
	struct list_head node;
	struct list_head node;
	struct module *owner;
	struct module *owner;
	const char *name;
	const char *name;
#endif
	int id;
	int id;
	/* Source clock this clk depends on */
	/* Source clock this clk depends on */
	struct clk *parent;
	struct clk *parent;