mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 15:13:55 +08:00
[media] smiapp: Split calculating PLL with sensor's limits from updating it
The first one is handy for just trying out a PLL configuration without a need to apply it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
83313d9ff6
commit
183bec80ce
@ -240,7 +240,8 @@ static int smiapp_pll_configure(struct smiapp_sensor *sensor)
|
|||||||
sensor, SMIAPP_REG_U16_OP_SYS_CLK_DIV, pll->op.sys_clk_div);
|
sensor, SMIAPP_REG_U16_OP_SYS_CLK_DIV, pll->op.sys_clk_div);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int smiapp_pll_update(struct smiapp_sensor *sensor)
|
static int smiapp_pll_try(struct smiapp_sensor *sensor,
|
||||||
|
struct smiapp_pll *pll)
|
||||||
{
|
{
|
||||||
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
|
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
|
||||||
struct smiapp_pll_limits lim = {
|
struct smiapp_pll_limits lim = {
|
||||||
@ -274,6 +275,12 @@ static int smiapp_pll_update(struct smiapp_sensor *sensor)
|
|||||||
.min_line_length_pck_bin = sensor->limits[SMIAPP_LIMIT_MIN_LINE_LENGTH_PCK_BIN],
|
.min_line_length_pck_bin = sensor->limits[SMIAPP_LIMIT_MIN_LINE_LENGTH_PCK_BIN],
|
||||||
.min_line_length_pck = sensor->limits[SMIAPP_LIMIT_MIN_LINE_LENGTH_PCK],
|
.min_line_length_pck = sensor->limits[SMIAPP_LIMIT_MIN_LINE_LENGTH_PCK],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return smiapp_pll_calculate(&client->dev, &lim, pll);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int smiapp_pll_update(struct smiapp_sensor *sensor)
|
||||||
|
{
|
||||||
struct smiapp_pll *pll = &sensor->pll;
|
struct smiapp_pll *pll = &sensor->pll;
|
||||||
int rval;
|
int rval;
|
||||||
|
|
||||||
@ -284,7 +291,7 @@ static int smiapp_pll_update(struct smiapp_sensor *sensor)
|
|||||||
pll->scale_m = sensor->scale_m;
|
pll->scale_m = sensor->scale_m;
|
||||||
pll->bits_per_pixel = sensor->csi_format->compressed;
|
pll->bits_per_pixel = sensor->csi_format->compressed;
|
||||||
|
|
||||||
rval = smiapp_pll_calculate(&client->dev, &lim, pll);
|
rval = smiapp_pll_try(sensor, pll);
|
||||||
if (rval < 0)
|
if (rval < 0)
|
||||||
return rval;
|
return rval;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user