Commit ce502efe authored by Martin Kepplinger's avatar Martin Kepplinger
Browse files

hi846: remove frame interval callbacks and implement s_power

frame inveral callbacks are not implemented for other drivers like
hi556 or our s5k3l6xx either and have been return wrong values
(in that they retured the large FPS values for larger modes where
they aren't supported).

s_power simply wasn't implemented at all and now should at least
power on and off.
parent 91cbe225
......@@ -1239,20 +1239,6 @@ static int __maybe_unused hi846_resume(struct device *dev)
return ret;
static int hi846_get_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_frame_interval *f_interval)
struct hi846 *hi846 = to_hi846(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
dev_dbg(&client->dev, "starting %s\n", __func__);
f_interval->interval.numerator = 1;
f_interval->interval.denominator = hi846->cur_mode->fps;
return 0;
static int hi846_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *format)
......@@ -1388,41 +1374,28 @@ static int hi846_enum_frame_size(struct v4l2_subdev *sd,
return 0;
static int hi846_enum_frame_intervals(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_interval_enum *fie)
static int hi846_s_power(struct v4l2_subdev *sd, int on)
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct device *dev = &client->dev;
dev_dbg(dev, "starting %s index %d\n", __func__, fie->index);
if (fie->pad || fie->index >= ARRAY_SIZE(supported_modes))
return -EINVAL;
fie->interval.numerator = 1;
fie->interval.denominator = supported_modes[fie->index].fps;
dev_dbg(dev, "%s: index: %d: %d / %d\n", __func__, fie->index,
fie->interval.numerator, fie->interval.denominator);
return 0;
if (on)
return hi846_resume(dev);
return hi846_suspend(dev);
static int hi846_s_power(struct v4l2_subdev *sd, int on)
static int hi846_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
return 0;
static const struct v4l2_subdev_video_ops hi846_video_ops = {
.s_stream = hi846_set_stream,
.s_frame_interval = hi846_get_frame_interval,
.g_frame_interval = hi846_get_frame_interval,
static const struct v4l2_subdev_pad_ops hi846_pad_ops = {
.enum_frame_size = hi846_enum_frame_size,
.enum_frame_interval = hi846_enum_frame_intervals,
.enum_mbus_code = hi846_enum_mbus_code,
.set_fmt = hi846_set_format,
.get_fmt = hi846_get_format,
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