Commit b1c57943 authored by Janusz Krzysztofik's avatar Janusz Krzysztofik Committed by Mauro Carvalho Chehab

media: ov6650: Drop obsolete .pclk_limit attribute

That attribute used to be obtained from platform data by a soc_camera
host interface and passed to the sensor driver for .s_mbus_fmt() video
operation callback, later reused as .set_fmt() pad operation callback,
to be able to limit frame rate.  The driver stored that value in its
private structure for further use from .g/s_parm(), later converted to
g/s_frame_interval().

On conversion of the driver from soc_camera sensor to a standalone V4L2
subdevice by commit 23a52386 ("media: ov6650: convert to standalone
v4l2 subdevice"), that attribute had been replaced by a constant and
hardcoded to an arbitrarily chosen pixel clock limit.  Drop it.  Host
interfaces can limit frame rate if needed by calling
.s_frame_interval().
Signed-off-by: default avatarJanusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 57822068
...@@ -197,7 +197,6 @@ struct ov6650 { ...@@ -197,7 +197,6 @@ struct ov6650 {
struct v4l2_clk *clk; struct v4l2_clk *clk;
bool half_scale; /* scale down output by 2 */ bool half_scale; /* scale down output by 2 */
struct v4l2_rect rect; /* sensor cropping window */ struct v4l2_rect rect; /* sensor cropping window */
unsigned long pclk_limit; /* from host */
unsigned long pclk_max; /* from resolution and format */ unsigned long pclk_max; /* from resolution and format */
struct v4l2_fract tpf; /* as requested with s_frame_interval */ struct v4l2_fract tpf; /* as requested with s_frame_interval */
u32 code; u32 code;
...@@ -546,8 +545,7 @@ static bool is_unscaled_ok(int width, int height, struct v4l2_rect *rect) ...@@ -546,8 +545,7 @@ static bool is_unscaled_ok(int width, int height, struct v4l2_rect *rect)
return width > rect->width >> 1 || height > rect->height >> 1; return width > rect->width >> 1 || height > rect->height >> 1;
} }
static u8 to_clkrc(struct v4l2_fract *timeperframe, static u8 to_clkrc(struct v4l2_fract *timeperframe, unsigned long pclk_max)
unsigned long pclk_limit, unsigned long pclk_max)
{ {
unsigned long pclk; unsigned long pclk;
...@@ -557,9 +555,6 @@ static u8 to_clkrc(struct v4l2_fract *timeperframe, ...@@ -557,9 +555,6 @@ static u8 to_clkrc(struct v4l2_fract *timeperframe,
else else
pclk = pclk_max; pclk = pclk_max;
if (pclk_limit && pclk_limit < pclk)
pclk = pclk_limit;
return (pclk_max - 1) / pclk; return (pclk_max - 1) / pclk;
} }
...@@ -653,10 +648,9 @@ static int ov6650_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) ...@@ -653,10 +648,9 @@ static int ov6650_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
clkrc = CLKRC_12MHz; clkrc = CLKRC_12MHz;
mclk = 12000000; mclk = 12000000;
priv->pclk_limit = 1334000;
dev_dbg(&client->dev, "using 12MHz input clock\n"); dev_dbg(&client->dev, "using 12MHz input clock\n");
clkrc |= to_clkrc(&priv->tpf, priv->pclk_limit, priv->pclk_max); clkrc |= to_clkrc(&priv->tpf, priv->pclk_max);
pclk = priv->pclk_max / GET_CLKRC_DIV(clkrc); pclk = priv->pclk_max / GET_CLKRC_DIV(clkrc);
dev_dbg(&client->dev, "pixel clock divider: %ld.%ld\n", dev_dbg(&client->dev, "pixel clock divider: %ld.%ld\n",
...@@ -756,7 +750,7 @@ static int ov6650_g_frame_interval(struct v4l2_subdev *sd, ...@@ -756,7 +750,7 @@ static int ov6650_g_frame_interval(struct v4l2_subdev *sd,
struct ov6650 *priv = to_ov6650(client); struct ov6650 *priv = to_ov6650(client);
ival->interval.numerator = GET_CLKRC_DIV(to_clkrc(&priv->tpf, ival->interval.numerator = GET_CLKRC_DIV(to_clkrc(&priv->tpf,
priv->pclk_limit, priv->pclk_max)); priv->pclk_max));
ival->interval.denominator = FRAME_RATE_MAX; ival->interval.denominator = FRAME_RATE_MAX;
dev_dbg(&client->dev, "Frame interval: %u/%u s\n", dev_dbg(&client->dev, "Frame interval: %u/%u s\n",
...@@ -787,7 +781,7 @@ static int ov6650_s_frame_interval(struct v4l2_subdev *sd, ...@@ -787,7 +781,7 @@ static int ov6650_s_frame_interval(struct v4l2_subdev *sd,
tpf->numerator = div; tpf->numerator = div;
tpf->denominator = FRAME_RATE_MAX; tpf->denominator = FRAME_RATE_MAX;
clkrc = to_clkrc(tpf, priv->pclk_limit, priv->pclk_max); clkrc = to_clkrc(tpf, priv->pclk_max);
ret = ov6650_reg_rmw(client, REG_CLKRC, clkrc, CLKRC_DIV_MASK); ret = ov6650_reg_rmw(client, REG_CLKRC, clkrc, CLKRC_DIV_MASK);
if (!ret) { if (!ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment