diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-21 22:08:41 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-21 22:08:41 +0100 |
commit | d649a4d46ae66654680799c6ee8c72cdd610658e (patch) | |
tree | 89bb4afb259b644491e1c55ee86b37f4b3ebcf53 /linux/drivers/media/video/v4l2-common.c | |
parent | c0d72775f8fc3a3e551f233b3501ccf1ca23fe2a (diff) | |
download | mediapointer-dvb-s2-d649a4d46ae66654680799c6ee8c72cdd610658e.tar.gz mediapointer-dvb-s2-d649a4d46ae66654680799c6ee8c72cdd610658e.tar.bz2 |
v4l2-common: add v4l2_i2c_subdev_addr()
From: Hans Verkuil <hverkuil@xs4all.nl>
Add small function to retrieve the i2c address from a v4l2_subdev
pointer.
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/v4l2-common.c')
-rw-r--r-- | linux/drivers/media/video/v4l2-common.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c index 8ae8dd366..78063b055 100644 --- a/linux/drivers/media/video/v4l2-common.c +++ b/linux/drivers/media/video/v4l2-common.c @@ -1049,6 +1049,15 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter, } EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev); +/* Return i2c client address of v4l2_subdev. */ +unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd) +{ + struct i2c_client *client = v4l2_get_subdevdata(sd); + + return client ? client->addr : I2C_CLIENT_END; +} +EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_addr); + /* Return a list of I2C tuner addresses to probe. Use only if the tuner addresses are unknown. */ const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type) |