media: ov7740: use SCCB regmap
Make use of SCCB APIs for regmap operations. Remove i2c_check_functionality as devm_regmap_init_sccb does it for us. Signed-off-by: Raag Jadav <raagjadav@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
49b20d981d
commit
fd210e31d7
@ -1015,7 +1015,7 @@ config VIDEO_OV7670
|
|||||||
config VIDEO_OV7740
|
config VIDEO_OV7740
|
||||||
tristate "OmniVision OV7740 sensor support"
|
tristate "OmniVision OV7740 sensor support"
|
||||||
depends on I2C && VIDEO_V4L2
|
depends on I2C && VIDEO_V4L2
|
||||||
select REGMAP_I2C
|
select REGMAP_SCCB
|
||||||
help
|
help
|
||||||
This is a Video4Linux2 sensor driver for the OmniVision
|
This is a Video4Linux2 sensor driver for the OmniVision
|
||||||
OV7740 VGA camera sensor.
|
OV7740 VGA camera sensor.
|
||||||
|
@ -1068,13 +1068,6 @@ static int ov7740_probe(struct i2c_client *client)
|
|||||||
struct v4l2_subdev *sd;
|
struct v4l2_subdev *sd;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!i2c_check_functionality(client->adapter,
|
|
||||||
I2C_FUNC_SMBUS_BYTE_DATA)) {
|
|
||||||
dev_err(&client->dev,
|
|
||||||
"OV7740: I2C-Adapter doesn't support SMBUS\n");
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
ov7740 = devm_kzalloc(&client->dev, sizeof(*ov7740), GFP_KERNEL);
|
ov7740 = devm_kzalloc(&client->dev, sizeof(*ov7740), GFP_KERNEL);
|
||||||
if (!ov7740)
|
if (!ov7740)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -1091,7 +1084,7 @@ static int ov7740_probe(struct i2c_client *client)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ov7740->regmap = devm_regmap_init_i2c(client, &ov7740_regmap_config);
|
ov7740->regmap = devm_regmap_init_sccb(client, &ov7740_regmap_config);
|
||||||
if (IS_ERR(ov7740->regmap)) {
|
if (IS_ERR(ov7740->regmap)) {
|
||||||
ret = PTR_ERR(ov7740->regmap);
|
ret = PTR_ERR(ov7740->regmap);
|
||||||
dev_err(&client->dev, "Failed to allocate register map: %d\n",
|
dev_err(&client->dev, "Failed to allocate register map: %d\n",
|
||||||
@ -1100,7 +1093,6 @@ static int ov7740_probe(struct i2c_client *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sd = &ov7740->subdev;
|
sd = &ov7740->subdev;
|
||||||
client->flags |= I2C_CLIENT_SCCB;
|
|
||||||
v4l2_i2c_subdev_init(sd, client, &ov7740_subdev_ops);
|
v4l2_i2c_subdev_init(sd, client, &ov7740_subdev_ops);
|
||||||
|
|
||||||
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
|
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
|
||||||
|
Loading…
Reference in New Issue
Block a user