diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2020-02-11 20:22:26 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-12-02 15:47:57 +0100 |
commit | ae7855a4f927cb7362926123851399073a7d54c2 (patch) | |
tree | c25f3ae6518646434f86f9fce71963dd6d46f784 | |
parent | b24cc2a18c50e4e315abc76a86b26b4c49652f79 (diff) |
media: ccs: Remove profile concept
The driver doesn't do anything tangible with profiles. Remove the notion,
and use the capabilities directly.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/i2c/ccs/ccs-core.c | 23 | ||||
-rw-r--r-- | drivers/media/i2c/ccs/ccs.h | 2 |
2 files changed, 6 insertions, 19 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 2dfb26cb3a40..cc3a81200050 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -377,7 +377,7 @@ static int ccs_pll_configure(struct ccs_sensor *sensor) rval = ccs_write(sensor, REQUESTED_LINK_RATE, DIV_ROUND_UP(pll->op.sys_clk_freq_hz, 1000000 / 256 / 256)); - if (rval < 0 || sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0) + if (rval < 0 || sensor->pll.flags & SMIAPP_PLL_FLAG_NO_OP_CLOCKS) return rval; rval = ccs_write(sensor, OP_PIX_CLK_DIV, pll->op.pix_clk_div); @@ -3096,23 +3096,17 @@ static int ccs_probe(struct i2c_client *client) } } - /* We consider this as profile 0 sensor if any of these are zero. */ if (!CCS_LIM(sensor, MIN_OP_SYS_CLK_DIV) || !CCS_LIM(sensor, MAX_OP_SYS_CLK_DIV) || !CCS_LIM(sensor, MIN_OP_PIX_CLK_DIV) || !CCS_LIM(sensor, MAX_OP_PIX_CLK_DIV)) { - sensor->minfo.smiapp_profile = SMIAPP_PROFILE_0; + /* No OP clock branch */ + sensor->pll.flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS; } else if (CCS_LIM(sensor, SCALING_CAPABILITY) - != CCS_SCALING_CAPABILITY_NONE) { - if (CCS_LIM(sensor, SCALING_CAPABILITY) - == CCS_SCALING_CAPABILITY_HORIZONTAL) - sensor->minfo.smiapp_profile = SMIAPP_PROFILE_1; - else - sensor->minfo.smiapp_profile = SMIAPP_PROFILE_2; - sensor->scaler = &sensor->ssds[sensor->ssds_used]; - sensor->ssds_used++; - } else if (CCS_LIM(sensor, DIGITAL_CROP_CAPABILITY) + != CCS_SCALING_CAPABILITY_NONE || + CCS_LIM(sensor, DIGITAL_CROP_CAPABILITY) == CCS_DIGITAL_CROP_CAPABILITY_INPUT_CROP) { + /* We have a scaler or digital crop. */ sensor->scaler = &sensor->ssds[sensor->ssds_used]; sensor->ssds_used++; } @@ -3128,16 +3122,11 @@ static int ccs_probe(struct i2c_client *client) sensor->pll.csi2.lanes = sensor->hwcfg->lanes; sensor->pll.ext_clk_freq_hz = sensor->hwcfg->ext_clk; sensor->pll.scale_n = CCS_LIM(sensor, SCALER_N_MIN); - /* Profile 0 sensors have no separate OP clock branch. */ - if (sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0) - sensor->pll.flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS; ccs_create_subdev(sensor, sensor->scaler, " scaler", 2); ccs_create_subdev(sensor, sensor->binner, " binner", 2); ccs_create_subdev(sensor, sensor->pixel_array, " pixel_array", 1); - dev_dbg(&client->dev, "profile %d\n", sensor->minfo.smiapp_profile); - sensor->pixel_array->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; rval = ccs_init_controls(sensor); diff --git a/drivers/media/i2c/ccs/ccs.h b/drivers/media/i2c/ccs/ccs.h index 7f6ed95b7b78..8933f3d40fa5 100644 --- a/drivers/media/i2c/ccs/ccs.h +++ b/drivers/media/i2c/ccs/ccs.h @@ -124,8 +124,6 @@ struct ccs_module_info { u32 smiapp_version; u32 ccs_version; - u32 smiapp_profile; - char *name; const struct ccs_quirk *quirk; }; |