diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-08-28 10:28:27 -0300 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:55:38 +0900 |
commit | 027626e10bc075f4be114dd0e4e9a7dd2015bdac (patch) | |
tree | c3f65b1ca107b6ec9f4a2759f47e7394ea855645 /include | |
parent | 0439927dc2c24a2d5fee73172fd86a7435729f84 (diff) | |
download | linux-3.10-027626e10bc075f4be114dd0e4e9a7dd2015bdac.tar.gz linux-3.10-027626e10bc075f4be114dd0e4e9a7dd2015bdac.tar.bz2 linux-3.10-027626e10bc075f4be114dd0e4e9a7dd2015bdac.zip |
upstream: [media] V4L2: add a v4l2-clk helper macro to produce an I2C device ID
To obtain a clock reference consumers supply their device object to the
V4L2 clock framework. The latter then uses the consumer device name to
find a matching clock. For that to work V4L2 clock providers have to
provide the same device name, when registering clocks. This patch adds
a helper macro to generate a suitable device name for I2C devices.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/media/v4l2-clk.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h index a354a9d6456..0b36cc13830 100644 --- a/include/media/v4l2-clk.h +++ b/include/media/v4l2-clk.h @@ -65,4 +65,7 @@ static inline struct v4l2_clk *v4l2_clk_register_fixed(const char *dev_id, return __v4l2_clk_register_fixed(dev_id, id, rate, THIS_MODULE); } +#define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \ + "%d-%04x", adap, client) + #endif |