aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-03-30 10:40:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:24 -0400
commit868f985c2fb85b5f32785bb55a349d180a30f3d3 (patch)
treee0a7bc9246227ca00199241e54889f8c8913634d
parentacebc70d4a789df21270690c70928b8a836caad7 (diff)
V4L/DVB (11374): v4l2-common: add v4l2_i2c_new_probed_subdev_addr
Add utility function to probe for a single address, rather than a list of addresses. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/v4l2-common.c11
-rw-r--r--include/media/v4l2-common.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index f23a77473aaf..270833b1b38f 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -864,6 +864,17 @@ error:
864} 864}
865EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev); 865EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev);
866 866
867struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev,
868 struct i2c_adapter *adapter,
869 const char *module_name, const char *client_type, u8 addr)
870{
871 unsigned short addrs[2] = { addr, I2C_CLIENT_END };
872
873 return v4l2_i2c_new_probed_subdev(v4l2_dev, adapter,
874 module_name, client_type, addrs);
875}
876EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev_addr);
877
867/* Return i2c client address of v4l2_subdev. */ 878/* Return i2c client address of v4l2_subdev. */
868unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd) 879unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd)
869{ 880{
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 8ec50fea9e0d..1613a0ab8b04 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -147,6 +147,10 @@ struct v4l2_subdev *v4l2_i2c_new_subdev(struct i2c_adapter *adapter,
147struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter, 147struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter,
148 const char *module_name, const char *client_type, 148 const char *module_name, const char *client_type,
149 const unsigned short *addrs); 149 const unsigned short *addrs);
150/* Like v4l2_i2c_new_probed_subdev, except probe for a single address. */
151struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev,
152 struct i2c_adapter *adapter,
153 const char *module_name, const char *client_type, u8 addr);
150/* Initialize an v4l2_subdev with data from an i2c_client struct */ 154/* Initialize an v4l2_subdev with data from an i2c_client struct */
151void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, 155void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
152 const struct v4l2_subdev_ops *ops); 156 const struct v4l2_subdev_ops *ops);