diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-05-04 12:29:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-05 23:19:14 +0200 |
commit | 039510e80193ebd01cd035448b1aaf0e0fbd935a (patch) | |
tree | 4c058ce7b8839dbd0392fc7ce078eff819fa3fdf /drivers/staging/vc04_services/bcm2835-camera/controls.c | |
parent | staging: vt6655: Replace MACvReadISR with VNSvInPortD (diff) | |
download | wireguard-linux-039510e80193ebd01cd035448b1aaf0e0fbd935a.tar.xz wireguard-linux-039510e80193ebd01cd035448b1aaf0e0fbd935a.zip |
staging: vc04_services: Re-use generic struct s32_fract
Instead of custom data type re-use generic struct s32_fract.
No changes intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220504092915.72021-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/bcm2835-camera/controls.c')
-rw-r--r-- | drivers/staging/vc04_services/bcm2835-camera/controls.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index eb722f16fb91..5644d1d457b9 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -154,13 +154,13 @@ static int ctrl_set_rational(struct bcm2835_mmal_dev *dev, struct v4l2_ctrl *ctrl, const struct bcm2835_mmal_v4l2_ctrl *mmal_ctrl) { - struct mmal_parameter_rational rational_value; + struct s32_fract rational_value; struct vchiq_mmal_port *control; control = &dev->component[COMP_CAMERA]->control; - rational_value.num = ctrl->val; - rational_value.den = 100; + rational_value.numerator = ctrl->val; + rational_value.denominator = 100; return vchiq_mmal_port_parameter_set(dev->instance, control, mmal_ctrl->mmal_id, @@ -489,9 +489,10 @@ static int ctrl_set_awb_gains(struct bcm2835_mmal_dev *dev, else if (ctrl->id == V4L2_CID_BLUE_BALANCE) dev->blue_gain = ctrl->val; - gains.r_gain.num = dev->red_gain; - gains.b_gain.num = dev->blue_gain; - gains.r_gain.den = gains.b_gain.den = 1000; + gains.r_gain.numerator = dev->red_gain; + gains.r_gain.denominator = 1000; + gains.b_gain.numerator = dev->blue_gain; + gains.b_gain.denominator = 1000; return vchiq_mmal_port_parameter_set(dev->instance, control, mmal_ctrl->mmal_id, @@ -1271,26 +1272,26 @@ int set_framerate_params(struct bcm2835_mmal_dev *dev) struct mmal_parameter_fps_range fps_range; int ret; - fps_range.fps_high.num = dev->capture.timeperframe.denominator; - fps_range.fps_high.den = dev->capture.timeperframe.numerator; + fps_range.fps_high.numerator = dev->capture.timeperframe.denominator; + fps_range.fps_high.denominator = dev->capture.timeperframe.numerator; if ((dev->exposure_mode_active != MMAL_PARAM_EXPOSUREMODE_OFF) && (dev->exp_auto_priority)) { /* Variable FPS. Define min FPS as 1fps. */ - fps_range.fps_low.num = 1; - fps_range.fps_low.den = 1; + fps_range.fps_low.numerator = 1; + fps_range.fps_low.denominator = 1; } else { /* Fixed FPS - set min and max to be the same */ - fps_range.fps_low.num = fps_range.fps_high.num; - fps_range.fps_low.den = fps_range.fps_high.den; + fps_range.fps_low.numerator = fps_range.fps_high.numerator; + fps_range.fps_low.denominator = fps_range.fps_high.denominator; } v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "Set fps range to %d/%d to %d/%d\n", - fps_range.fps_low.num, - fps_range.fps_low.den, - fps_range.fps_high.num, - fps_range.fps_high.den); + fps_range.fps_low.numerator, + fps_range.fps_low.denominator, + fps_range.fps_high.numerator, + fps_range.fps_high.denominator); ret = vchiq_mmal_port_parameter_set(dev->instance, &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW], |