Commit 19a435f9 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: smiapp: Use CCS limits in reading binning capabilities

Use CCS limits for obtaining binning capabilities and subtypes.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 642d7c3e
...@@ -3105,26 +3105,17 @@ static int smiapp_probe(struct i2c_client *client) ...@@ -3105,26 +3105,17 @@ static int smiapp_probe(struct i2c_client *client)
} }
if (CCS_LIM(sensor, BINNING_CAPABILITY)) { if (CCS_LIM(sensor, BINNING_CAPABILITY)) {
u32 val; sensor->nbinning_subtypes =
min_t(u8, CCS_LIM(sensor, BINNING_SUB_TYPES),
rval = smiapp_read(sensor, CCS_LIM_BINNING_SUB_TYPE_MAX_N);
SMIAPP_REG_U8_BINNING_SUBTYPES, &val);
if (rval < 0) {
rval = -ENODEV;
goto out_free_ccs_limits;
}
sensor->nbinning_subtypes = min_t(u8, val,
SMIAPP_BINNING_SUBTYPES);
for (i = 0; i < sensor->nbinning_subtypes; i++) { for (i = 0; i < sensor->nbinning_subtypes; i++) {
rval = smiapp_read( sensor->binning_subtypes[i].horizontal =
sensor, SMIAPP_REG_U8_BINNING_TYPE_n(i), &val); CCS_LIM_AT(sensor, BINNING_SUB_TYPE, i) >>
if (rval < 0) { CCS_BINNING_SUB_TYPE_COLUMN_SHIFT;
rval = -ENODEV; sensor->binning_subtypes[i].vertical =
goto out_free_ccs_limits; CCS_LIM_AT(sensor, BINNING_SUB_TYPE, i) &
} CCS_BINNING_SUB_TYPE_ROW_MASK;
sensor->binning_subtypes[i] =
*(struct smiapp_binning_subtype *)&val;
dev_dbg(&client->dev, "binning %xx%x\n", dev_dbg(&client->dev, "binning %xx%x\n",
sensor->binning_subtypes[i].horizontal, sensor->binning_subtypes[i].horizontal,
......
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