linux/arch/arm/mach-pxa/clock.h
<<
>>
Prefs
   1#include <linux/clkdev.h>
   2#include <linux/syscore_ops.h>
   3
   4struct clkops {
   5        void                    (*enable)(struct clk *);
   6        void                    (*disable)(struct clk *);
   7        unsigned long           (*getrate)(struct clk *);
   8        int                     (*setrate)(struct clk *, unsigned long);
   9};
  10
  11struct clk {
  12        const struct clkops     *ops;
  13        unsigned long           rate;
  14        unsigned int            cken;
  15        unsigned int            delay;
  16        unsigned int            enabled;
  17};
  18
  19void clk_dummy_enable(struct clk *);
  20void clk_dummy_disable(struct clk *);
  21
  22extern const struct clkops clk_dummy_ops;
  23extern struct clk clk_dummy;
  24
  25#define INIT_CLKREG(_clk,_devname,_conname)             \
  26        {                                               \
  27                .clk            = _clk,                 \
  28                .dev_id         = _devname,             \
  29                .con_id         = _conname,             \
  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
  45#define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay)   \
  46struct clk clk_##_name = {                              \
  47                .ops    = &clk_pxa2xx_cken_ops,         \
  48                .rate   = _rate,                        \
  49                .cken   = CKEN_##_cken,                 \
  50                .delay  = _delay,                       \
  51        }
  52
  53extern const struct clkops clk_pxa2xx_cken_ops;
  54
  55void clk_pxa2xx_cken_enable(struct clk *clk);
  56void clk_pxa2xx_cken_disable(struct clk *clk);
  57
  58extern struct syscore_ops pxa2xx_clock_syscore_ops;
  59
  60#if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x)
  61#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay)   \
  62struct clk clk_##_name = {                              \
  63                .ops    = &clk_pxa3xx_cken_ops,         \
  64                .rate   = _rate,                        \
  65                .cken   = CKEN_##_cken,                 \
  66                .delay  = _delay,                       \
  67        }
  68
  69extern const struct clkops clk_pxa3xx_cken_ops;
  70extern const struct clkops clk_pxa3xx_hsio_ops;
  71extern const struct clkops clk_pxa3xx_ac97_ops;
  72extern const struct clkops clk_pxa3xx_pout_ops;
  73extern const struct clkops clk_pxa3xx_smemc_ops;
  74
  75extern void clk_pxa3xx_cken_enable(struct clk *);
  76extern void clk_pxa3xx_cken_disable(struct clk *);
  77
  78extern struct syscore_ops pxa3xx_clock_syscore_ops;
  79
  80#endif
  81