Linux Kernel
3.7.1
|
#include <clock.h>
Data Fields | |
int(* | enable )(unsigned id) |
void(* | disable )(unsigned id) |
void(* | auto_off )(unsigned id) |
int(* | reset )(unsigned id, enum clk_reset_action action) |
int(* | set_rate )(unsigned id, unsigned rate) |
int(* | set_min_rate )(unsigned id, unsigned rate) |
int(* | set_max_rate )(unsigned id, unsigned rate) |
int(* | set_flags )(unsigned id, unsigned flags) |
unsigned(* | get_rate )(unsigned id) |
unsigned(* | is_enabled )(unsigned id) |
long(* | round_rate )(unsigned id, unsigned rate) |
bool(* | is_local )(unsigned id) |
unsigned long(* | get_rate )(struct clk *c) |
unsigned long(* | round_rate )(struct clk *c, unsigned long rate) |
int(* | set_parent )(struct clk *c, struct clk *parent) |
long(* | round )(struct clk *, unsigned long) |
int(* | set )(struct clk *, unsigned long) |
void(* | setvco )(struct clk *, struct icst_vco) |
int(* | disable )(struct clk *clk) |
void(* | init )(struct clk *clk) |
void(* | enable )(struct clk *clk) |
void(* | recalc )(struct clk *clk) |
int(* | is_enabled )(struct clk *clk) |
struct clk_ops - standard clock operations : set the clock rate, see clk_set_rate(). : get the clock rate, see clk_get_rate(). : round a given clock rate, see clk_round_rate(). : set the clock's parent, see clk_set_parent().
Group the common clock implementations together so that we don't have to keep setting the same fields again. We leave enable in struct clk.
Adding an extra layer of indirection into the process should not be a problem as it is unlikely these operations are going to need to be called quickly.