linux/arch/arm/mach-pxa/clock.h
<<
>>
Prefs
   1#include <asm/clkdev.h>
   2
   3struct clkops {
   4        void                    (*enable)(struct clk *);
   5        void                    (*disable)(struct clk *);
   6        unsigned long           (*getrate)(struct clk *);
   7};
   8
   9struct clk {
  10        const struct clkops     *ops;
  11        unsigned long           rate;
  12        unsigned int            cken;
  13        unsigned int            delay;
  14        unsigned int            enabled;
  15};
  16
  17#define INIT_CLKREG(_clk,_devname,_conname)             \
  18        {                                               \
  19                .clk            = _clk,                 \
  20                .dev_id         = _devname,             \
  21                .con_id         = _conname,             \
  22        }
  23
  24#define DEFINE_CKEN(_name, _cken, _rate, _delay)        \
  25struct clk clk_##_name = {                              \
  26                .ops    = &clk_cken_ops,                \
  27                .rate   = _rate,                        \
  28                .cken   = CKEN_##_cken,                 \
  29                .delay  = _delay,                       \
  30        }
  31
  32#define DEFINE_CK(_name, _cken, _ops)                   \
  33struct clk clk_##_name = {                              \
  34                .ops    = _ops,                         \
  35                .cken   = CKEN_##_cken,                 \
  36        }
  37
  38#define DEFINE_CLK(_name, _ops, _rate, _delay)          \
  39struct clk clk_##_name = {                              \
  40                .ops    = _ops,                         \
  41                .rate   = _rate,                        \
  42                .delay  = _delay,                       \
  43        }
  44
  45extern const struct clkops clk_cken_ops;
  46
  47void clk_cken_enable(struct clk *clk);
  48void clk_cken_disable(struct clk *clk);
  49
  50#ifdef CONFIG_PXA3xx
  51#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay)   \
  52struct clk clk_##_name = {                              \
  53                .ops    = &clk_pxa3xx_cken_ops,         \
  54                .rate   = _rate,                        \
  55                .cken   = CKEN_##_cken,                 \
  56                .delay  = _delay,                       \
  57        }
  58
  59#define DEFINE_PXA3_CK(_name, _cken, _ops)              \
  60struct clk clk_##_name = {                              \
  61                .ops    = _ops,                         \
  62                .cken   = CKEN_##_cken,                 \
  63        }
  64
  65extern const struct clkops clk_pxa3xx_cken_ops;
  66extern void clk_pxa3xx_cken_enable(struct clk *);
  67extern void clk_pxa3xx_cken_disable(struct clk *);
  68#endif
  69
  70void clks_register(struct clk_lookup *clks, size_t num);
  71int clk_add_alias(const char *alias, const char *alias_name, char *id,
  72        struct device *dev);
  73
  74