Commit 2bef6337 authored by Sakari Ailus's avatar Sakari Ailus Committed by Hans Verkuil

media: ccs: Support 16-bit sensor revision number register

Read 16-bit sensor revision number if the 8-bit register has value 0.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent c2fc1693
...@@ -2834,6 +2834,10 @@ static int ccs_identify_module(struct ccs_sensor *sensor) ...@@ -2834,6 +2834,10 @@ static int ccs_identify_module(struct ccs_sensor *sensor)
rval = ccs_read_addr_8only(sensor, rval = ccs_read_addr_8only(sensor,
CCS_R_SENSOR_REVISION_NUMBER, CCS_R_SENSOR_REVISION_NUMBER,
&minfo->sensor_revision_number); &minfo->sensor_revision_number);
if (!rval && !minfo->sensor_revision_number)
rval = ccs_read_addr_8only(sensor,
CCS_R_SENSOR_REVISION_NUMBER_16,
&minfo->sensor_revision_number);
if (!rval) if (!rval)
rval = ccs_read_addr_8only(sensor, rval = ccs_read_addr_8only(sensor,
CCS_R_SENSOR_FIRMWARE_VERSION, CCS_R_SENSOR_FIRMWARE_VERSION,
...@@ -2876,7 +2880,7 @@ static int ccs_identify_module(struct ccs_sensor *sensor) ...@@ -2876,7 +2880,7 @@ static int ccs_identify_module(struct ccs_sensor *sensor)
minfo->sensor_model_id); minfo->sensor_model_id);
dev_dbg(&client->dev, dev_dbg(&client->dev,
"sensor revision 0x%2.2x firmware version 0x%2.2x\n", "sensor revision 0x%4.4x firmware version 0x%2.2x\n",
minfo->sensor_revision_number, minfo->sensor_firmware_version); minfo->sensor_revision_number, minfo->sensor_firmware_version);
if (minfo->ccs_version) { if (minfo->ccs_version) {
......
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