Commit 642d7c3e authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: smiapp: Use CCS limits in reading data format descriptors

The CCS limits have the information so use it instead.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent fd906581
...@@ -842,10 +842,7 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor) ...@@ -842,10 +842,7 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor)
unsigned int i, pixel_order; unsigned int i, pixel_order;
int rval; int rval;
rval = smiapp_read( type = CCS_LIM(sensor, DATA_FORMAT_MODEL_TYPE);
sensor, SMIAPP_REG_U8_DATA_FORMAT_MODEL_TYPE, &type);
if (rval)
return rval;
dev_dbg(&client->dev, "data_format_model_type %d\n", type); dev_dbg(&client->dev, "data_format_model_type %d\n", type);
...@@ -863,11 +860,11 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor) ...@@ -863,11 +860,11 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor)
pixel_order_str[pixel_order]); pixel_order_str[pixel_order]);
switch (type) { switch (type) {
case SMIAPP_DATA_FORMAT_MODEL_TYPE_NORMAL: case CCS_DATA_FORMAT_MODEL_TYPE_NORMAL:
n = SMIAPP_DATA_FORMAT_MODEL_TYPE_NORMAL_N; n = SMIAPP_DATA_FORMAT_MODEL_TYPE_NORMAL_N;
break; break;
case SMIAPP_DATA_FORMAT_MODEL_TYPE_EXTENDED: case CCS_DATA_FORMAT_MODEL_TYPE_EXTENDED:
n = SMIAPP_DATA_FORMAT_MODEL_TYPE_EXTENDED_N; n = CCS_LIM_DATA_FORMAT_DESCRIPTOR_MAX_N + 1;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -879,11 +876,7 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor) ...@@ -879,11 +876,7 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
unsigned int fmt, j; unsigned int fmt, j;
rval = smiapp_read( fmt = CCS_LIM_AT(sensor, DATA_FORMAT_DESCRIPTOR, i);
sensor,
SMIAPP_REG_U16_DATA_FORMAT_DESCRIPTOR(i), &fmt);
if (rval)
return rval;
dev_dbg(&client->dev, "%u: bpp %u, compressed %u\n", dev_dbg(&client->dev, "%u: bpp %u, compressed %u\n",
i, fmt >> 8, (u8)fmt); i, fmt >> 8, (u8)fmt);
...@@ -895,7 +888,10 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor) ...@@ -895,7 +888,10 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor)
if (f->pixel_order != SMIAPP_PIXEL_ORDER_GRBG) if (f->pixel_order != SMIAPP_PIXEL_ORDER_GRBG)
continue; continue;
if (f->width != fmt >> 8 || f->compressed != (u8)fmt) if (f->width != fmt >>
CCS_DATA_FORMAT_DESCRIPTOR_UNCOMPRESSED_SHIFT ||
f->compressed !=
(fmt & CCS_DATA_FORMAT_DESCRIPTOR_COMPRESSED_MASK))
continue; continue;
dev_dbg(&client->dev, "jolly good! %d\n", j); dev_dbg(&client->dev, "jolly good! %d\n", j);
......
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