Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/extres/clk/clk.h
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | |||||
int clk_test_freq(clk_t clk, uint64_t freq, int flags); | int clk_test_freq(clk_t clk, uint64_t freq, int flags); | ||||
int clk_enable(clk_t clk); | int clk_enable(clk_t clk); | ||||
int clk_disable(clk_t clk); | int clk_disable(clk_t clk); | ||||
int clk_stop(clk_t clk); | int clk_stop(clk_t clk); | ||||
int clk_get_parent(clk_t clk, clk_t *parent); | int clk_get_parent(clk_t clk, clk_t *parent); | ||||
int clk_set_parent_by_clk(clk_t clk, clk_t parent); | int clk_set_parent_by_clk(clk_t clk, clk_t parent); | ||||
const char *clk_get_name(clk_t clk); | const char *clk_get_name(clk_t clk); | ||||
static inline uint64_t | |||||
clk_freq_diff(uint64_t x, uint64_t y) | |||||
{ | |||||
return (x >= y ? x - y : y - x); | |||||
} | |||||
#ifdef FDT | #ifdef FDT | ||||
int clk_set_assigned(device_t dev, phandle_t node); | int clk_set_assigned(device_t dev, phandle_t node); | ||||
int clk_get_by_ofw_index(device_t dev, phandle_t node, int idx, clk_t *clk); | int clk_get_by_ofw_index(device_t dev, phandle_t node, int idx, clk_t *clk); | ||||
int clk_get_by_ofw_index_prop(device_t dev, phandle_t cnode, const char *prop, int idx, clk_t *clk); | int clk_get_by_ofw_index_prop(device_t dev, phandle_t cnode, const char *prop, int idx, clk_t *clk); | ||||
int clk_get_by_ofw_name(device_t dev, phandle_t node, const char *name, | int clk_get_by_ofw_name(device_t dev, phandle_t node, const char *name, | ||||
clk_t *clk); | clk_t *clk); | ||||
int clk_parse_ofw_out_names(device_t dev, phandle_t node, | int clk_parse_ofw_out_names(device_t dev, phandle_t node, | ||||
const char ***out_names, uint32_t **indices); | const char ***out_names, uint32_t **indices); | ||||
int clk_parse_ofw_clk_name(device_t dev, phandle_t node, const char **name); | int clk_parse_ofw_clk_name(device_t dev, phandle_t node, const char **name); | ||||
#endif | #endif | ||||
#endif /* _DEV_EXTRES_CLK_H_ */ | #endif /* _DEV_EXTRES_CLK_H_ */ |