~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to include/linux/clockchips.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
/**
58
58
 * struct clock_event_device - clock event device descriptor
59
 
 * @name:               ptr to clock event name
60
 
 * @features:           features
 
59
 * @event_handler:      Assigned by the framework to be called by the low
 
60
 *                      level handler of the event source
 
61
 * @set_next_event:     set next event function
 
62
 * @next_event:         local storage for the next event in oneshot mode
61
63
 * @max_delta_ns:       maximum delta value in ns
62
64
 * @min_delta_ns:       minimum delta value in ns
63
65
 * @mult:               nanosecond to cycles multiplier
64
66
 * @shift:              nanoseconds to cycles divisor (power of two)
 
67
 * @mode:               operating mode assigned by the management code
 
68
 * @features:           features
 
69
 * @retries:            number of forced programming retries
 
70
 * @set_mode:           set mode function
 
71
 * @broadcast:          function to broadcast events
 
72
 * @min_delta_ticks:    minimum delta value in ticks stored for reconfiguration
 
73
 * @max_delta_ticks:    maximum delta value in ticks stored for reconfiguration
 
74
 * @name:               ptr to clock event name
65
75
 * @rating:             variable to rate clock event devices
66
76
 * @irq:                IRQ number (only for non CPU local devices)
67
77
 * @cpumask:            cpumask to indicate for which CPUs this device works
68
 
 * @set_next_event:     set next event function
69
 
 * @set_mode:           set mode function
70
 
 * @event_handler:      Assigned by the framework to be called by the low
71
 
 *                      level handler of the event source
72
 
 * @broadcast:          function to broadcast events
73
78
 * @list:               list head for the management code
74
 
 * @mode:               operating mode assigned by the management code
75
 
 * @next_event:         local storage for the next event in oneshot mode
76
 
 * @retries:            number of forced programming retries
77
79
 */
78
80
struct clock_event_device {
79
 
        const char              *name;
80
 
        unsigned int            features;
 
81
        void                    (*event_handler)(struct clock_event_device *);
 
82
        int                     (*set_next_event)(unsigned long evt,
 
83
                                                  struct clock_event_device *);
 
84
        ktime_t                 next_event;
81
85
        u64                     max_delta_ns;
82
86
        u64                     min_delta_ns;
83
87
        u32                     mult;
84
88
        u32                     shift;
 
89
        enum clock_event_mode   mode;
 
90
        unsigned int            features;
 
91
        unsigned long           retries;
 
92
 
 
93
        void                    (*broadcast)(const struct cpumask *mask);
 
94
        void                    (*set_mode)(enum clock_event_mode mode,
 
95
                                            struct clock_event_device *);
 
96
        unsigned long           min_delta_ticks;
 
97
        unsigned long           max_delta_ticks;
 
98
 
 
99
        const char              *name;
85
100
        int                     rating;
86
101
        int                     irq;
87
102
        const struct cpumask    *cpumask;
88
 
        int                     (*set_next_event)(unsigned long evt,
89
 
                                                  struct clock_event_device *);
90
 
        void                    (*set_mode)(enum clock_event_mode mode,
91
 
                                            struct clock_event_device *);
92
 
        void                    (*event_handler)(struct clock_event_device *);
93
 
        void                    (*broadcast)(const struct cpumask *mask);
94
103
        struct list_head        list;
95
 
        enum clock_event_mode   mode;
96
 
        ktime_t                 next_event;
97
 
        unsigned long           retries;
98
 
};
 
104
} ____cacheline_aligned;
99
105
 
100
106
/*
101
107
 * Calculate a multiplication factor for scaled math, which is used to convert
122
128
                               struct clock_event_device *evt);
123
129
extern void clockevents_register_device(struct clock_event_device *dev);
124
130
 
 
131
extern void clockevents_config_and_register(struct clock_event_device *dev,
 
132
                                            u32 freq, unsigned long min_delta,
 
133
                                            unsigned long max_delta);
 
134
 
 
135
extern int clockevents_update_freq(struct clock_event_device *ce, u32 freq);
 
136
 
125
137
extern void clockevents_exchange_device(struct clock_event_device *old,
126
138
                                        struct clock_event_device *new);
127
139
extern void clockevents_set_mode(struct clock_event_device *dev,
132
144
 
133
145
extern void clockevents_handle_noop(struct clock_event_device *dev);
134
146
 
 
147
extern int clockevents_reconfigure(struct clock_event_device *ce, u32 freq, u32 minsec);
 
148
 
135
149
static inline void
136
150
clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec)
137
151
{