@@ -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;
@@ -266,12 +266,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)
@@ -41,9 +41,9 @@ 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);
const struct smia_reg *regs;
unsigned long flags;
- unsigned long pll_flags;
};
#define SMIAPP_QUIRK_FLAG_8BIT_READ_ONLY (1 << 0)
This is more flexible. Quirk flags may be affected by configuration. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/smiapp/smiapp-core.c | 4 ++-- drivers/media/i2c/smiapp/smiapp-quirk.c | 7 ++++++- drivers/media/i2c/smiapp/smiapp-quirk.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-)