diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-21 16:08:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:54 -0400 |
commit | ab373190813a2e89f9ab7338c6b106804611f2b7 (patch) | |
tree | 104cb4edf5f751441f3cabc7ac768dc98c661a5d /drivers/media/video | |
parent | 81dde91f640d6dea89229bb00c4ff38739fc1867 (diff) |
V4L/DVB (10691): v4l2-common: add v4l2_i2c_subdev_addr()
Add small function to retrieve the i2c address from a v4l2_subdev
pointer.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/v4l2-common.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index bca4daf87a12..caa7ba0705a5 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
@@ -1022,6 +1022,15 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter, | |||
1022 | } | 1022 | } |
1023 | EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev); | 1023 | EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev); |
1024 | 1024 | ||
1025 | /* Return i2c client address of v4l2_subdev. */ | ||
1026 | unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd) | ||
1027 | { | ||
1028 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
1029 | |||
1030 | return client ? client->addr : I2C_CLIENT_END; | ||
1031 | } | ||
1032 | EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_addr); | ||
1033 | |||
1025 | /* Return a list of I2C tuner addresses to probe. Use only if the tuner | 1034 | /* Return a list of I2C tuner addresses to probe. Use only if the tuner |
1026 | addresses are unknown. */ | 1035 | addresses are unknown. */ |
1027 | const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type) | 1036 | const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type) |