Skip to content

Commit

Permalink
media: ti-vpe: cal: Inline cal_camerarx_max_lanes() in its only caller
Browse files Browse the repository at this point in the history
The cal_camerarx_max_lanes() function is a one-liner that has a single
caller. It doesn't improve readability. Inline it in its caller.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Benoit Parrot <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
pinchartl authored and sigmaris committed Aug 8, 2020
1 parent 2acd91b commit a0ee4ef
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/media/platform/ti-vpe/cal.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,19 +481,13 @@ static void cal_quickdump_regs(struct cal_dev *cal)
* ------------------------------------------------------------------
*/

static u32 cal_camerarx_max_lanes(struct cal_camerarx *phy)
{
return phy->cal->data->camerarx[phy->instance].num_lanes;
}

static void cal_camerarx_enable(struct cal_camerarx *phy)
{
u32 max_lanes;
u32 num_lanes = phy->cal->data->camerarx[phy->instance].num_lanes;

regmap_field_write(phy->fields[F_CAMMODE], 0);
/* Always enable all lanes at the phy control level */
max_lanes = (1 << cal_camerarx_max_lanes(phy)) - 1;
regmap_field_write(phy->fields[F_LANEENABLE], max_lanes);
regmap_field_write(phy->fields[F_LANEENABLE], (1 << num_lanes) - 1);
/* F_CSI_MODE is not present on every architecture */
if (phy->fields[F_CSI_MODE])
regmap_field_write(phy->fields[F_CSI_MODE], 1);
Expand Down

0 comments on commit a0ee4ef

Please sign in to comment.