aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2014-04-08 17:18:10 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-04-23 10:30:32 -0400
commit03efb2a067beaea0496bd6e411452ca90dab9d01 (patch)
tree49fcb2f6abf222f919508b2678917ebf1a4628a8 /drivers
parent19e9f5f5391b41b684ddbd3066cd87509fdc2fd3 (diff)
[media] smiapp: Make PLL (quirk) flags a function
This is more flexible. Quirk flags may be affected by configuration. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/i2c/smiapp/smiapp-core.c4
-rw-r--r--drivers/media/i2c/smiapp/smiapp-quirk.c7
-rw-r--r--drivers/media/i2c/smiapp/smiapp-quirk.h2
3 files changed, 9 insertions, 4 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 23f2c4d45fc9..02041ccce22c 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2617,8 +2617,8 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
2617 pll->bus_type = SMIAPP_PLL_BUS_TYPE_CSI2; 2617 pll->bus_type = SMIAPP_PLL_BUS_TYPE_CSI2;
2618 pll->csi2.lanes = sensor->platform_data->lanes; 2618 pll->csi2.lanes = sensor->platform_data->lanes;
2619 pll->ext_clk_freq_hz = sensor->platform_data->ext_clk; 2619 pll->ext_clk_freq_hz = sensor->platform_data->ext_clk;
2620 if (sensor->minfo.quirk) 2620 pll->flags = smiapp_call_quirk(sensor, pll_flags);
2621 pll->flags = sensor->minfo.quirk->pll_flags; 2621
2622 /* Profile 0 sensors have no separate OP clock branch. */ 2622 /* Profile 0 sensors have no separate OP clock branch. */
2623 if (sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0) 2623 if (sensor->minfo.smiapp_profile == SMIAPP_PROFILE_0)
2624 pll->flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS; 2624 pll->flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
diff --git a/drivers/media/i2c/smiapp/smiapp-quirk.c b/drivers/media/i2c/smiapp/smiapp-quirk.c
index bd2f8a7f1926..e0bee8752122 100644
--- a/drivers/media/i2c/smiapp/smiapp-quirk.c
+++ b/drivers/media/i2c/smiapp/smiapp-quirk.c
@@ -220,12 +220,17 @@ static int jt8ev1_post_streamoff(struct smiapp_sensor *sensor)
220 return smiapp_write_8(sensor, 0x3328, 0x80); 220 return smiapp_write_8(sensor, 0x3328, 0x80);
221} 221}
222 222
223static unsigned long jt8ev1_pll_flags(struct smiapp_sensor *sensor)
224{
225 return SMIAPP_PLL_FLAG_OP_PIX_CLOCK_PER_LANE;
226}
227
223const struct smiapp_quirk smiapp_jt8ev1_quirk = { 228const struct smiapp_quirk smiapp_jt8ev1_quirk = {
224 .limits = jt8ev1_limits, 229 .limits = jt8ev1_limits,
225 .post_poweron = jt8ev1_post_poweron, 230 .post_poweron = jt8ev1_post_poweron,
226 .pre_streamon = jt8ev1_pre_streamon, 231 .pre_streamon = jt8ev1_pre_streamon,
227 .post_streamoff = jt8ev1_post_streamoff, 232 .post_streamoff = jt8ev1_post_streamoff,
228 .pll_flags = SMIAPP_PLL_FLAG_OP_PIX_CLOCK_PER_LANE, 233 .pll_flags = jt8ev1_pll_flags,
229}; 234};
230 235
231static int tcm8500md_limits(struct smiapp_sensor *sensor) 236static int tcm8500md_limits(struct smiapp_sensor *sensor)
diff --git a/drivers/media/i2c/smiapp/smiapp-quirk.h b/drivers/media/i2c/smiapp/smiapp-quirk.h
index ea8231c60c21..dddb62beeb29 100644
--- a/drivers/media/i2c/smiapp/smiapp-quirk.h
+++ b/drivers/media/i2c/smiapp/smiapp-quirk.h
@@ -41,8 +41,8 @@ struct smiapp_quirk {
41 int (*post_poweron)(struct smiapp_sensor *sensor); 41 int (*post_poweron)(struct smiapp_sensor *sensor);
42 int (*pre_streamon)(struct smiapp_sensor *sensor); 42 int (*pre_streamon)(struct smiapp_sensor *sensor);
43 int (*post_streamoff)(struct smiapp_sensor *sensor); 43 int (*post_streamoff)(struct smiapp_sensor *sensor);
44 unsigned long (*pll_flags)(struct smiapp_sensor *sensor);
44 unsigned long flags; 45 unsigned long flags;
45 unsigned long pll_flags;
46}; 46};
47 47
48#define SMIAPP_QUIRK_FLAG_8BIT_READ_ONLY (1 << 0) 48#define SMIAPP_QUIRK_FLAG_8BIT_READ_ONLY (1 << 0)