brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0134-V4L2-Fix-ISO-controls.patch
1 From d9dc4b7760b20885d5bd1d17fd6dce818f1141e0 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Mon, 9 Dec 2013 15:30:48 +0000
4 Subject: [PATCH 134/174] V4L2: Fix ISO controls.
5
6 Driver was passing the index to the GPU, and not the desired
7 ISO value.
8
9 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
10 ---
11  drivers/media/platform/bcm2835/controls.c | 21 ++++++++++++++++++++-
12  1 file changed, 20 insertions(+), 1 deletion(-)
13
14 --- a/drivers/media/platform/bcm2835/controls.c
15 +++ b/drivers/media/platform/bcm2835/controls.c
16 @@ -178,6 +178,25 @@ static int ctrl_set_value(struct bm2835_
17                                              &u32_value, sizeof(u32_value));
18  }
19  
20 +static int ctrl_set_value_menu(struct bm2835_mmal_dev *dev,
21 +                     struct v4l2_ctrl *ctrl,
22 +                     const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl)
23 +{
24 +       u32 u32_value;
25 +       struct vchiq_mmal_port *control;
26 +
27 +       if (ctrl->val > mmal_ctrl->max || ctrl->val < mmal_ctrl->min)
28 +               return 1;
29 +
30 +       control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
31 +
32 +       u32_value = mmal_ctrl->imenu[ctrl->val];
33 +
34 +       return vchiq_mmal_port_parameter_set(dev->instance, control,
35 +                                            mmal_ctrl->mmal_id,
36 +                                            &u32_value, sizeof(u32_value));
37 +}
38 +
39  static int ctrl_set_value_ev(struct bm2835_mmal_dev *dev,
40                       struct v4l2_ctrl *ctrl,
41                       const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl)
42 @@ -601,7 +620,7 @@ static const struct bm2835_mmal_v4l2_ctr
43         {
44                 V4L2_CID_ISO_SENSITIVITY, MMAL_CONTROL_TYPE_INT_MENU,
45                 0, ARRAY_SIZE(iso_qmenu) - 1, 0, 1, iso_qmenu,
46 -               MMAL_PARAMETER_ISO, &ctrl_set_value
47 +               MMAL_PARAMETER_ISO, &ctrl_set_value_menu
48         },
49         {
50                 V4L2_CID_IMAGE_STABILIZATION, MMAL_CONTROL_TYPE_STD,