Skip to content

Commit

Permalink
[media] V4L2: add a v4l2-clk helper macro to produce an I2C device ID
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
lyakh authored and mchehab committed Oct 31, 2013
1 parent cf326df commit 774cc4c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/media/v4l2-clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 774cc4c

Please sign in to comment.