[PATCH 3/9] lpc2k: clk API

Kevin Wells kevin.wells at nxp.com
Thu Mar 17 18:08:06 EDT 2011


> +struct clk {
> +	int		refcount;
> +	struct clk	*parent;
> +	unsigned long	rate;
> +
> +	u32		enable_mask;
> +
> +	long		(*round_rate)(struct clk *clk, unsigned long rate);
> +	int		(*set_rate)(struct clk *clk, unsigned long rate);
> +	unsigned long	(*get_rate)(struct clk *clk);
> +	int		(*set_parent)(struct clk *clk, struct clk *parent);
> +};
> +
> +static DEFINE_MUTEX(clocks_mutex);

I tried this lock mechanism and occasionally I get warnings when mutex
checking is enabled and multiple calls occur to the clk_* functions
with active clock management. Spinlocks might be better, but maybe some
one else can chime in here.

> +
> +/*-----------------------------------------------------------------------
> --
> + * Standard clock functions defined in include/linux/clk.h
> + *-----------------------------------------------------------------------
> --*/
> +




More information about the linux-arm-kernel mailing list