Commit 03efb2a0 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

[media] smiapp: Make PLL (quirk) flags a function



This is more flexible. Quirk flags may be affected by configuration.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 19e9f5f5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2617,8 +2617,8 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
	pll->bus_type = SMIAPP_PLL_BUS_TYPE_CSI2;
	pll->csi2.lanes = sensor->platform_data->lanes;
	pll->ext_clk_freq_hz = sensor->platform_data->ext_clk;
	if (sensor->minfo.quirk)
		pll->flags = sensor->minfo.quirk->pll_flags;
	pll->flags = smiapp_call_quirk(sensor, pll_flags);

	/* Profile 0 sensors have no separate OP clock branch. */
	if (sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0)
		pll->flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
+6 −1
Original line number Diff line number Diff line
@@ -220,12 +220,17 @@ static int jt8ev1_post_streamoff(struct smiapp_sensor *sensor)
	return smiapp_write_8(sensor, 0x3328, 0x80);
}

static unsigned long jt8ev1_pll_flags(struct smiapp_sensor *sensor)
{
	return SMIAPP_PLL_FLAG_OP_PIX_CLOCK_PER_LANE;
}

const struct smiapp_quirk smiapp_jt8ev1_quirk = {
	.limits = jt8ev1_limits,
	.post_poweron = jt8ev1_post_poweron,
	.pre_streamon = jt8ev1_pre_streamon,
	.post_streamoff = jt8ev1_post_streamoff,
	.pll_flags = SMIAPP_PLL_FLAG_OP_PIX_CLOCK_PER_LANE,
	.pll_flags = jt8ev1_pll_flags,
};

static int tcm8500md_limits(struct smiapp_sensor *sensor)
+1 −1
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@ struct smiapp_quirk {
	int (*post_poweron)(struct smiapp_sensor *sensor);
	int (*pre_streamon)(struct smiapp_sensor *sensor);
	int (*post_streamoff)(struct smiapp_sensor *sensor);
	unsigned long (*pll_flags)(struct smiapp_sensor *sensor);
	unsigned long flags;
	unsigned long pll_flags;
};

#define SMIAPP_QUIRK_FLAG_8BIT_READ_ONLY			(1 << 0)