Commit a99a041c authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: ov2680: Read and log sensor revision during probe

Read and log sensor revision during probe.

Since this means that the driver will now already log a message on
successful probe drop the "ov2680 init correctly" log message.
Acked-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: default avatarDaniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 1259259f
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define OV2680_REG_SOFT_RESET CCI_REG8(0x0103) #define OV2680_REG_SOFT_RESET CCI_REG8(0x0103)
#define OV2680_REG_CHIP_ID CCI_REG16(0x300a) #define OV2680_REG_CHIP_ID CCI_REG16(0x300a)
#define OV2680_REG_SC_CMMN_SUB_ID CCI_REG8(0x302a)
#define OV2680_REG_PLL_MULTIPLIER CCI_REG16(0x3081) #define OV2680_REG_PLL_MULTIPLIER CCI_REG16(0x3081)
#define OV2680_REG_EXPOSURE_PK CCI_REG24(0x3500) #define OV2680_REG_EXPOSURE_PK CCI_REG24(0x3500)
...@@ -966,13 +967,14 @@ static int ov2680_get_regulators(struct ov2680_dev *sensor) ...@@ -966,13 +967,14 @@ static int ov2680_get_regulators(struct ov2680_dev *sensor)
static int ov2680_check_id(struct ov2680_dev *sensor) static int ov2680_check_id(struct ov2680_dev *sensor)
{ {
u64 chip_id; u64 chip_id, rev;
int ret; int ret = 0;
ret = cci_read(sensor->regmap, OV2680_REG_CHIP_ID, &chip_id, NULL); cci_read(sensor->regmap, OV2680_REG_CHIP_ID, &chip_id, &ret);
cci_read(sensor->regmap, OV2680_REG_SC_CMMN_SUB_ID, &rev, &ret);
if (ret < 0) { if (ret < 0) {
dev_err(sensor->dev, "failed to read chip id\n"); dev_err(sensor->dev, "failed to read chip id\n");
return -ENODEV; return ret;
} }
if (chip_id != OV2680_CHIP_ID) { if (chip_id != OV2680_CHIP_ID) {
...@@ -981,6 +983,9 @@ static int ov2680_check_id(struct ov2680_dev *sensor) ...@@ -981,6 +983,9 @@ static int ov2680_check_id(struct ov2680_dev *sensor)
return -ENODEV; return -ENODEV;
} }
dev_info(sensor->dev, "sensor_revision id = 0x%llx, rev= %lld\n",
chip_id, rev & 0x0f);
return 0; return 0;
} }
...@@ -1121,8 +1126,6 @@ static int ov2680_probe(struct i2c_client *client) ...@@ -1121,8 +1126,6 @@ static int ov2680_probe(struct i2c_client *client)
pm_runtime_use_autosuspend(&client->dev); pm_runtime_use_autosuspend(&client->dev);
pm_runtime_put_autosuspend(&client->dev); pm_runtime_put_autosuspend(&client->dev);
dev_info(dev, "ov2680 init correctly\n");
return 0; return 0;
err_pm_runtime: err_pm_runtime:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment