diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-08-28 09:28:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-10-31 02:31:30 -0400 |
commit | cf326dfebe612bf56c83d8fca7a7c1d1584c061f (patch) | |
tree | 0147f77a00da075c875c44b835b7eeb5502b5460 /include/media/v4l2-clk.h | |
parent | d3f884a70938b1776ba44c7b6c82f3c3fd54ccbd (diff) |
[media] V4L2: add v4l2-clock helpers to register and unregister a fixed-rate clock
Many bridges and video host controllers supply fixed rate always on clocks
to their I2C devices. This patch adds two simple helpers to register and
unregister such a clock.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media/v4l2-clk.h')
-rw-r--r-- | include/media/v4l2-clk.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h index 0503a90b48bb..a354a9d6456e 100644 --- a/include/media/v4l2-clk.h +++ b/include/media/v4l2-clk.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define MEDIA_V4L2_CLK_H | 15 | #define MEDIA_V4L2_CLK_H |
16 | 16 | ||
17 | #include <linux/atomic.h> | 17 | #include <linux/atomic.h> |
18 | #include <linux/export.h> | ||
18 | #include <linux/list.h> | 19 | #include <linux/list.h> |
19 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
20 | 21 | ||
@@ -51,4 +52,17 @@ void v4l2_clk_disable(struct v4l2_clk *clk); | |||
51 | unsigned long v4l2_clk_get_rate(struct v4l2_clk *clk); | 52 | unsigned long v4l2_clk_get_rate(struct v4l2_clk *clk); |
52 | int v4l2_clk_set_rate(struct v4l2_clk *clk, unsigned long rate); | 53 | int v4l2_clk_set_rate(struct v4l2_clk *clk, unsigned long rate); |
53 | 54 | ||
55 | struct module; | ||
56 | |||
57 | struct v4l2_clk *__v4l2_clk_register_fixed(const char *dev_id, | ||
58 | const char *id, unsigned long rate, struct module *owner); | ||
59 | void v4l2_clk_unregister_fixed(struct v4l2_clk *clk); | ||
60 | |||
61 | static inline struct v4l2_clk *v4l2_clk_register_fixed(const char *dev_id, | ||
62 | const char *id, | ||
63 | unsigned long rate) | ||
64 | { | ||
65 | return __v4l2_clk_register_fixed(dev_id, id, rate, THIS_MODULE); | ||
66 | } | ||
67 | |||
54 | #endif | 68 | #endif |