提交 868f985c 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

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: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 acebc70d
...@@ -864,6 +864,17 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter, ...@@ -864,6 +864,17 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter,
} }
EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev); EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev);
struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev,
struct i2c_adapter *adapter,
const char *module_name, const char *client_type, u8 addr)
{
unsigned short addrs[2] = { addr, I2C_CLIENT_END };
return v4l2_i2c_new_probed_subdev(v4l2_dev, adapter,
module_name, client_type, addrs);
}
EXPORT_SYMBOL_GPL(v4l2_i2c_new_probed_subdev_addr);
/* Return i2c client address of v4l2_subdev. */ /* Return i2c client address of v4l2_subdev. */
unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd) unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd)
{ {
......
...@@ -147,6 +147,10 @@ struct v4l2_subdev *v4l2_i2c_new_subdev(struct i2c_adapter *adapter, ...@@ -147,6 +147,10 @@ struct v4l2_subdev *v4l2_i2c_new_subdev(struct i2c_adapter *adapter,
struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter, struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter,
const char *module_name, const char *client_type, const char *module_name, const char *client_type,
const unsigned short *addrs); const unsigned short *addrs);
/* Like v4l2_i2c_new_probed_subdev, except probe for a single address. */
struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev,
struct i2c_adapter *adapter,
const char *module_name, const char *client_type, u8 addr);
/* Initialize an v4l2_subdev with data from an i2c_client struct */ /* Initialize an v4l2_subdev with data from an i2c_client struct */
void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
const struct v4l2_subdev_ops *ops); const struct v4l2_subdev_ops *ops);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册